import { isConst, isObject } from '../../utils/types'

type SignUpBody = {
    email: string,
    password: string,
    name: string,
    surname: string,
}

type SignUpResponse = {
    Success: true,
} | {
    Success: false,
    Message: string,
}

const isSignUpResponse = (obj: unknown): obj is SignUpResponse => (
    isObject(obj, {
        'Success': isConst(true),
    }) || isObject(obj, {
        'Success': isConst(false),
        'Message': 'string',
    })
)

type SignUp = boolean

export type { SignUpBody, SignUpResponse, SignUp }

export { isSignUpResponse }
