UNPKG

tgsnake

Version:

Telegram MTProto framework for nodejs.

37 lines (36 loc) 1.25 kB
import { Storages, Buffer } from '../platform.node.js'; export declare class SnakeSession extends Storages.BaseSession { private _name; private _sessionDir; private _sessionExt; private _cacheDir; private _cacheExt; constructor(name: string, sessionDir: string, sessionExt: string, cacheDir: string, cacheExt: string); load(): Promise<void>; save(): Promise<void>; private _loadCache; private _loadE2E; private _makeCache; private _makeE2E; toJSON(): { [key: string]: any; }; toString(): string; } export declare function buildBytesFromPeer(peer: [ id: bigint, accessHash: bigint, type: string, username?: Array<string>, phoneNumber?: string ]): Buffer; export declare function buildPeerFromBytes(bytes: Buffer): Promise<[ id: bigint, accessHash: bigint, type: string, username?: Array<string>, phoneNumber?: string ]>; export declare function buildBytesFromSecretChat(secretChat: Storages.SecretChat): Buffer; export declare function buildSecretChatFromBytes(bytes: Buffer): Promise<Storages.SecretChat>; export declare function generateName(base: string, loginPath: string, loginExt: string, cachePath: string, cacheExt: string): string;