@tgsnake/core
Version:
Pure Telegram MTProto library for nodejs
30 lines (29 loc) • 1.59 kB
TypeScript
import { Raw } from '../../raw/index.js';
import { type AbstractSession } from '../../storage/index.js';
import { Buffer } from '../../platform.node.js';
import type { Client } from '../../client/Client.js';
export declare class SecretChat {
private _storage;
private _client;
private _dhConfig;
private _mutex;
private _tempAuthKey;
private _waiting;
constructor(storage: AbstractSession, client: Client);
private reqDHConfig;
start(userId: bigint | string): Promise<Raw.TypeEncryptedChat>;
accept(request: Raw.EncryptedChatRequested): Promise<Raw.TypeEncryptedChat>;
finish(chat: Raw.EncryptedChat): Promise<Raw.messages.TypeSentEncryptedMessage | undefined>;
notifyLayer(chatId: number): Promise<Raw.messages.TypeSentEncryptedMessage | undefined>;
destroy(chatId: number): Promise<boolean>;
rekeying(chatId: number): Promise<Raw.messages.TypeSentEncryptedMessage>;
acceptRekeying(chatId: number, action: Raw.DecryptedMessageActionRequestKey20): Promise<Raw.messages.TypeSentEncryptedMessage | undefined>;
commitRekeying(chatId: number, action: Raw.DecryptedMessageActionAcceptKey20): Promise<Raw.messages.TypeSentEncryptedMessage | undefined>;
finalRekeying(chatId: number, action: Raw.DecryptedMessageActionCommitKey20): Promise<Raw.messages.TypeSentEncryptedMessage | undefined>;
decrypt(message: Raw.TypeEncryptedMessage): Promise<any>;
encrypt(chatId: number, message: Raw.TypeDecryptedMessage): Promise<Buffer<ArrayBufferLike>>;
toJSON(): {
[key: string]: any;
};
toString(): string;
}