teleproto - v1.229.0
    Preparing search index...

    Interface UserAuthParams

    For when you want to login as a Api.User
    this should handle all needed steps for authorization as a user.
    to stop the operation at any point just raise and error with the message AUTH_USER_CANCEL.

    interface UserAuthParams {
        emailAddress?: () => Promise<string>;
        emailVerification?: (
            options: EmailVerificationOptions,
        ) => Promise<EmailVerificationResult>;
        firstAndLastNames?: () => Promise<[string, string?]>;
        forceSMS?: boolean;
        onError: (err: Error) => void | Promise<boolean>;
        password?: (hint?: string) => Promise<string>;
        phoneCode: (isCodeViaApp?: boolean) => Promise<string>;
        phoneNumber: string | (() => Promise<string>);
        qrCode?: (qrCode: { expires: number; token: Buffer }) => Promise<void>;
        reCaptchaCallback?: (siteKey: string) => Promise<string>;
    }
    Index
    emailAddress?: () => Promise<string>

    callback to get email address when email setup is required.
    Called first when auth.SentCodeTypeSetUpEmailRequired is received.

    emailVerification?: (
        options: EmailVerificationOptions,
    ) => Promise<EmailVerificationResult>

    callback for email verification when Telegram requires email setup or code.
    Called when auth.SentCodeTypeSetUpEmailRequired or auth.SentCodeTypeEmailCode is received.
    For setup: should return email address to use and then handle verification code.
    For existing email: should return the verification result (code, Google token, or Apple token).

    firstAndLastNames?: () => Promise<[string, string?]>

    in case of a new account creation this callback should return a first name and last name [first,last].

    forceSMS?: boolean

    whether to send the code through SMS or not.

    onError: (err: Error) => void | Promise<boolean>

    when an error happens during auth this function will be called with the error.
    if this returns true the auth operation will stop.

    password?: (hint?: string) => Promise<string>

    optional string or callback that should return the 2FA password if present.
    the password hint will be sent in the hint param

    phoneCode: (isCodeViaApp?: boolean) => Promise<string>

    callback that should return the login code that telegram sent.
    has optional bool isCodeViaApp param for whether the code was sent through the app (true) or an SMS (false).

    phoneNumber: string | (() => Promise<string>)

    Either a string or a callback that returns a string for the phone to use to login.

    qrCode?: (qrCode: { expires: number; token: Buffer }) => Promise<void>

    a qrCode token for login through qrCode.
    this would need a QR code that you should scan with another app to login with.

    reCaptchaCallback?: (siteKey: string) => Promise<string>

    optional callback for handling reCAPTCHA.