@telegram-apps/sdk
Version:
TypeScript Source Development Kit for Telegram Mini Apps client application.
36 lines (35 loc) • 1.54 kB
TypeScript
import { EventListener } from '@telegram-apps/bridge';
declare const EVENT_NAME = "home_screen_failed";
/**
* Adds the event listener that being called whenever the user declines the request to add the
* current mini app to the device's home screen.
* @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
* @example
* if (onAddToHomeScreenFailed.isAvailable()) {
* const off = onAddToHomeScreenFailed(() => {
* console.log('Failed to add to home screen');
* off();
* });
* }
*/
export declare const onAddToHomeScreenFailed: import('../../wrappers/wrapSafe.js').SafeWrapped<(listener: EventListener<typeof EVENT_NAME>, once?: boolean) => VoidFunction, true, never>;
/**
* Removes add to home screen failed event listener.
* @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
* @example
* if (offAddToHomeScreenFailed.isAvailable()) {
* const handler = () => {
* console.log('Failed to add');
* offAddToHomeScreenFailed(handler);
* };
* onAddToHomeScreenFailed(handler);
* }
*/
export declare const offAddToHomeScreenFailed: import('../../wrappers/wrapSafe.js').SafeWrapped<(listener: EventListener<typeof EVENT_NAME>) => void, true, never>;
export {};