@tma.js/sdk 2.7.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +9 -9
- package/dist/dts/composables/AsyncMountable.d.ts +44 -0
- package/dist/dts/composables/Button.d.ts +140 -0
- package/dist/dts/composables/Mountable.d.ts +43 -0
- package/dist/dts/composables/Stateful.d.ts +35 -0
- package/dist/dts/errors.d.ts +41 -0
- package/dist/dts/features/BackButton/BackButton.d.ts +96 -0
- package/dist/dts/features/BackButton/exports.d.ts +2 -0
- package/dist/dts/features/BackButton/instance.d.ts +2 -0
- package/dist/dts/features/Biometry/Biometry.d.ts +122 -0
- package/dist/dts/features/Biometry/exports.d.ts +3 -0
- package/dist/dts/features/Biometry/instance.d.ts +2 -0
- package/dist/dts/features/Biometry/types.d.ts +84 -0
- package/dist/dts/features/ClosingBehavior/ClosingBehavior.d.ts +51 -0
- package/dist/dts/features/ClosingBehavior/exports.d.ts +2 -0
- package/dist/dts/features/ClosingBehavior/instance.d.ts +2 -0
- package/dist/dts/features/CloudStorage/CloudStorage.d.ts +90 -0
- package/dist/dts/features/CloudStorage/exports.d.ts +2 -0
- package/dist/dts/features/CloudStorage/instance.d.ts +2 -0
- package/dist/dts/features/HapticFeedback/HapticFeedback.d.ts +57 -0
- package/dist/dts/features/HapticFeedback/exports.d.ts +2 -0
- package/dist/dts/features/HapticFeedback/instance.d.ts +2 -0
- package/dist/dts/features/InitData/InitData.d.ts +84 -0
- package/dist/dts/features/InitData/exports.d.ts +2 -0
- package/dist/dts/features/InitData/instance.d.ts +2 -0
- package/dist/dts/features/Invoice/Invoice.d.ts +54 -0
- package/dist/dts/features/Invoice/exports.d.ts +2 -0
- package/dist/dts/features/Invoice/instance.d.ts +2 -0
- package/dist/dts/features/LocationManager/LocationManager.d.ts +74 -0
- package/dist/dts/features/LocationManager/exports.d.ts +3 -0
- package/dist/dts/features/LocationManager/instance.d.ts +2 -0
- package/dist/dts/features/LocationManager/types.d.ts +65 -0
- package/dist/dts/features/MainButton/MainButton.d.ts +214 -0
- package/dist/dts/features/MainButton/exports.d.ts +2 -0
- package/dist/dts/features/MainButton/instance.d.ts +2 -0
- package/dist/dts/features/MiniApp/MiniApp.d.ts +192 -0
- package/dist/dts/features/MiniApp/exports.d.ts +2 -0
- package/dist/dts/features/MiniApp/instance.d.ts +2 -0
- package/dist/dts/features/Popup/Popup.d.ts +56 -0
- package/dist/dts/features/Popup/exports.d.ts +3 -0
- package/dist/dts/features/Popup/instance.d.ts +2 -0
- package/dist/dts/features/Popup/prepareParams.d.ts +9 -0
- package/dist/dts/{components → features}/Popup/types.d.ts +5 -12
- package/dist/dts/features/QrScanner/QrScanner.d.ts +132 -0
- package/dist/dts/features/QrScanner/exports.d.ts +2 -0
- package/dist/dts/features/QrScanner/instance.d.ts +2 -0
- package/dist/dts/features/SecondaryButton/SecondaryButton.d.ts +253 -0
- package/dist/dts/features/SecondaryButton/exports.d.ts +2 -0
- package/dist/dts/features/SecondaryButton/instance.d.ts +2 -0
- package/dist/dts/features/SettingsButton/SettingsButton.d.ts +96 -0
- package/dist/dts/features/SettingsButton/exports.d.ts +2 -0
- package/dist/dts/features/SettingsButton/instance.d.ts +2 -0
- package/dist/dts/features/SwipeBehavior/SwipeBehavior.d.ts +62 -0
- package/dist/dts/features/SwipeBehavior/exports.d.ts +2 -0
- package/dist/dts/features/SwipeBehavior/instance.d.ts +2 -0
- package/dist/dts/features/ThemeParams/ThemeParams.d.ts +127 -0
- package/dist/dts/features/ThemeParams/exports.d.ts +2 -0
- package/dist/dts/features/ThemeParams/instance.d.ts +2 -0
- package/dist/dts/features/Viewport/Viewport.d.ts +220 -0
- package/dist/dts/features/Viewport/exports.d.ts +2 -0
- package/dist/dts/features/Viewport/instance.d.ts +2 -0
- package/dist/dts/features/emoji-status/exports.d.ts +2 -0
- package/dist/dts/features/emoji-status/requestEmojiStatusAccess.d.ts +16 -0
- package/dist/dts/features/emoji-status/setEmojiStatus.d.ts +28 -0
- package/dist/dts/features/home-screen/addToHomeScreen.d.ts +11 -0
- package/dist/dts/features/home-screen/checkHomeScreenStatus.d.ts +14 -0
- package/dist/dts/features/home-screen/exports.d.ts +2 -0
- package/dist/dts/features/links/exports.d.ts +3 -0
- package/dist/dts/features/links/openLink.d.ts +31 -0
- package/dist/dts/features/links/openTelegramLink.d.ts +18 -0
- package/dist/dts/features/links/shareURL.d.ts +18 -0
- package/dist/dts/features/privacy/exports.d.ts +3 -0
- package/dist/dts/features/privacy/requestContact.d.ts +59 -0
- package/dist/dts/features/privacy/requestPhoneAccess.d.ts +19 -0
- package/dist/dts/features/privacy/requestWriteAccess.d.ts +14 -0
- package/dist/dts/features/uncategorized/copyTextToClipboard.d.ts +5 -0
- package/dist/dts/features/uncategorized/downloadFile.d.ts +21 -0
- package/dist/dts/features/uncategorized/exports.d.ts +11 -0
- package/dist/dts/features/uncategorized/getCurrentTime.d.ts +15 -0
- package/dist/dts/features/uncategorized/hideKeyboard.d.ts +13 -0
- package/dist/dts/features/uncategorized/readTextFromClipboard.d.ts +13 -0
- package/dist/dts/features/uncategorized/retrieveAndroidDeviceData.d.ts +6 -0
- package/dist/dts/features/uncategorized/retrieveAndroidDeviceDataFrom.d.ts +14 -0
- package/dist/dts/features/uncategorized/sendData.d.ts +20 -0
- package/dist/dts/features/uncategorized/shareMessage.d.ts +14 -0
- package/dist/dts/features/uncategorized/shareStory.d.ts +50 -0
- package/dist/dts/features/uncategorized/switchInlineQuery.d.ts +28 -0
- package/dist/dts/fn-options/bottomButtonOptions.d.ts +11 -0
- package/dist/dts/fn-options/buttonOptions.d.ts +10 -0
- package/dist/dts/fn-options/createFnOption.d.ts +2 -0
- package/dist/dts/fn-options/sharedFeatureOptions.d.ts +8 -0
- package/dist/dts/fn-options/withInvokeCustomMethod.d.ts +11 -0
- package/dist/dts/fn-options/withPostEvent.d.ts +8 -0
- package/dist/dts/fn-options/withRequest.d.ts +8 -0
- package/dist/dts/fn-options/withStateRestore.d.ts +13 -0
- package/dist/dts/fn-options/withVersion.d.ts +9 -0
- package/dist/dts/globals/createRequestId.d.ts +4 -0
- package/dist/dts/globals/inline-mode.d.ts +4 -0
- package/dist/dts/globals/invokeCustomMethod.d.ts +16 -0
- package/dist/dts/globals/post-event.d.ts +4 -0
- package/dist/dts/globals/request.d.ts +3 -0
- package/dist/dts/globals/resetGlobals.d.ts +4 -0
- package/dist/dts/globals/signals-registry.d.ts +39 -0
- package/dist/dts/globals/themeParams.d.ts +4 -0
- package/dist/dts/globals/version.d.ts +4 -0
- package/dist/dts/helpers/access.d.ts +2 -0
- package/dist/dts/helpers/component-storage.d.ts +9 -0
- package/dist/dts/helpers/createIsSupportedSignal.d.ts +5 -0
- package/dist/dts/helpers/css-vars.d.ts +11 -0
- package/dist/dts/helpers/isColorDark.d.ts +11 -0
- package/dist/dts/{navigation/isPageReload.d.ts → helpers/navigation.d.ts} +1 -1
- package/dist/dts/helpers/removeUndefined.d.ts +10 -0
- package/dist/dts/helpers/shallowEqual.d.ts +1 -0
- package/dist/dts/index.d.ts +33 -168
- package/dist/dts/init.d.ts +42 -0
- package/dist/dts/types.d.ts +6 -0
- package/dist/dts/with-checks/throwifyWithChecksFp.d.ts +3 -0
- package/dist/dts/with-checks/withChecksFp.d.ts +172 -0
- package/dist/index.cjs +1 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.iife.js +3 -3
- package/dist/index.iife.js.map +1 -1
- package/dist/index.js +3811 -2897
- package/dist/index.js.map +1 -1
- package/package.json +15 -5
- package/dist/dts/bridge/captureSameReq.d.ts +0 -10
- package/dist/dts/bridge/events/event-emitter/createMiniAppsEventEmitter.d.ts +0 -15
- package/dist/dts/bridge/events/event-emitter/singleton.d.ts +0 -8
- package/dist/dts/bridge/events/event-handlers/cleanupEventHandlers.d.ts +0 -4
- package/dist/dts/bridge/events/event-handlers/defineEventHandlers.d.ts +0 -6
- package/dist/dts/bridge/events/event-handlers/emitMiniAppsEvent.d.ts +0 -9
- package/dist/dts/bridge/events/listening/off.d.ts +0 -8
- package/dist/dts/bridge/events/listening/on.d.ts +0 -12
- package/dist/dts/bridge/events/listening/subscribe.d.ts +0 -9
- package/dist/dts/bridge/events/listening/unsubscribe.d.ts +0 -7
- package/dist/dts/bridge/events/types.d.ts +0 -302
- package/dist/dts/bridge/invokeCustomMethod.d.ts +0 -23
- package/dist/dts/bridge/methods/createPostEvent.d.ts +0 -14
- package/dist/dts/bridge/methods/postEvent.d.ts +0 -40
- package/dist/dts/bridge/methods/types/custom-methods.d.ts +0 -57
- package/dist/dts/bridge/methods/types/haptic.d.ts +0 -40
- package/dist/dts/bridge/methods/types/index.d.ts +0 -4
- package/dist/dts/bridge/methods/types/methods.d.ts +0 -392
- package/dist/dts/bridge/methods/types/popup.d.ts +0 -49
- package/dist/dts/bridge/parseMessage.d.ts +0 -18
- package/dist/dts/bridge/request.d.ts +0 -53
- package/dist/dts/bridge/target-origin.d.ts +0 -18
- package/dist/dts/classes/State/State.d.ts +0 -46
- package/dist/dts/classes/State/types.d.ts +0 -29
- package/dist/dts/classes/WithStateUtils.d.ts +0 -18
- package/dist/dts/classes/WithSupports.d.ts +0 -19
- package/dist/dts/classes/WithSupportsAndStateUtils.d.ts +0 -24
- package/dist/dts/classes/WithSupportsAndTrackableState.d.ts +0 -16
- package/dist/dts/classes/WithTrackableState.d.ts +0 -16
- package/dist/dts/classnames/classNames.d.ts +0 -12
- package/dist/dts/classnames/mergeClassNames.d.ts +0 -14
- package/dist/dts/colors/isColorDark.d.ts +0 -6
- package/dist/dts/colors/isRGB.d.ts +0 -7
- package/dist/dts/colors/isRGBShort.d.ts +0 -7
- package/dist/dts/colors/toRGB.d.ts +0 -12
- package/dist/dts/colors/types.d.ts +0 -8
- package/dist/dts/components/BackButton/BackButton.d.ts +0 -41
- package/dist/dts/components/BackButton/initBackButton.d.ts +0 -7
- package/dist/dts/components/BackButton/types.d.ts +0 -25
- package/dist/dts/components/BiometryManager/BiometryManager.d.ts +0 -61
- package/dist/dts/components/BiometryManager/formatEvent.d.ts +0 -34
- package/dist/dts/components/BiometryManager/initBiometryManager.d.ts +0 -7
- package/dist/dts/components/BiometryManager/requestBiometryInfo.d.ts +0 -8
- package/dist/dts/components/BiometryManager/types.d.ts +0 -40
- package/dist/dts/components/ClosingBehavior/ClosingBehavior.d.ts +0 -26
- package/dist/dts/components/ClosingBehavior/initClosingBehavior.d.ts +0 -7
- package/dist/dts/components/ClosingBehavior/types.d.ts +0 -20
- package/dist/dts/components/CloudStorage/CloudStorage.d.ts +0 -47
- package/dist/dts/components/CloudStorage/initCloudStorage.d.ts +0 -7
- package/dist/dts/components/HapticFeedback/HapticFeedback.d.ts +0 -34
- package/dist/dts/components/HapticFeedback/initHapticFeedback.d.ts +0 -7
- package/dist/dts/components/InitData/InitData.d.ts +0 -55
- package/dist/dts/components/InitData/initInitData.d.ts +0 -7
- package/dist/dts/components/InitData/parseInitData.d.ts +0 -7
- package/dist/dts/components/InitData/parsers/chat.d.ts +0 -3
- package/dist/dts/components/InitData/parsers/initData.d.ts +0 -7
- package/dist/dts/components/InitData/parsers/user.d.ts +0 -3
- package/dist/dts/components/InitData/types.d.ts +0 -132
- package/dist/dts/components/Invoice/Invoice.d.ts +0 -31
- package/dist/dts/components/Invoice/initInvoice.d.ts +0 -7
- package/dist/dts/components/Invoice/types.d.ts +0 -20
- package/dist/dts/components/MainButton/MainButton.d.ts +0 -106
- package/dist/dts/components/MainButton/initMainButton.d.ts +0 -7
- package/dist/dts/components/MainButton/types.d.ts +0 -40
- package/dist/dts/components/MiniApp/MiniApp.d.ts +0 -121
- package/dist/dts/components/MiniApp/initMiniApp.d.ts +0 -7
- package/dist/dts/components/MiniApp/parsing/contact.d.ts +0 -7
- package/dist/dts/components/MiniApp/types.d.ts +0 -53
- package/dist/dts/components/Popup/Popup.d.ts +0 -30
- package/dist/dts/components/Popup/initPopup.d.ts +0 -7
- package/dist/dts/components/Popup/preparePopupParams.d.ts +0 -8
- package/dist/dts/components/QRScanner/QRScanner.d.ts +0 -33
- package/dist/dts/components/QRScanner/initQRScanner.d.ts +0 -7
- package/dist/dts/components/QRScanner/types.d.ts +0 -31
- package/dist/dts/components/SettingsButton/SettingsButton.d.ts +0 -37
- package/dist/dts/components/SettingsButton/initSettingsButton.d.ts +0 -7
- package/dist/dts/components/SettingsButton/types.d.ts +0 -25
- package/dist/dts/components/ThemeParams/ThemeParams.d.ts +0 -57
- package/dist/dts/components/ThemeParams/initThemeParams.d.ts +0 -7
- package/dist/dts/components/ThemeParams/keys.d.ts +0 -11
- package/dist/dts/components/ThemeParams/parsing/parseThemeParams.d.ts +0 -7
- package/dist/dts/components/ThemeParams/parsing/serializeThemeParams.d.ts +0 -6
- package/dist/dts/components/ThemeParams/parsing/themeParams.d.ts +0 -4
- package/dist/dts/components/ThemeParams/requestThemeParams.d.ts +0 -8
- package/dist/dts/components/ThemeParams/types.d.ts +0 -29
- package/dist/dts/components/Utils/Utils.d.ts +0 -77
- package/dist/dts/components/Utils/initUtils.d.ts +0 -7
- package/dist/dts/components/Viewport/Viewport.d.ts +0 -77
- package/dist/dts/components/Viewport/initViewport.d.ts +0 -7
- package/dist/dts/components/Viewport/requestViewport.d.ts +0 -13
- package/dist/dts/components/Viewport/types.d.ts +0 -35
- package/dist/dts/css-vars/bindMiniAppCSSVars.d.ts +0 -29
- package/dist/dts/css-vars/bindThemeParamsCSSVars.d.ts +0 -29
- package/dist/dts/css-vars/bindViewportCSSVars.d.ts +0 -32
- package/dist/dts/css-vars/setCSSVar.d.ts +0 -6
- package/dist/dts/debug/debug.d.ts +0 -14
- package/dist/dts/env/hasExternalNotify.d.ts +0 -10
- package/dist/dts/env/hasWebviewProxy.d.ts +0 -10
- package/dist/dts/env/initWeb.d.ts +0 -11
- package/dist/dts/env/isIframe.d.ts +0 -5
- package/dist/dts/env/isSSR.d.ts +0 -4
- package/dist/dts/env/isTMA.d.ts +0 -4
- package/dist/dts/env/mockTelegramEnv.d.ts +0 -7
- package/dist/dts/errors/SDKError.d.ts +0 -9
- package/dist/dts/errors/createError.d.ts +0 -10
- package/dist/dts/errors/errors.d.ts +0 -49
- package/dist/dts/errors/isSDKError.d.ts +0 -7
- package/dist/dts/errors/isSDKErrorOfType.d.ts +0 -8
- package/dist/dts/events/event-emitter/EventEmitter.d.ts +0 -54
- package/dist/dts/events/event-emitter/types.d.ts +0 -45
- package/dist/dts/events/onWindow.d.ts +0 -10
- package/dist/dts/events/types.d.ts +0 -6
- package/dist/dts/index.low-level.d.ts +0 -41
- package/dist/dts/launch-params/parseLaunchParams.d.ts +0 -7
- package/dist/dts/launch-params/retrieveFromLocation.d.ts +0 -7
- package/dist/dts/launch-params/retrieveFromPerformance.d.ts +0 -7
- package/dist/dts/launch-params/retrieveFromStorage.d.ts +0 -7
- package/dist/dts/launch-params/retrieveFromUrl.d.ts +0 -8
- package/dist/dts/launch-params/retrieveLaunchParams.d.ts +0 -7
- package/dist/dts/launch-params/saveToStorage.d.ts +0 -7
- package/dist/dts/launch-params/serializeLaunchParams.d.ts +0 -7
- package/dist/dts/launch-params/types.d.ts +0 -51
- package/dist/dts/logger/Logger.d.ts +0 -29
- package/dist/dts/misc/createCleanup.d.ts +0 -11
- package/dist/dts/misc/createComponentInitFn/createComponentInitFn.d.ts +0 -16
- package/dist/dts/misc/createComponentInitFn/types.d.ts +0 -54
- package/dist/dts/misc/createSingleton.d.ts +0 -15
- package/dist/dts/misc/isRecord.d.ts +0 -5
- package/dist/dts/misc/objectFromKeys.d.ts +0 -6
- package/dist/dts/navigation/BasicNavigator/BasicNavigator.d.ts +0 -118
- package/dist/dts/navigation/BasicNavigator/prepareItem.d.ts +0 -8
- package/dist/dts/navigation/BasicNavigator/types.d.ts +0 -37
- package/dist/dts/navigation/BrowserNavigator/BrowserNavigator.d.ts +0 -198
- package/dist/dts/navigation/BrowserNavigator/basicItemToBrowser.d.ts +0 -7
- package/dist/dts/navigation/BrowserNavigator/createBrowserNavigatorFromLocation.d.ts +0 -4
- package/dist/dts/navigation/BrowserNavigator/prepareItem.d.ts +0 -25
- package/dist/dts/navigation/BrowserNavigator/types.d.ts +0 -64
- package/dist/dts/navigation/createSafeURL.d.ts +0 -7
- package/dist/dts/navigation/drop.d.ts +0 -4
- package/dist/dts/navigation/ensurePrefix.d.ts +0 -7
- package/dist/dts/navigation/getFirstNavigationEntry.d.ts +0 -6
- package/dist/dts/navigation/getHash.d.ts +0 -15
- package/dist/dts/navigation/getPathname.d.ts +0 -7
- package/dist/dts/navigation/go.d.ts +0 -5
- package/dist/dts/navigation/initNavigator.d.ts +0 -9
- package/dist/dts/navigation/urlToPath.d.ts +0 -7
- package/dist/dts/parsing/ArrayParser/ArrayParser.d.ts +0 -17
- package/dist/dts/parsing/ArrayParser/types.d.ts +0 -12
- package/dist/dts/parsing/ValueParser/ValueParser.d.ts +0 -17
- package/dist/dts/parsing/ValueParser/types.d.ts +0 -28
- package/dist/dts/parsing/createTypeError.d.ts +0 -6
- package/dist/dts/parsing/createValueParserGenerator.d.ts +0 -10
- package/dist/dts/parsing/parseBySchema.d.ts +0 -9
- package/dist/dts/parsing/parsers/array.d.ts +0 -7
- package/dist/dts/parsing/parsers/boolean.d.ts +0 -6
- package/dist/dts/parsing/parsers/date.d.ts +0 -6
- package/dist/dts/parsing/parsers/json.d.ts +0 -9
- package/dist/dts/parsing/parsers/number.d.ts +0 -6
- package/dist/dts/parsing/parsers/rgb.d.ts +0 -7
- package/dist/dts/parsing/parsers/searchParams.d.ts +0 -9
- package/dist/dts/parsing/parsers/string.d.ts +0 -6
- package/dist/dts/parsing/toRecord.d.ts +0 -7
- package/dist/dts/parsing/types.d.ts +0 -30
- package/dist/dts/request-id/createRequestIdGenerator.d.ts +0 -6
- package/dist/dts/request-id/types.d.ts +0 -9
- package/dist/dts/storage/storage.d.ts +0 -42
- package/dist/dts/supports/createSupportsFn.d.ts +0 -12
- package/dist/dts/supports/createSupportsParamFn.d.ts +0 -16
- package/dist/dts/supports/supports.d.ts +0 -16
- package/dist/dts/supports/types.d.ts +0 -4
- package/dist/dts/timeout/createTimeoutError.d.ts +0 -7
- package/dist/dts/timeout/sleep.d.ts +0 -5
- package/dist/dts/timeout/withTimeout.d.ts +0 -6
- package/dist/dts/types/index.d.ts +0 -6
- package/dist/dts/types/logical.d.ts +0 -16
- package/dist/dts/types/methods.d.ts +0 -16
- package/dist/dts/types/misc.d.ts +0 -12
- package/dist/dts/types/platform.d.ts +0 -4
- package/dist/dts/types/unions.d.ts +0 -20
- package/dist/dts/types/utils.d.ts +0 -24
- package/dist/dts/version/compareVersions.d.ts +0 -10
- package/dist/dts/version/types.d.ts +0 -5
- package/dist/index.low-level.iife.js +0 -4
- package/dist/index.low-level.iife.js.map +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { WithSupportsAndStateUtils } from '../../classes/WithSupportsAndStateUtils.js';
|
|
2
|
-
import { PostEvent } from '../../bridge/methods/postEvent.js';
|
|
3
|
-
import { SettingsButtonEvents, SettingsButtonState } from './types.js';
|
|
4
|
-
import { EventEmitter } from '../../events/event-emitter/EventEmitter.js';
|
|
5
|
-
import { Version } from '../../version/types.js';
|
|
6
|
-
|
|
7
|
-
type Emitter = EventEmitter<SettingsButtonEvents>;
|
|
8
|
-
export declare class SettingsButton extends WithSupportsAndStateUtils<SettingsButtonState, 'show' | 'hide'> {
|
|
9
|
-
private readonly postEvent;
|
|
10
|
-
constructor(isVisible: boolean, version: Version, postEvent: PostEvent);
|
|
11
|
-
private set isVisible(value);
|
|
12
|
-
/**
|
|
13
|
-
* True if the SettingsButton is visible.
|
|
14
|
-
*/
|
|
15
|
-
get isVisible(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Hides the SettingsButton.
|
|
18
|
-
*/
|
|
19
|
-
hide(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Adds a new event listener.
|
|
22
|
-
* @param event - event to listen.
|
|
23
|
-
* @param listener - listener to add.
|
|
24
|
-
*/
|
|
25
|
-
on: Emitter['on'];
|
|
26
|
-
/**
|
|
27
|
-
* Removes the event listener.
|
|
28
|
-
* @param event - event to listen.
|
|
29
|
-
* @param listener - listener to remove.
|
|
30
|
-
*/
|
|
31
|
-
off: Emitter['off'];
|
|
32
|
-
/**
|
|
33
|
-
* Shows the SettingsButton.
|
|
34
|
-
*/
|
|
35
|
-
show(): void;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SettingsButton } from './SettingsButton.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @returns A new initialized instance of the `SettingsButton` class.
|
|
5
|
-
* @see SettingsButton
|
|
6
|
-
*/
|
|
7
|
-
export declare const initSettingsButton: import('../../index.js').InitDynamicComponentFn<SettingsButton>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { StateEvents } from '../../classes/State/types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* SettingsButton internal state.
|
|
5
|
-
*/
|
|
6
|
-
export interface SettingsButtonState {
|
|
7
|
-
isVisible: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* SettingsButton trackable events.
|
|
11
|
-
*/
|
|
12
|
-
export interface SettingsButtonEvents extends StateEvents<SettingsButtonState> {
|
|
13
|
-
/**
|
|
14
|
-
* The SettingsButton was clicked.
|
|
15
|
-
*/
|
|
16
|
-
click: () => void;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* SettingsButton event name.
|
|
20
|
-
*/
|
|
21
|
-
export type SettingsButtonEventName = keyof SettingsButtonEvents;
|
|
22
|
-
/**
|
|
23
|
-
* SettingsButton event listener.
|
|
24
|
-
*/
|
|
25
|
-
export type SettingsButtonEventListener<E extends SettingsButtonEventName> = SettingsButtonEvents[E];
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { WithTrackableState } from '../../classes/WithTrackableState.js';
|
|
2
|
-
import { RGB } from '../../colors/types.js';
|
|
3
|
-
import { RemoveEventListenerFn } from '../../events/types.js';
|
|
4
|
-
import { ThemeParamsParsed, ThemeParamsState } from './types.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @see Usage: https://docs.telegram-mini-apps.com/platform/theming
|
|
8
|
-
* @see API: https://docs.telegram-mini-apps.com/packages/tma-js-sdk/components/theme-params
|
|
9
|
-
*/
|
|
10
|
-
export declare class ThemeParams extends WithTrackableState<ThemeParamsState> {
|
|
11
|
-
/**
|
|
12
|
-
* @since v6.10
|
|
13
|
-
*/
|
|
14
|
-
get accentTextColor(): RGB | undefined;
|
|
15
|
-
get bgColor(): RGB | undefined;
|
|
16
|
-
get buttonColor(): RGB | undefined;
|
|
17
|
-
get buttonTextColor(): RGB | undefined;
|
|
18
|
-
get destructiveTextColor(): RGB | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Returns the copy of the internal state of the current component instance.
|
|
21
|
-
*/
|
|
22
|
-
getState(): ThemeParamsParsed;
|
|
23
|
-
/**
|
|
24
|
-
* @since v6.10
|
|
25
|
-
*/
|
|
26
|
-
get headerBgColor(): RGB | undefined;
|
|
27
|
-
get hintColor(): RGB | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* @returns True in case, current color scheme is recognized as dark. This
|
|
30
|
-
* value is calculated according to theme bg color.
|
|
31
|
-
*/
|
|
32
|
-
get isDark(): boolean;
|
|
33
|
-
get linkColor(): RGB | undefined;
|
|
34
|
-
get secondaryBgColor(): RGB | undefined;
|
|
35
|
-
/**
|
|
36
|
-
* @since v6.10
|
|
37
|
-
*/
|
|
38
|
-
get sectionBgColor(): RGB | undefined;
|
|
39
|
-
/**
|
|
40
|
-
* @since v6.10
|
|
41
|
-
*/
|
|
42
|
-
get sectionHeaderTextColor(): RGB | undefined;
|
|
43
|
-
/**
|
|
44
|
-
* @since v7.6
|
|
45
|
-
*/
|
|
46
|
-
get sectionSeparatorColor(): RGB | undefined;
|
|
47
|
-
/**
|
|
48
|
-
* Starts listening to the external theme changes and applies them.
|
|
49
|
-
* @returns Function to stop listening.
|
|
50
|
-
*/
|
|
51
|
-
listen(): RemoveEventListenerFn;
|
|
52
|
-
/**
|
|
53
|
-
* @since v6.10
|
|
54
|
-
*/
|
|
55
|
-
get subtitleTextColor(): RGB | undefined;
|
|
56
|
-
get textColor(): RGB | undefined;
|
|
57
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Converts a palette key from the Telegram application to the representation used by the package.
|
|
3
|
-
* @param key - palette key.
|
|
4
|
-
*/
|
|
5
|
-
export declare function keyToLocal(key: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* Converts palette key from the local representation to the representation sent from the
|
|
8
|
-
* Telegram application.
|
|
9
|
-
* @param key - palette key.
|
|
10
|
-
*/
|
|
11
|
-
export declare function keyToExternal(key: string): string;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExecuteWithOptions } from '../../types/index.js';
|
|
2
|
-
import { ThemeParamsParsed } from './types.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Requests current theme parameters from the Telegram application.
|
|
6
|
-
* @param options - request options.
|
|
7
|
-
*/
|
|
8
|
-
export declare function requestThemeParams(options?: ExecuteWithOptions): Promise<ThemeParamsParsed>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { StateEvents } from '../../classes/State/types.js';
|
|
2
|
-
import { RGB } from '../../colors/types.js';
|
|
3
|
-
|
|
4
|
-
export type ThemeParamsKey = 'accentTextColor' | 'bgColor' | 'buttonColor' | 'buttonTextColor' | 'destructiveTextColor' | 'headerBgColor' | 'hintColor' | 'linkColor' | 'secondaryBgColor' | 'sectionBgColor' | 'sectionHeaderTextColor' | 'sectionSeparatorColor' | 'subtitleTextColor' | 'textColor';
|
|
5
|
-
/**
|
|
6
|
-
* Application [theme parameters](https://docs.telegram-mini-apps.com/platform/theming).
|
|
7
|
-
* Defines palette used by the Telegram application.
|
|
8
|
-
*/
|
|
9
|
-
export interface ThemeParamsParsed {
|
|
10
|
-
[key: ThemeParamsKey | string]: RGB | undefined;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* ThemeParams internal state.
|
|
14
|
-
*/
|
|
15
|
-
export interface ThemeParamsState extends ThemeParamsParsed {
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* ThemeParams trackable events.
|
|
19
|
-
*/
|
|
20
|
-
export interface ThemeParamsEvents extends StateEvents<ThemeParamsState> {
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* ThemeParams event name.
|
|
24
|
-
*/
|
|
25
|
-
export type ThemeParamsEventName = keyof ThemeParamsEvents;
|
|
26
|
-
/**
|
|
27
|
-
* ThemeParams event listener.
|
|
28
|
-
*/
|
|
29
|
-
export type ThemeParamsEventListener<E extends ThemeParamsEventName> = ThemeParamsEvents[E];
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { WithSupports } from '../../classes/WithSupports.js';
|
|
2
|
-
import { PostEvent } from '../../bridge/methods/postEvent.js';
|
|
3
|
-
import { CreateRequestIdFn } from '../../request-id/types.js';
|
|
4
|
-
import { SupportsFn } from '../../supports/types.js';
|
|
5
|
-
import { Version } from '../../version/types.js';
|
|
6
|
-
|
|
7
|
-
export interface UtilsOpenLinkOptions {
|
|
8
|
-
/**
|
|
9
|
-
* Attempts to use the instant view mode.
|
|
10
|
-
*/
|
|
11
|
-
tryInstantView?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Attempts to use user preferred browser.
|
|
14
|
-
*/
|
|
15
|
-
tryBrowser?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* @see API: https://docs.telegram-mini-apps.com/packages/tma-js-sdk/components/utils
|
|
19
|
-
*/
|
|
20
|
-
export declare class Utils extends WithSupports<'readTextFromClipboard'> {
|
|
21
|
-
private readonly version;
|
|
22
|
-
private readonly createRequestId;
|
|
23
|
-
private readonly postEvent;
|
|
24
|
-
constructor(version: Version, createRequestId: CreateRequestIdFn, postEvent: PostEvent);
|
|
25
|
-
/**
|
|
26
|
-
* Opens a link.
|
|
27
|
-
*
|
|
28
|
-
* The Mini App will not be closed.
|
|
29
|
-
*
|
|
30
|
-
* Note that this method can be called only in response to the user
|
|
31
|
-
* interaction with the Mini App interface (e.g. click inside the Mini App or on the main button).
|
|
32
|
-
* @param url - URL to be opened.
|
|
33
|
-
* @param options - additional options.
|
|
34
|
-
*/
|
|
35
|
-
openLink(url: string, options?: UtilsOpenLinkOptions): void;
|
|
36
|
-
/**
|
|
37
|
-
* Opens a link.
|
|
38
|
-
*
|
|
39
|
-
* The Mini App will not be closed.
|
|
40
|
-
*
|
|
41
|
-
* Note that this method can be called only in response to the user
|
|
42
|
-
* interaction with the Mini App interface (e.g. click inside the Mini App or on the main button).
|
|
43
|
-
* @param url - URL to be opened.
|
|
44
|
-
* @param tryInstantView - try to use the instant view.
|
|
45
|
-
* @deprecated Use the second argument as an object.
|
|
46
|
-
*/
|
|
47
|
-
openLink(url: string, tryInstantView?: boolean): void;
|
|
48
|
-
/**
|
|
49
|
-
* Opens a Telegram link inside Telegram app. The Mini App will be closed. It expects passing
|
|
50
|
-
* link in full format, with hostname "t.me".
|
|
51
|
-
* @param url - URL to be opened.
|
|
52
|
-
* @throws {Error} URL has not allowed hostname.
|
|
53
|
-
*/
|
|
54
|
-
openTelegramLink(url: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Reads text from clipboard and returns string or null. null is returned
|
|
57
|
-
* in cases:
|
|
58
|
-
* - Value in clipboard is not text
|
|
59
|
-
* - Access to clipboard is not allowed
|
|
60
|
-
*/
|
|
61
|
-
readTextFromClipboard(): Promise<string | null>;
|
|
62
|
-
/**
|
|
63
|
-
* Shares specified URL with the passed to the chats, selected by user. After being called,
|
|
64
|
-
* it closes the mini application.
|
|
65
|
-
*
|
|
66
|
-
* This method uses Telegram's Share Links.
|
|
67
|
-
* @param url - URL to share.
|
|
68
|
-
* @param text - text to append after the URL.
|
|
69
|
-
* @see https://core.telegram.org/api/links#share-links
|
|
70
|
-
* @see https://core.telegram.org/widgets/share#custom-buttons
|
|
71
|
-
*/
|
|
72
|
-
shareURL(url: string, text?: string): void;
|
|
73
|
-
/**
|
|
74
|
-
* Checks if specified method parameter is supported by current component.
|
|
75
|
-
*/
|
|
76
|
-
supportsParam: SupportsFn<'openLink.tryInstantView'>;
|
|
77
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { WithTrackableState } from '../../classes/WithTrackableState.js';
|
|
2
|
-
import { RemoveEventListenerFn } from '../../events/types.js';
|
|
3
|
-
import { ExecuteWithOptions } from '../../types/index.js';
|
|
4
|
-
import { ViewportProps, ViewportState } from './types.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* @see Usage: https://docs.telegram-mini-apps.com/platform/viewport
|
|
8
|
-
* @see API: https://docs.telegram-mini-apps.com/packages/tma-js-sdk/components/viewport
|
|
9
|
-
*/
|
|
10
|
-
export declare class Viewport extends WithTrackableState<ViewportState> {
|
|
11
|
-
private readonly postEvent;
|
|
12
|
-
constructor({ postEvent, stableHeight, height, width, isExpanded }: ViewportProps);
|
|
13
|
-
/**
|
|
14
|
-
* Requests viewport information from the Telegram application and updates current Viewport
|
|
15
|
-
* instance.
|
|
16
|
-
* @param options - options to request fresh data.
|
|
17
|
-
*/
|
|
18
|
-
sync(options?: ExecuteWithOptions): Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* The current height of the **visible area** of the Mini App.
|
|
21
|
-
*
|
|
22
|
-
* The application can display just the top part of the Mini App, with its lower part remaining
|
|
23
|
-
* outside the screen area. From this position, the user can "pull" the Mini App to its
|
|
24
|
-
* maximum height, while the bot can do the same by calling `expand` method. As the position of
|
|
25
|
-
* the Mini App changes, the current height value of the visible area will be updated in real
|
|
26
|
-
* time.
|
|
27
|
-
*
|
|
28
|
-
* Please note that the refresh rate of this value is not sufficient to smoothly follow the
|
|
29
|
-
* lower border of the window. It should not be used to pin interface elements to the bottom
|
|
30
|
-
* of the visible area. It's more appropriate to use the value of the `stableHeight`
|
|
31
|
-
* field for this purpose.
|
|
32
|
-
*
|
|
33
|
-
* @see stableHeight
|
|
34
|
-
*/
|
|
35
|
-
get height(): number;
|
|
36
|
-
/**
|
|
37
|
-
* The height of the visible area of the Mini App in its last stable state.
|
|
38
|
-
*
|
|
39
|
-
* The application can display just the top part of the Mini App, with its lower part remaining
|
|
40
|
-
* outside the screen area. From this position, the user can "pull" the Mini App to its
|
|
41
|
-
* maximum height, while the application can do the same by calling `expand` method.
|
|
42
|
-
*
|
|
43
|
-
* Unlike the value of `height`, the value of `stableHeight` does not change as the position
|
|
44
|
-
* of the Mini App changes with user gestures or during animations. The value of `stableHeight`
|
|
45
|
-
* will be updated after all gestures and animations are completed and
|
|
46
|
-
* the Mini App reaches its final size.
|
|
47
|
-
*
|
|
48
|
-
* @see height
|
|
49
|
-
*/
|
|
50
|
-
get stableHeight(): number;
|
|
51
|
-
/**
|
|
52
|
-
* Starts listening to viewport changes and applies them.
|
|
53
|
-
* @returns Function to stop listening.
|
|
54
|
-
*/
|
|
55
|
-
listen(): RemoveEventListenerFn;
|
|
56
|
-
/**
|
|
57
|
-
* True if the Mini App is expanded to the maximum available height. Otherwise, if
|
|
58
|
-
* the Mini App occupies part of the screen and can be expanded to the full height using
|
|
59
|
-
* `expand` method.
|
|
60
|
-
* @see expand
|
|
61
|
-
*/
|
|
62
|
-
get isExpanded(): boolean;
|
|
63
|
-
/**
|
|
64
|
-
* Current visible area width.
|
|
65
|
-
*/
|
|
66
|
-
get width(): number;
|
|
67
|
-
/**
|
|
68
|
-
* A method that expands the Mini App to the maximum available height. To find out if the Mini
|
|
69
|
-
* App is expanded to the maximum height, refer to the value of the `isExpanded`.
|
|
70
|
-
* @see isExpanded
|
|
71
|
-
*/
|
|
72
|
-
expand(): void;
|
|
73
|
-
/**
|
|
74
|
-
* True if the current viewport height is stable and is not going to change in the next moment.
|
|
75
|
-
*/
|
|
76
|
-
get isStable(): boolean;
|
|
77
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ExecuteWithOptions } from '../../types/index.js';
|
|
2
|
-
|
|
3
|
-
export interface RequestViewportResult {
|
|
4
|
-
height: number;
|
|
5
|
-
isStateStable: boolean;
|
|
6
|
-
isExpanded: boolean;
|
|
7
|
-
width: number;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Requests viewport actual information from the Telegram application.
|
|
11
|
-
* @param options - request options.
|
|
12
|
-
*/
|
|
13
|
-
export declare function requestViewport(options?: ExecuteWithOptions): Promise<RequestViewportResult>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { PostEvent } from '../../bridge/methods/postEvent.js';
|
|
2
|
-
import { StateEvents } from '../../classes/State/types.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Viewport constructor properties.
|
|
6
|
-
*/
|
|
7
|
-
export interface ViewportProps {
|
|
8
|
-
height: number;
|
|
9
|
-
width: number;
|
|
10
|
-
stableHeight: number;
|
|
11
|
-
isExpanded: boolean;
|
|
12
|
-
postEvent: PostEvent;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Viewport internal state.
|
|
16
|
-
*/
|
|
17
|
-
export interface ViewportState {
|
|
18
|
-
height: number;
|
|
19
|
-
isExpanded: boolean;
|
|
20
|
-
stableHeight: number;
|
|
21
|
-
width: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Viewport trackable events.
|
|
25
|
-
*/
|
|
26
|
-
export interface ViewportEvents extends StateEvents<ViewportState> {
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Viewport event name.
|
|
30
|
-
*/
|
|
31
|
-
export type ViewportEventName = keyof ViewportEvents;
|
|
32
|
-
/**
|
|
33
|
-
* Viewport event listener.
|
|
34
|
-
*/
|
|
35
|
-
export type ViewportEventListener<E extends ViewportEventName> = ViewportEvents[E];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ThemeParams } from '../components/ThemeParams/ThemeParams.js';
|
|
2
|
-
import { MiniApp } from '../components/MiniApp/MiniApp.js';
|
|
3
|
-
import { CleanupFn } from '../types/index.js';
|
|
4
|
-
|
|
5
|
-
export interface GetMiniAppCSSVarNameFn {
|
|
6
|
-
/**
|
|
7
|
-
* @param property - MiniApp property.
|
|
8
|
-
* @returns Computed complete CSS variable name.
|
|
9
|
-
*/
|
|
10
|
-
(property: 'bg' | 'header'): string;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Creates CSS variables connected with the MiniApps class instance background and header colors
|
|
14
|
-
* based on the passed MiniApp and ThemeParams instances.
|
|
15
|
-
*
|
|
16
|
-
* Created variables by default:
|
|
17
|
-
* - `--tg-bg-color`
|
|
18
|
-
* - `--tg-header-color`
|
|
19
|
-
*
|
|
20
|
-
* Variables are being automatically updated in case, corresponding MiniApp and ThemeParams
|
|
21
|
-
* properties were updated.
|
|
22
|
-
*
|
|
23
|
-
* @param miniApp - MiniApp instance.
|
|
24
|
-
* @param themeParams - ThemeParams instance.
|
|
25
|
-
* @param getVarName - function, returning complete CSS variable name for the specified
|
|
26
|
-
* MiniApp property.
|
|
27
|
-
* @returns Function to stop updating variables.
|
|
28
|
-
*/
|
|
29
|
-
export declare function bindMiniAppCSSVars(miniApp: MiniApp, themeParams: ThemeParams, getVarName?: GetMiniAppCSSVarNameFn): CleanupFn;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ThemeParams } from '../components/ThemeParams/ThemeParams.js';
|
|
2
|
-
import { CleanupFn } from '../types/index.js';
|
|
3
|
-
|
|
4
|
-
export interface GetThemeParamsCSSVarNameFn {
|
|
5
|
-
/**
|
|
6
|
-
* @param property - ThemeParams property.
|
|
7
|
-
* @returns Computed complete CSS variable name.
|
|
8
|
-
*/
|
|
9
|
-
(property: string): string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Creates CSS variables connected with the passed instance of the ThemeParams class.
|
|
13
|
-
*
|
|
14
|
-
* By default, created CSS variables names are following the pattern "--tg-theme-{name}", where
|
|
15
|
-
* {name} is a theme parameters key name converted from camel case to kebab case.
|
|
16
|
-
*
|
|
17
|
-
* Example:
|
|
18
|
-
* --tg-theme-bg-color
|
|
19
|
-
* --tg-theme-secondary-text-color
|
|
20
|
-
*
|
|
21
|
-
* Variables are being automatically updated in case, corresponding properties updated in
|
|
22
|
-
* the passed ThemeParams instance.
|
|
23
|
-
*
|
|
24
|
-
* @param themeParams - ThemeParams instance.
|
|
25
|
-
* @param getCSSVarName - function, returning complete CSS variable name for the specified
|
|
26
|
-
* ThemeParams property.
|
|
27
|
-
* @returns Function to stop updating variables.
|
|
28
|
-
*/
|
|
29
|
-
export declare function bindThemeParamsCSSVars(themeParams: ThemeParams, getCSSVarName?: GetThemeParamsCSSVarNameFn): CleanupFn;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Viewport } from '../components/Viewport/Viewport.js';
|
|
2
|
-
import { CleanupFn } from '../types/index.js';
|
|
3
|
-
|
|
4
|
-
export interface GetViewportCSSVarNameFn {
|
|
5
|
-
/**
|
|
6
|
-
* @param property - Viewport property.
|
|
7
|
-
* @returns Computed complete CSS variable name.
|
|
8
|
-
*/
|
|
9
|
-
(property: 'width' | 'height' | 'stable-height'): string;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Accepts Viewport instance and sets CSS variables connected with viewport
|
|
13
|
-
* sizes.
|
|
14
|
-
*
|
|
15
|
-
* Be careful using this function as long as it can impact application
|
|
16
|
-
* performance. Viewport size is changing rather often, this makes CSS
|
|
17
|
-
* variables update, which leads to possible layout redraw.
|
|
18
|
-
*
|
|
19
|
-
* Variables:
|
|
20
|
-
* - `--tg-viewport-height`
|
|
21
|
-
* - `--tg-viewport-width`
|
|
22
|
-
* - `--tg-viewport-stable-height`
|
|
23
|
-
*
|
|
24
|
-
* Variables are being automatically updated in case, corresponding properties
|
|
25
|
-
* updated in passed Viewport instance.
|
|
26
|
-
*
|
|
27
|
-
* @param viewport - Viewport instance.
|
|
28
|
-
* @param getCSSVarName - function, returning complete CSS variable name for the specified
|
|
29
|
-
* Viewport property.
|
|
30
|
-
* @returns Function to stop updating variables.
|
|
31
|
-
*/
|
|
32
|
-
export declare function bindViewportCSSVars(viewport: Viewport, getCSSVarName?: GetViewportCSSVarNameFn): CleanupFn;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Logger } from '../logger/Logger.js';
|
|
2
|
-
|
|
3
|
-
export declare const logger: Logger;
|
|
4
|
-
/**
|
|
5
|
-
* Sets new debug mode. Enabling debug mode leads to printing additional messages in the console,
|
|
6
|
-
* related to the processes inside the package.
|
|
7
|
-
* @param enable - should debug be enabled.
|
|
8
|
-
*/
|
|
9
|
-
export declare function setDebug(enable: boolean): void;
|
|
10
|
-
/**
|
|
11
|
-
* Logs info message into the console.
|
|
12
|
-
* @param args - additional arguments.
|
|
13
|
-
*/
|
|
14
|
-
export declare function log(...args: any[]): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns true in case, passed value contains path `external.notify` property and `notify` is a
|
|
3
|
-
* function.
|
|
4
|
-
* @param value - value to check.
|
|
5
|
-
*/
|
|
6
|
-
export declare function hasExternalNotify<T extends object>(value: T): value is (T & {
|
|
7
|
-
external: {
|
|
8
|
-
notify: (...args: any) => any;
|
|
9
|
-
};
|
|
10
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Returns true in case, passed value contains path `TelegramWebviewProxy.postEvent` property and
|
|
3
|
-
* `postEvent` is a function.
|
|
4
|
-
* @param value - value to check.
|
|
5
|
-
*/
|
|
6
|
-
export declare function hasWebviewProxy<T extends {}>(value: T): value is (T & {
|
|
7
|
-
TelegramWebviewProxy: {
|
|
8
|
-
postEvent: (...args: unknown[]) => unknown;
|
|
9
|
-
};
|
|
10
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
interface CleanupFn {
|
|
2
|
-
(): void;
|
|
3
|
-
}
|
|
4
|
-
/**
|
|
5
|
-
* Performs initialization process in the web version of Telegram.
|
|
6
|
-
* @returns Function, which performs cleanup removing all created elements and listeners.
|
|
7
|
-
* @param acceptCustomStyles - true if SDK should accept styles sent from the Telegram web
|
|
8
|
-
* application. This option is only used in web versions of Telegram. Default: false.
|
|
9
|
-
*/
|
|
10
|
-
export declare function initWeb(acceptCustomStyles?: boolean): CleanupFn;
|
|
11
|
-
export {};
|
package/dist/dts/env/isSSR.d.ts
DELETED
package/dist/dts/env/isTMA.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LaunchParams } from '../launch-params/types.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Mocks a Telegram application environment.
|
|
5
|
-
* @param launchParamsRaw - launch parameters presented as a string or query parameters.
|
|
6
|
-
*/
|
|
7
|
-
export declare function mockTelegramEnv(launchParamsRaw: LaunchParams | string): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { SDKError } from './SDKError.js';
|
|
2
|
-
import { ErrorType } from './errors.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Creates new error using specified type and message.
|
|
6
|
-
* @param type - error code.
|
|
7
|
-
* @param message - error message.
|
|
8
|
-
* @param cause - original error.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createError(type: ErrorType, message: string, cause?: unknown): SDKError;
|