@tgsnake/core
Version:
Pure Telegram MTProto library for nodejs
20 lines (19 loc) • 869 B
TypeScript
import { type Readable, Buffer } from '../platform.node.js';
import { type Client } from '../client/Client.js';
import { File } from './File.js';
import { Raw } from '../raw/index.js';
export type Progress = (current: number, total: number) => any;
export interface SaveFileParams {
source: Buffer;
fileName?: string;
fileId?: bigint;
filePart?: number;
progress?: Progress;
}
export interface SaveFileStreamParams {
source: Readable | File;
fileName?: string;
progress?: Progress;
}
export declare function upload(client: Client, source: Buffer, fileName?: string, fileId?: bigint, filePart?: number, progress?: Progress): Promise<Raw.InputFile | Raw.InputFileBig | undefined>;
export declare function uploadStream(client: Client, source: Readable | File, fileName?: string, progress?: Progress): Promise<Raw.InputFileBig | undefined>;