import { ITelegramClient } from '../../client.types.js'; import { UploadedFile, UploadFileLike } from '../../types/index.js'; /** * Upload a file to Telegram servers, without actually * sending a message anywhere. Useful when an `InputFile` is required. * * This method is quite low-level, and you should use other * methods like {@link sendMedia} that handle this under the hood. * * @param params Upload parameters */ export declare function uploadFile(client: ITelegramClient, params: { /** * Upload file source. */ file: UploadFileLike; /** * File name for the uploaded file. Is usually inferred from path, * but should be provided for files sent as `Buffer` or stream. * * When file name can't be inferred, it falls back to "unnamed" */ fileName?: string; /** * Total file size. Automatically inferred for Buffer, File and local files. */ fileSize?: number; /** * If the file size is unknown, you can provide an estimate, * which will be used to determine appropriate part size. */ estimatedSize?: number; /** * File MIME type. By default is automatically inferred from magic number * If MIME can't be inferred, it defaults to `application/octet-stream` */ fileMime?: string; /** * Upload part size (in KB). * * By default, automatically selected by file size. * Must not be bigger than 512 and must not be a fraction. */ partSize?: number; /** * Number of parts to be sent in parallel per connection. */ requestsPerConnection?: number; /** * Function that will be called after some part has been uploaded. * * @param uploaded Number of bytes already uploaded * @param total Total file size, if known */ progressCallback?: (uploaded: number, total: number) => void; /** * When using `inputMediaUploadedPhoto` (e.g. when sending an uploaded photo) require * the file size to be known beforehand. * * In case this is set to `true`, a stream is passed as `file` and the file size is unknown, * the stream will be buffered in memory and the file size will be inferred from the buffer. */ requireFileSize?: boolean; /** * When using `inputMediaUploadedPhoto` (e.g. when sending an uploaded photo) require * the file extension to be known beforehand. * * This will make the library try to guess the file extension from the file mime type, * or throw an error if it cannot be guessed. */ requireExtension?: boolean; abortSignal?: AbortSignal; }): Promise;