@telegram-apps/sdk
Version:
TypeScript Source Development Kit for Telegram Mini Apps client application.
51 lines (50 loc) • 2.23 kB
TypeScript
import { ImpactHapticFeedbackStyle, NotificationHapticFeedbackType } from '@telegram-apps/bridge';
/**
* Signal indicating if the Haptic Feedback is supported.
*/
export declare const isSupported: import('@telegram-apps/signals').Computed<boolean>;
/**
* A method that tells if an impact occurred. The Telegram app may play the
* appropriate haptics based on style value passed.
* @param style - impact style.
* @since Mini Apps v6.1
* @throws {FunctionNotAvailableError} The environment is unknown
* @throws {FunctionNotAvailableError} The SDK is not initialized
* @throws {FunctionNotAvailableError} The function is not supported
* @example
* if (impactOccurred.isAvailable()) {
* impactOccurred('medium');
* }
*/
export declare const impactOccurred: import('../../wrappers/wrapSafe.js').SafeWrapped<(style: ImpactHapticFeedbackStyle) => void, true, never>;
/**
* A method tells that a task or action has succeeded, failed, or produced
* a warning. The Telegram app may play the appropriate haptics based on type
* value passed.
* @param type - notification type.
* @since Mini Apps v6.1
* @throws {FunctionNotAvailableError} The environment is unknown
* @throws {FunctionNotAvailableError} The SDK is not initialized
* @throws {FunctionNotAvailableError} The function is not supported
* @example
* if (notificationOccurred.isAvailable()) {
* notificationOccurred('success');
* }
*/
export declare const notificationOccurred: import('../../wrappers/wrapSafe.js').SafeWrapped<(type: NotificationHapticFeedbackType) => void, true, never>;
/**
* A method tells that the user has changed a selection. The Telegram app may
* play the appropriate haptics.
*
* Do not use this feedback when the user makes or confirms a selection; use
* it only when the selection changes.
* @since Mini Apps v6.1
* @throws {FunctionNotAvailableError} The environment is unknown
* @throws {FunctionNotAvailableError} The SDK is not initialized
* @throws {FunctionNotAvailableError} The function is not supported
* @example
* if (selectionChanged.isAvailable()) {
* selectionChanged();
* }
*/
export declare const selectionChanged: import('../../wrappers/wrapSafe.js').SafeWrapped<() => void, true, never>;