UNPKG

@tgsnake/core

Version:

Pure Telegram MTProto library for nodejs

41 lines (40 loc) 1.77 kB
import type { Client } from './Client.js'; import { Raw } from '../raw/index.js'; import * as Errors from '../errors/index.js'; export interface SigInBot { botToken: string | Promise<string>; } export interface SigInUser { phoneNumber: { (): Promise<string>; }; password?: { (hint: string): Promise<string>; }; recoveryCode?: { (): Promise<string>; }; code: { (): Promise<string>; }; firstname?: { (): Promise<string>; }; lastname?: { (): Promise<string>; }; authError?: { (error: Errors.Exceptions.BadRequest.BadRequest): void; }; } export declare function siginBot(this: Client, botToken: string): Promise<Raw.User | undefined>; export declare function siginUser(this: Client, auth: SigInUser): Promise<Raw.User | undefined>; export declare function sendCode(this: Client, phoneNumber: string): Promise<Raw.auth.TypeSentCode>; export declare function sigin(this: Client, phoneNumber: string, phoneCodeHash: string, phoneCode: string): Promise<Raw.User | Raw.help.TermsOfService | boolean>; export declare function recoverPassword(this: Client, code: string): Promise<Raw.User | undefined>; export declare function sendRecoveryCode(this: Client): Promise<string>; export declare function checkPassword(this: Client, password: string): Promise<Raw.User | undefined>; export declare function acceptTOS(this: Client, id: string): Promise<boolean>; export declare function getPasswordHint(this: Client): Promise<string>; export declare function signup(this: Client, phoneNumber: string, phoneCodeHash: string, firstname: string, lastname?: string): Promise<Raw.User | undefined>; export declare function getMe(this: Client): Promise<Raw.users.UserFull>;