This commit is contained in:
2022-07-21 03:28:35 +00:00
parent d7c883d6df
commit 51b34b0e1d
30103 changed files with 4152204 additions and 23 deletions
+3
View File
@@ -0,0 +1,3 @@
import { AddToHomeScreen } from './common';
import { LiffCore } from '../../liff';
export default function createAddToHomeScreen(liff: LiffCore): AddToHomeScreen;
+18
View File
@@ -0,0 +1,18 @@
import { LiffCore } from '../../liff';
export interface AddToHomeScreenParams {
name: string;
iconUrl: string;
state: string;
}
export declare type AddToHomeScreen = (params: AddToHomeScreenParams) => Promise<number>;
export declare const SCHEME_HEADER = "app/";
export declare const ADD_TO_HOME_SCREEN_RESULT: {
UNKNOWN: number;
};
/**
* verification()
* @export
* @param {AddToHomeScreenParams} params
* @returns {boolean}
*/
export declare function verification(params: AddToHomeScreenParams, liff: LiffCore): boolean;
+3
View File
@@ -0,0 +1,3 @@
import { AddToHomeScreen } from './common';
import { LiffCore } from '../../liff';
export default function createAddToHomeScreen(liff: LiffCore): AddToHomeScreen;
+9
View File
@@ -0,0 +1,9 @@
import { ClientCallback } from './types';
export declare const callbacks: {};
/**
* Add callback to LIFFEvent listener.
* @export
* @param {string} type
* @param {ClientCallback} callback
*/
export default function addListener(type: string, callback: ClientCallback): void;
+19
View File
@@ -0,0 +1,19 @@
/**
* call()
* Let js pass event and data to client
* and wait for callback
* @export
* @param {string} type - name of event
* @param {*} [params={}] - data object to pass to client
* @param {{ - options
* callbackId?: string - use randomly string by default, use `''` if client needs
* once?: boolean - will remove listener once callback is fired if is true
* }} [options={
* once: true,
* }]
* @returns {Promise<any>}
*/
export default function call(type: string, params?: any, options?: {
callbackId?: string;
once?: boolean;
}): Promise<any>;
+2
View File
@@ -0,0 +1,2 @@
import './customEventPolyFill';
export default function createEvent<T>(detail: T): CustomEvent;
@@ -0,0 +1,3 @@
/**
* https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent#Polyfill
*/
+6
View File
@@ -0,0 +1,6 @@
/**
* Wrap window.dispatchEvent
* Expose `window.liff._dispatchEvent()` for client to interact with js
* @param {string} json
*/
export default function dispatch(json: string): void;
+6
View File
@@ -0,0 +1,6 @@
export { default as createEvent } from './createEvent';
export { default as addListener } from './addListener';
export { default as removeListener } from './removeListener';
export { default as dispatch } from './dispatch';
export { default as postMessage } from './postMessage';
export { default as call } from './call';
+8
View File
@@ -0,0 +1,8 @@
/**
* Wrapper of window._liff.postMessage
* @export
* @param {string} type - name of message to client
* @param {{}} [params={}] - object data sent to client
* @param {string} [callbackId=''] - callbackId to identify client callback
*/
export default function postMessage(type: string, params?: {}, callbackId?: string): void;
+7
View File
@@ -0,0 +1,7 @@
import { ClientCallback } from './types';
/**
* Remove callback from LIFFEvent listener.
* @param {string} type [description]
* @param {Function} callback [description]
*/
export default function removeListener(type: string, callback: ClientCallback): void;
+1
View File
@@ -0,0 +1 @@
export declare type ClientCallback = (e: CustomEvent) => void;
+7
View File
@@ -0,0 +1,7 @@
/**
* checkFeature()
* Check whether the permission of the feature is approved
* @param {string} feature [name of feature]
* @return {boolean}
*/
export default function checkFeature(feature: string): boolean;
+1
View File
@@ -0,0 +1 @@
export {};
+4
View File
@@ -0,0 +1,4 @@
/**
* Closes the LIFF app.
*/
export default function closeWindow(): void;
+2
View File
@@ -0,0 +1,2 @@
import { AIdInterface } from '../store';
export default function getAId(): AIdInterface | undefined;
+5
View File
@@ -0,0 +1,5 @@
import { LiffCore } from '../liff';
declare type GetAdvertisingIdResult = null | string;
export declare type GetAdvertisingId = () => Promise<GetAdvertisingIdResult>;
export default function createGetAdvertisingId(liff: LiffCore): GetAdvertisingId;
export {};
+1
View File
@@ -0,0 +1 @@
export default function getIsVideoAutoPlay(): boolean;
+11
View File
@@ -0,0 +1,11 @@
/**
* Gets the user's LINE version.
* @export
* @returns {string|null} LINE Version, if inside LINE client. Null, otherwise
* @example
* const lineVersion = liff.getLineVersion()
* if (!lineVersion || lineVersion === '9.1.0') {
* // do something
* }
*/
export default function getLineVersion(): string | null;
+2
View File
@@ -0,0 +1,2 @@
import { ProfilePlusInterface } from '../store';
export default function getProfilePlus(): ProfilePlusInterface | undefined;
+11
View File
@@ -0,0 +1,11 @@
export interface OpenWindowParams {
url: string;
external?: boolean;
}
/**
* Opens the specified URL in the in-app browser of LINE or external browser.
* @export
* @param {OpenWindowParams} params
* @returns {void}
*/
export default function openWindow(params: OpenWindowParams): void;
+2
View File
@@ -0,0 +1,2 @@
import { Context } from '../store';
export default function parseContext(contextStr: string): Context | null;
+7
View File
@@ -0,0 +1,7 @@
/**
* listen to `ready` event from client
* set client features in client callback
* @export
* @returns {Promise<any>}
*/
export default function ready(): Promise<void>;
+9
View File
@@ -0,0 +1,9 @@
import { LiffCore } from '../liff';
/**
* open scan qr code appview
*/
export interface ScanCodeResult {
value: string | null;
}
export declare type ScanCode = () => Promise<ScanCodeResult>;
export default function createScanCode(liff: LiffCore): ScanCode;