@telegram-apps/sdk
Version:
TypeScript Source Development Kit for Telegram Mini Apps client application.
18 lines (17 loc) • 957 B
TypeScript
import { RequestOptionsNoCapture } from '../../../types.js';
/**
* Displays a native popup prompting the user to download a file.
* @param url - the HTTPS URL of the file to be downloaded.
* @param file - the suggested name for the downloaded file.
* @param options - additional request execution options.
* @since Mini Apps v8.0
* @throws {FunctionNotAvailableError} The environment is unknown
* @throws {FunctionNotAvailableError} The SDK is not initialized
* @throws {FunctionNotAvailableError} The function is not supported
* @throws {AccessDeniedError} User denied the action
* @example
* if (downloadFile.isAvailable()) {
* await downloadFile('https://telegram.org/js/telegram-web-app.js', 'telegram-sdk.js');
* }
*/
export declare const downloadFile: import('../../wrappers/wrapSafe.js').SafeWrapped<(url: string, fileName: string, options?: RequestOptionsNoCapture) => import('better-promises').AbortablePromise<void>, true, never>;