diff --git a/packages/client/scripts/generate-client.js b/packages/client/scripts/generate-client.js index e1302e73..82832455 100644 --- a/packages/client/scripts/generate-client.js +++ b/packages/client/scripts/generate-client.js @@ -107,7 +107,12 @@ async function addSingleMethod(state, fileName) { ) } - const isPrivate = name[0] === '_' && name !== '_handleUpdate' + const isPrivate = + name[0] === '_' && + name !== '_handleUpdate' && + name !== '_normalizeInputFile' && + name !== '_normalizeInputMedia' + const isExported = (stmt.modifiers || []).find( (mod) => mod.kind === 92 /* ExportKeyword */ ) diff --git a/packages/client/src/client.ts b/packages/client/src/client.ts index a4c8ea00..189b0179 100644 --- a/packages/client/src/client.ts +++ b/packages/client/src/client.ts @@ -1472,6 +1472,33 @@ export interface TelegramClient extends BaseTelegramClient { * @param params File download parameters */ downloadAsStream(params: FileDownloadParameters): Readable + /** + * Normalize a {@link InputFileLike} to `InputFile`, + * uploading it if needed. + * + */ + _normalizeInputFile( + input: InputFileLike, + params: { + progressCallback?: (uploaded: number, total: number) => void + fileName?: string + fileSize?: number + fileMime?: string + } + ): Promise + /** + * Normalize an {@link InputMediaLike} to `InputMedia`, + * uploading the file if needed. + * + */ + _normalizeInputMedia( + media: InputMediaLike, + params: { + parseMode?: string | null + progressCallback?: (uploaded: number, total: number) => void + }, + uploadMedia?: boolean + ): Promise /** * Upload a file to Telegram servers, without actually * sending a message anywhere. Useful when an `InputFile` is required. @@ -3162,8 +3189,8 @@ export class TelegramClient extends BaseTelegramClient { downloadAsIterable = downloadAsIterable downloadAsStream = downloadAsStream protected _normalizeFileToDocument = _normalizeFileToDocument - protected _normalizeInputFile = _normalizeInputFile - protected _normalizeInputMedia = _normalizeInputMedia + _normalizeInputFile = _normalizeInputFile + _normalizeInputMedia = _normalizeInputMedia uploadFile = uploadFile createInviteLink = createInviteLink editInviteLink = editInviteLink