@vbotma/sdk 3.2.4 → 3.2.6
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/dist/dts/composables/Button.d.ts +1 -1
- package/dist/dts/features/Biometry/Biometry.d.ts +1 -1
- package/dist/dts/features/ClosingBehavior/ClosingBehavior.d.ts +1 -1
- package/dist/dts/features/CloudStorage/CloudStorage.d.ts +1 -1
- package/dist/dts/features/DeviceStorage/DeviceStorage.d.ts +1 -1
- package/dist/dts/features/HapticFeedback/HapticFeedback.d.ts +1 -1
- package/dist/dts/features/Invoice/Invoice.d.ts +1 -1
- package/dist/dts/features/LocationManager/LocationManager.d.ts +1 -1
- package/dist/dts/features/MiniApp/MiniApp.d.ts +1 -1
- package/dist/dts/features/Notification/Notification.d.ts +8 -1
- package/dist/dts/features/Popup/Popup.d.ts +1 -1
- package/dist/dts/features/QrScanner/QrScanner.d.ts +1 -1
- package/dist/dts/features/SecureStorage/SecureStorage.d.ts +1 -1
- package/dist/dts/features/SwipeBehavior/SwipeBehavior.d.ts +1 -1
- package/dist/dts/features/ThemeParams/ThemeParams.d.ts +1 -1
- package/dist/dts/features/Viewport/Viewport.d.ts +1 -1
- package/dist/dts/fn-options/bottomButtonOptions.d.ts +1 -1
- package/dist/dts/fn-options/buttonOptions.d.ts +1 -1
- package/dist/dts/fn-options/sharedFeatureOptions.d.ts +1 -1
- package/dist/dts/host-features/BackButton/HostBackButton.d.ts +12 -0
- package/dist/dts/host-features/Biometry/HostBiometry.d.ts +36 -0
- package/dist/dts/host-features/Chat/HostChat.d.ts +12 -0
- package/dist/dts/host-features/Clipboard/HostClipboard.d.ts +12 -0
- package/dist/dts/host-features/ClosingBehavior/HostClosingBehavior.d.ts +8 -0
- package/dist/dts/host-features/CustomMethod/HostCustomMethod.d.ts +12 -0
- package/dist/dts/host-features/EmojiStatus/HostEmojiStatus.d.ts +24 -0
- package/dist/dts/host-features/Files/HostFiles.d.ts +12 -0
- package/dist/dts/host-features/HapticFeedback/HostHapticFeedback.d.ts +8 -0
- package/dist/dts/host-features/HomeScreen/HostHomeScreen.d.ts +24 -0
- package/dist/dts/host-features/Invoice/HostInvoice.d.ts +12 -0
- package/dist/dts/host-features/Link/HostLink.d.ts +12 -0
- package/dist/dts/host-features/LocationManager/HostLocationManager.d.ts +24 -0
- package/dist/dts/host-features/MainButton/HostMainButton.d.ts +13 -0
- package/dist/dts/host-features/MiniApp/HostMiniApp.d.ts +53 -0
- package/dist/dts/host-features/Notification/HostNotification.d.ts +2 -1
- package/dist/dts/host-features/Popup/HostPopup.d.ts +14 -0
- package/dist/dts/host-features/Privacy/HostPrivacy.d.ts +20 -0
- package/dist/dts/host-features/QrScanner/HostQrScanner.d.ts +20 -0
- package/dist/dts/host-features/SecondaryButton/HostSecondaryButton.d.ts +13 -0
- package/dist/dts/host-features/SettingsButton/HostSettingsButton.d.ts +13 -0
- package/dist/dts/host-features/Sharing/HostSharing.d.ts +20 -0
- package/dist/dts/host-features/SwipeBehavior/HostSwipeBehavior.d.ts +8 -0
- package/dist/dts/host-features/ThemeParams/HostThemeParams.d.ts +4 -12
- package/dist/dts/host-features/Viewport/HostViewport.d.ts +52 -0
- package/dist/dts/host-features/index.d.ts +23 -0
- package/dist/dts/index.d.ts +1 -1
- package/dist/dts/with-checks/withChecksFp.d.ts +1 -1
- package/dist/index.cjs +1 -1
- 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 +2367 -1645
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -39,7 +39,7 @@ export interface ButtonOptions<S, M extends MethodName> extends SharedFeatureOpt
|
|
|
39
39
|
payload: (state: S) => MethodParams<M>;
|
|
40
40
|
}
|
|
41
41
|
export declare class Button<S extends object, M extends MethodName> {
|
|
42
|
-
constructor({
|
|
42
|
+
constructor({ isVBma, storage, onClick, offClick, initialState, isPageReload, postEvent, payload, method, version, }: ButtonOptions<S, M>);
|
|
43
43
|
/**
|
|
44
44
|
* Signal indicating if the component is currently mounted.
|
|
45
45
|
*/
|
|
@@ -20,7 +20,7 @@ interface AuthenticateResult {
|
|
|
20
20
|
* @since Mini Apps v7.2
|
|
21
21
|
*/
|
|
22
22
|
export declare class Biometry {
|
|
23
|
-
constructor({ version, request, postEvent, storage, onInfoReceived, offInfoReceived,
|
|
23
|
+
constructor({ version, request, postEvent, storage, onInfoReceived, offInfoReceived, isVBma, isPageReload, }: BiometryOptions);
|
|
24
24
|
/**
|
|
25
25
|
* Signal indicating if biometry is available.
|
|
26
26
|
*/
|
|
@@ -11,7 +11,7 @@ export interface ClosingBehaviorState {
|
|
|
11
11
|
export interface ClosingBehaviorOptions extends WithStateRestore<ClosingBehaviorState>, WithPostEvent, SharedFeatureOptions {
|
|
12
12
|
}
|
|
13
13
|
export declare class ClosingBehavior {
|
|
14
|
-
constructor({ postEvent, storage,
|
|
14
|
+
constructor({ postEvent, storage, isVBma, isPageReload }: ClosingBehaviorOptions);
|
|
15
15
|
/**
|
|
16
16
|
* Signal indicating if closing confirmation dialog is currently enabled.
|
|
17
17
|
*/
|
|
@@ -13,7 +13,7 @@ export interface CloudStorageOptions extends WithVersion, WithInvokeCustomMethod
|
|
|
13
13
|
* @since Mini Apps v6.9
|
|
14
14
|
*/
|
|
15
15
|
export declare class CloudStorage {
|
|
16
|
-
constructor({ version,
|
|
16
|
+
constructor({ version, isVBma, invokeCustomMethod }: CloudStorageOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Signal indicating if the component is supported.
|
|
19
19
|
*/
|
|
@@ -13,7 +13,7 @@ export interface DeviceStorageOptions extends SharedFeatureOptions, WithVersion,
|
|
|
13
13
|
* @since Mini Apps v9.0
|
|
14
14
|
*/
|
|
15
15
|
export declare class DeviceStorage {
|
|
16
|
-
constructor({
|
|
16
|
+
constructor({ isVBma, request, version, createRequestId }: DeviceStorageOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Retrieves an item using its key.
|
|
19
19
|
* @since Mini Apps v9.0
|
|
@@ -12,7 +12,7 @@ export interface HapticFeedbackOptions extends WithVersion, WithPostEvent, Share
|
|
|
12
12
|
* @since Mini Apps v6.1
|
|
13
13
|
*/
|
|
14
14
|
export declare class HapticFeedback {
|
|
15
|
-
constructor({ postEvent,
|
|
15
|
+
constructor({ postEvent, isVBma, version }: HapticFeedbackOptions);
|
|
16
16
|
/**
|
|
17
17
|
* Signal indicating if the component is supported.
|
|
18
18
|
*/
|
|
@@ -15,7 +15,7 @@ export interface InvoiceOptions extends WithVersion, WithRequest, SharedFeatureO
|
|
|
15
15
|
* @since Mini Apps v6.1
|
|
16
16
|
*/
|
|
17
17
|
export declare class Invoice {
|
|
18
|
-
constructor({ version, request,
|
|
18
|
+
constructor({ version, request, isVBma }: InvoiceOptions);
|
|
19
19
|
/**
|
|
20
20
|
* Signal indicating if any invoice is currently opened.
|
|
21
21
|
*/
|
|
@@ -9,7 +9,7 @@ import { WithChecks, WithChecksFp } from '../../with-checks/withChecksFp.js';
|
|
|
9
9
|
* @since Mini Apps v8.0
|
|
10
10
|
*/
|
|
11
11
|
export declare class LocationManager {
|
|
12
|
-
constructor({ version, request, postEvent, storage,
|
|
12
|
+
constructor({ version, request, postEvent, storage, isVBma, isPageReload, }: LocationManagerOptions);
|
|
13
13
|
/**
|
|
14
14
|
* Complete location manager state.
|
|
15
15
|
*/
|
|
@@ -35,7 +35,7 @@ export interface MiniAppOptions extends WithPostEvent, WithVersion, WithStateRes
|
|
|
35
35
|
* @since Mini Apps v6.1
|
|
36
36
|
*/
|
|
37
37
|
export declare class MiniApp {
|
|
38
|
-
constructor({ storage, isPageReload, version, postEvent,
|
|
38
|
+
constructor({ storage, isPageReload, version, postEvent, isVBma, theme, onVisibilityChanged, offVisibilityChanged, }: MiniAppOptions);
|
|
39
39
|
/**
|
|
40
40
|
* Signal indicating if the component is supported.
|
|
41
41
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UnknownEnvError } from '@vbotma/bridge';
|
|
2
|
+
import { Computed } from '@vbotma/signals';
|
|
2
3
|
import { BetterPromise } from 'better-promises';
|
|
3
4
|
import { taskEither as TE } from 'fp-ts';
|
|
4
5
|
import { NotificationOptions, SendNotificationOptions } from './types.js';
|
|
@@ -7,7 +8,13 @@ import { NotificationOptions, SendNotificationOptions } from './types.js';
|
|
|
7
8
|
* @since v9.2
|
|
8
9
|
*/
|
|
9
10
|
export declare class Notification {
|
|
10
|
-
constructor({}: NotificationOptions
|
|
11
|
+
constructor({ version, isVBma }: NotificationOptions & {
|
|
12
|
+
version?: string;
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Signal indicating if the component is supported.
|
|
16
|
+
*/
|
|
17
|
+
readonly isSupported: Computed<boolean>;
|
|
11
18
|
/**
|
|
12
19
|
* Sends a notification to the native app.
|
|
13
20
|
* @param options - notification options including message, optional title, and optional type (defaults to 'default')
|
|
@@ -14,7 +14,7 @@ export interface PopupOptions extends SharedFeatureOptions, WithVersion, WithReq
|
|
|
14
14
|
* @since Mini Apps v6.2
|
|
15
15
|
*/
|
|
16
16
|
export declare class Popup {
|
|
17
|
-
constructor({ version,
|
|
17
|
+
constructor({ version, isVBma, request }: PopupOptions);
|
|
18
18
|
/**
|
|
19
19
|
* Signal indicating if any popup is currently opened.
|
|
20
20
|
*/
|
|
@@ -47,7 +47,7 @@ interface OpenOptions extends SharedOptions {
|
|
|
47
47
|
* @since Mini Apps v6.4
|
|
48
48
|
*/
|
|
49
49
|
export declare class QrScanner {
|
|
50
|
-
constructor({ version, onClosed, onTextReceived,
|
|
50
|
+
constructor({ version, onClosed, onTextReceived, isVBma, postEvent, }: QrScannerOptions);
|
|
51
51
|
/**
|
|
52
52
|
* Signal indicating if the scanner is currently opened.
|
|
53
53
|
*/
|
|
@@ -13,7 +13,7 @@ export interface SecureStorageOptions extends SharedFeatureOptions, WithVersion,
|
|
|
13
13
|
* @since Mini Apps v9.0
|
|
14
14
|
*/
|
|
15
15
|
export declare class SecureStorage {
|
|
16
|
-
constructor({
|
|
16
|
+
constructor({ isVBma, request, version, createRequestId }: SecureStorageOptions);
|
|
17
17
|
/**
|
|
18
18
|
* Retrieves an item using its key.
|
|
19
19
|
* @since Mini Apps v9.0
|
|
@@ -15,7 +15,7 @@ export interface SwipeBehaviorOptions extends WithStateRestore<SwipeBehaviorStat
|
|
|
15
15
|
* @since Mini Apps v7.7
|
|
16
16
|
*/
|
|
17
17
|
export declare class SwipeBehavior {
|
|
18
|
-
constructor({ postEvent, storage,
|
|
18
|
+
constructor({ postEvent, storage, isVBma, isPageReload, version }: SwipeBehaviorOptions);
|
|
19
19
|
/**
|
|
20
20
|
* Signal indicating if the component is supported.
|
|
21
21
|
*/
|
|
@@ -33,7 +33,7 @@ export interface ThemeParamsGetCssVarNameFn {
|
|
|
33
33
|
(property: Extract<keyof ThemeParamsType, string>): string;
|
|
34
34
|
}
|
|
35
35
|
export declare class ThemeParams {
|
|
36
|
-
constructor({ initialState, onChange, offChange,
|
|
36
|
+
constructor({ initialState, onChange, offChange, isVBma, storage, isPageReload, }: ThemeParamsOptions);
|
|
37
37
|
/**
|
|
38
38
|
* @since v6.10
|
|
39
39
|
*/
|
|
@@ -40,7 +40,7 @@ export interface ViewportOptions<EViewportStable, EFullscreen> extends WithState
|
|
|
40
40
|
isFullscreen: boolean | (() => E.Either<EFullscreen, boolean>);
|
|
41
41
|
}
|
|
42
42
|
export declare class Viewport<EViewportStable, EFullscreen> {
|
|
43
|
-
constructor({ storage, isPageReload, onContentSafeAreaInsetsChanged, onSafeAreaInsetsChanged, onViewportChanged, onFullscreenChanged, offContentSafeAreaInsetsChanged, offFullscreenChanged, offSafeAreaInsetsChanged, offViewportChanged, request, isViewportStable, isFullscreen,
|
|
43
|
+
constructor({ storage, isPageReload, onContentSafeAreaInsetsChanged, onSafeAreaInsetsChanged, onViewportChanged, onFullscreenChanged, offContentSafeAreaInsetsChanged, offFullscreenChanged, offSafeAreaInsetsChanged, offViewportChanged, request, isViewportStable, isFullscreen, isVBma, version, postEvent, }: ViewportOptions<EViewportStable, EFullscreen>);
|
|
44
44
|
/**
|
|
45
45
|
* Complete component state.
|
|
46
46
|
*/
|
|
@@ -3,7 +3,7 @@ export declare function bottomButtonOptions<S, D>(storageName: string, trackedCl
|
|
|
3
3
|
defaults: D;
|
|
4
4
|
onClick(listener: VoidFunction, once?: boolean): VoidFunction;
|
|
5
5
|
offClick(listener: VoidFunction, once?: boolean): void;
|
|
6
|
-
|
|
6
|
+
isVBma: import('../types.js').MaybeAccessor<boolean>;
|
|
7
7
|
postEvent: import('@vbotma/bridge').PostEventFpFn;
|
|
8
8
|
version: import('../types.js').MaybeAccessor<import('@vbotma/types').Version>;
|
|
9
9
|
storage: import('../helpers/component-storage.js').ComponentStorage<S>;
|
|
@@ -2,7 +2,7 @@ import { EventName } from '@vbotma/bridge';
|
|
|
2
2
|
export declare function buttonOptions<S>(storageName: string, trackedClickEvent: EventName): {
|
|
3
3
|
onClick(listener: VoidFunction, once?: boolean): VoidFunction;
|
|
4
4
|
offClick(listener: VoidFunction, once?: boolean): void;
|
|
5
|
-
|
|
5
|
+
isVBma: import('../types.js').MaybeAccessor<boolean>;
|
|
6
6
|
postEvent: import('@vbotma/bridge').PostEventFpFn;
|
|
7
7
|
version: import('../types.js').MaybeAccessor<import('@vbotma/types').Version>;
|
|
8
8
|
storage: import('../helpers/component-storage.js').ComponentStorage<S>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class HostBackButton {
|
|
2
|
+
/**
|
|
3
|
+
* Listens to 'web_app_setup_back_button' methods calls from Mini App.
|
|
4
|
+
*/
|
|
5
|
+
onSetup(listener: (isVisible: boolean) => void): VoidFunction;
|
|
6
|
+
/**
|
|
7
|
+
* Simulates the user pressing the back button.
|
|
8
|
+
* Sends 'back_button_pressed' event to the Mini App.
|
|
9
|
+
*/
|
|
10
|
+
press(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostBackButton: HostBackButton;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostBiometry {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_biometry_get_info' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onGetInfo(listener: () => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_biometry_open_settings' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onOpenSettings(listener: () => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Listens to 'web_app_biometry_request_access' methods calls from Mini App.
|
|
13
|
+
*/
|
|
14
|
+
onRequestAccess(listener: (params: MethodParams<'web_app_biometry_request_access'>) => void): VoidFunction;
|
|
15
|
+
/**
|
|
16
|
+
* Listens to 'web_app_biometry_request_auth' methods calls from Mini App.
|
|
17
|
+
*/
|
|
18
|
+
onRequestAuth(listener: (params: MethodParams<'web_app_biometry_request_auth'>) => void): VoidFunction;
|
|
19
|
+
/**
|
|
20
|
+
* Listens to 'web_app_biometry_update_token' methods calls from Mini App.
|
|
21
|
+
*/
|
|
22
|
+
onUpdateToken(listener: (params: MethodParams<'web_app_biometry_update_token'>) => void): VoidFunction;
|
|
23
|
+
/**
|
|
24
|
+
* Sends the 'biometry_info_received' event to the Mini App.
|
|
25
|
+
*/
|
|
26
|
+
setInfoReceived(params: EventPayload<'biometry_info_received'>): void;
|
|
27
|
+
/**
|
|
28
|
+
* Sends the 'biometry_auth_requested' event to the Mini App.
|
|
29
|
+
*/
|
|
30
|
+
setAuthRequested(params: EventPayload<'biometry_auth_requested'>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Sends the 'biometry_token_updated' event to the Mini App.
|
|
33
|
+
*/
|
|
34
|
+
setTokenUpdated(params: EventPayload<'biometry_token_updated'>): void;
|
|
35
|
+
}
|
|
36
|
+
export declare const hostBiometry: HostBiometry;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostChat {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_data_send' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onDataSend(listener: (params: MethodParams<'web_app_data_send'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_switch_inline_query' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onSwitchInlineQuery(listener: (params: MethodParams<'web_app_switch_inline_query'>) => void): VoidFunction;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostChat: HostChat;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostClipboard {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_read_text_from_clipboard' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onReadText(listener: (params: MethodParams<'web_app_read_text_from_clipboard'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Sends the 'clipboard_text_received' event to the Mini App.
|
|
9
|
+
*/
|
|
10
|
+
sendTextReceived(params: EventPayload<'clipboard_text_received'>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostClipboard: HostClipboard;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostClosingBehavior {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_setup_closing_behavior' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onSetupClosingBehavior(listener: (params: MethodParams<'web_app_setup_closing_behavior'>) => void): VoidFunction;
|
|
7
|
+
}
|
|
8
|
+
export declare const hostClosingBehavior: HostClosingBehavior;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostCustomMethod {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_invoke_custom_method' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onInvokeCustomMethod(listener: (params: MethodParams<'web_app_invoke_custom_method'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Sends the 'custom_method_invoked' event to the Mini App.
|
|
9
|
+
*/
|
|
10
|
+
setCustomMethodInvoked(params: EventPayload<'custom_method_invoked'>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostCustomMethod: HostCustomMethod;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostEmojiStatus {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_request_emoji_status_access' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onRequestAccess(listener: () => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_set_emoji_status' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onSetEmojiStatus(listener: (params: MethodParams<'web_app_set_emoji_status'>) => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Sends the 'emoji_status_access_requested' event to the Mini App.
|
|
13
|
+
*/
|
|
14
|
+
setAccessRequested(params: EventPayload<'emoji_status_access_requested'>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the 'emoji_status_set' event to the Mini App.
|
|
17
|
+
*/
|
|
18
|
+
setEmojiStatusSet(params: EventPayload<'emoji_status_set'>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sends the 'emoji_status_failed' event to the Mini App.
|
|
21
|
+
*/
|
|
22
|
+
setEmojiStatusFailed(params: EventPayload<'emoji_status_failed'>): void;
|
|
23
|
+
}
|
|
24
|
+
export declare const hostEmojiStatus: HostEmojiStatus;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostFiles {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_request_file_download' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onRequestFileDownload(listener: (params: MethodParams<'web_app_request_file_download'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Sends the 'file_download_requested' event to the Mini App.
|
|
9
|
+
*/
|
|
10
|
+
setFileDownloadRequested(params: EventPayload<'file_download_requested'>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostFiles: HostFiles;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostHapticFeedback {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_trigger_haptic_feedback' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onHapticFeedback(listener: (params: MethodParams<'web_app_trigger_haptic_feedback'>) => void): VoidFunction;
|
|
7
|
+
}
|
|
8
|
+
export declare const hostHapticFeedback: HostHapticFeedback;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostHomeScreen {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_add_to_home_screen' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onAddToHomeScreen(listener: () => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_check_home_screen' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onCheckHomeScreen(listener: () => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Sends the 'home_screen_checked' event to the Mini App.
|
|
13
|
+
*/
|
|
14
|
+
setHomeScreenChecked(params: EventPayload<'home_screen_checked'>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the 'home_screen_added' event to the Mini App.
|
|
17
|
+
*/
|
|
18
|
+
setHomeScreenAdded(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sends the 'home_screen_failed' event to the Mini App.
|
|
21
|
+
*/
|
|
22
|
+
setHomeScreenFailed(params: EventPayload<'home_screen_failed'>): void;
|
|
23
|
+
}
|
|
24
|
+
export declare const hostHomeScreen: HostHomeScreen;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostInvoice {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_open_invoice' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onOpenInvoice(listener: (params: MethodParams<'web_app_open_invoice'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Sends the 'invoice_closed' event to the Mini App.
|
|
9
|
+
*/
|
|
10
|
+
setInvoiceClosed(params: EventPayload<'invoice_closed'>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostInvoice: HostInvoice;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostLink {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_open_link' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onOpenLink(listener: (params: MethodParams<'web_app_open_link'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_open_tg_link' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onOpenTgLink(listener: (params: MethodParams<'web_app_open_tg_link'>) => void): VoidFunction;
|
|
11
|
+
}
|
|
12
|
+
export declare const hostLink: HostLink;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostLocationManager {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_check_location' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onCheckLocation(listener: () => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_open_location_settings' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onOpenLocationSettings(listener: () => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Listens to 'web_app_request_location' methods calls from Mini App.
|
|
13
|
+
*/
|
|
14
|
+
onRequestLocation(listener: () => void): VoidFunction;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the 'location_checked' event to the Mini App.
|
|
17
|
+
*/
|
|
18
|
+
setLocationChecked(params: EventPayload<'location_checked'>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Sends the 'location_requested' event to the Mini App.
|
|
21
|
+
*/
|
|
22
|
+
setLocationRequested(params: EventPayload<'location_requested'>): void;
|
|
23
|
+
}
|
|
24
|
+
export declare const hostLocationManager: HostLocationManager;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostMainButton {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_setup_main_button' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onSetup(listener: (params: MethodParams<'web_app_setup_main_button'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Simulates the user pressing the main button.
|
|
9
|
+
* Sends 'main_button_pressed' event to the Mini App.
|
|
10
|
+
*/
|
|
11
|
+
press(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const hostMainButton: HostMainButton;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { RGB } from '@vbotma/types';
|
|
2
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
3
|
+
export declare class HostMiniApp {
|
|
4
|
+
/**
|
|
5
|
+
* Listens to 'iframe_ready' methods calls from Mini App.
|
|
6
|
+
*/
|
|
7
|
+
onIframeReady(listener: (params: MethodParams<'iframe_ready'>) => void): VoidFunction;
|
|
8
|
+
/**
|
|
9
|
+
* Listens to 'iframe_will_reload' methods calls from Mini App.
|
|
10
|
+
*/
|
|
11
|
+
onIframeWillReload(listener: () => void): VoidFunction;
|
|
12
|
+
/**
|
|
13
|
+
* Listens to 'web_app_close' methods calls from Mini App.
|
|
14
|
+
*/
|
|
15
|
+
onClose(listener: () => void): VoidFunction;
|
|
16
|
+
/**
|
|
17
|
+
* Listens to 'web_app_hide_keyboard' methods calls from Mini App.
|
|
18
|
+
*/
|
|
19
|
+
onHideKeyboard(listener: () => void): VoidFunction;
|
|
20
|
+
/**
|
|
21
|
+
* Listens to 'web_app_ready' methods calls from Mini App.
|
|
22
|
+
*/
|
|
23
|
+
onReady(listener: () => void): VoidFunction;
|
|
24
|
+
/**
|
|
25
|
+
* Listens to 'web_app_request_theme' methods calls from Mini App.
|
|
26
|
+
*/
|
|
27
|
+
onRequestTheme(listener: () => void): VoidFunction;
|
|
28
|
+
/**
|
|
29
|
+
* Listens to 'web_app_set_background_color' method call from Mini App.
|
|
30
|
+
*/
|
|
31
|
+
onBackgroundColorChange(listener: (color: RGB) => void): VoidFunction;
|
|
32
|
+
/**
|
|
33
|
+
* Listens to 'web_app_set_bottom_bar_color' method call from Mini App.
|
|
34
|
+
*/
|
|
35
|
+
onBottomBarColorChange(listener: (color: RGB) => void): VoidFunction;
|
|
36
|
+
/**
|
|
37
|
+
* Listens to 'web_app_set_header_color' method call from Mini App.
|
|
38
|
+
*/
|
|
39
|
+
onHeaderColorChange(listener: (colorKeyOrColor: string) => void): VoidFunction;
|
|
40
|
+
/**
|
|
41
|
+
* Sends the 'reload_iframe' event to the Mini App.
|
|
42
|
+
*/
|
|
43
|
+
reloadIframe(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Sends the 'set_custom_style' event to the Mini App.
|
|
46
|
+
*/
|
|
47
|
+
setCustomStyle(style: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* Sends the 'visibility_changed' event to the Mini App.
|
|
50
|
+
*/
|
|
51
|
+
setVisibility(is_visible: boolean): void;
|
|
52
|
+
}
|
|
53
|
+
export declare const hostMiniApp: HostMiniApp;
|
|
@@ -3,5 +3,6 @@ export declare class HostNotification {
|
|
|
3
3
|
/**
|
|
4
4
|
* Listens to 'web_app_send_notification' method call from Mini App.
|
|
5
5
|
*/
|
|
6
|
-
|
|
6
|
+
onSend(listener: (params: MethodParams<'web_app_send_notification'>) => void): VoidFunction;
|
|
7
7
|
}
|
|
8
|
+
export declare const hostNotification: HostNotification;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostPopup {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_open_popup' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onOpen(listener: (params: MethodParams<'web_app_open_popup'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Closes the popup.
|
|
9
|
+
* Sends 'popup_closed' event to the Mini App.
|
|
10
|
+
* @param button_id Identifier of the clicked button.
|
|
11
|
+
*/
|
|
12
|
+
close(button_id?: string): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const hostPopup: HostPopup;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostPrivacy {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_request_phone' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onRequestPhone(listener: () => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_request_write_access' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onRequestWriteAccess(listener: () => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Sends the 'phone_requested' event to the Mini App.
|
|
13
|
+
*/
|
|
14
|
+
setPhoneRequested(params: EventPayload<'phone_requested'>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the 'write_access_requested' event to the Mini App.
|
|
17
|
+
*/
|
|
18
|
+
setWriteAccessRequested(params: EventPayload<'write_access_requested'>): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const hostPrivacy: HostPrivacy;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostQrScanner {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_open_scan_qr_popup' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onOpenPopup(listener: (params: MethodParams<'web_app_open_scan_qr_popup'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_close_scan_qr_popup' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onClosePopup(listener: () => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Sends the 'qr_text_received' event to the Mini App.
|
|
13
|
+
*/
|
|
14
|
+
sendQrTextReceived(params: EventPayload<'qr_text_received'>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the 'scan_qr_popup_closed' event to the Mini App.
|
|
17
|
+
*/
|
|
18
|
+
closePopup(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const hostQrScanner: HostQrScanner;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostSecondaryButton {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_setup_secondary_button' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onSetup(listener: (params: MethodParams<'web_app_setup_secondary_button'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Simulates the user pressing the secondary button.
|
|
9
|
+
* Sends 'secondary_button_pressed' event to the Mini App.
|
|
10
|
+
*/
|
|
11
|
+
press(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const hostSecondaryButton: HostSecondaryButton;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostSettingsButton {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_setup_settings_button' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onSetup(listener: (params: MethodParams<'web_app_setup_settings_button'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Simulates the user pressing the settings button.
|
|
9
|
+
* Sends 'settings_button_pressed' event to the Mini App.
|
|
10
|
+
*/
|
|
11
|
+
press(): void;
|
|
12
|
+
}
|
|
13
|
+
export declare const hostSettingsButton: HostSettingsButton;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MethodParams, EventPayload } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostSharing {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_send_prepared_message' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onSendPreparedMessage(listener: (params: MethodParams<'web_app_send_prepared_message'>) => void): VoidFunction;
|
|
7
|
+
/**
|
|
8
|
+
* Listens to 'web_app_share_to_story' methods calls from Mini App.
|
|
9
|
+
*/
|
|
10
|
+
onShareToStory(listener: (params: MethodParams<'web_app_share_to_story'>) => void): VoidFunction;
|
|
11
|
+
/**
|
|
12
|
+
* Sends the 'prepared_message_failed' event to the Mini App.
|
|
13
|
+
*/
|
|
14
|
+
setPreparedMessageFailed(params: EventPayload<'prepared_message_failed'>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Sends the 'prepared_message_sent' event to the Mini App.
|
|
17
|
+
*/
|
|
18
|
+
setPreparedMessageSent(): void;
|
|
19
|
+
}
|
|
20
|
+
export declare const hostSharing: HostSharing;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MethodParams } from '@vbotma/bridge';
|
|
2
|
+
export declare class HostSwipeBehavior {
|
|
3
|
+
/**
|
|
4
|
+
* Listens to 'web_app_setup_swipe_behavior' methods calls from Mini App.
|
|
5
|
+
*/
|
|
6
|
+
onSetupSwipeBehavior(listener: (params: MethodParams<'web_app_setup_swipe_behavior'>) => void): VoidFunction;
|
|
7
|
+
}
|
|
8
|
+
export declare const hostSwipeBehavior: HostSwipeBehavior;
|