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
+4
View File
@@ -0,0 +1,4 @@
/**
* remove all stored data
*/
export default function clean(): void;
+1
View File
@@ -0,0 +1 @@
export declare function getFeatureToken(liffId: string): string | null;
+9
View File
@@ -0,0 +1,9 @@
export declare function getByLiffId(key: string, liffId: string | undefined): any;
/**
* isInClient === true: sessionStorage setter
* isInClient === false: localStroage setter
* @export
* @param {string} key
* @return {*}
*/
export default function get(key: string): any;
+125
View File
@@ -0,0 +1,125 @@
import get from './get';
import set from './set';
import clean from './clean';
import remove from './remove';
declare const _default: {
get: typeof get;
set: typeof set;
remove: typeof remove;
clean: typeof clean;
};
export default _default;
interface Config {
liffId?: string;
redirectUri?: string;
}
interface JWTPayload {
iss?: string;
sub?: string;
aud?: string;
exp?: number;
iat?: number;
auth_time?: number;
nonce?: string;
amr?: string[];
name?: string;
picture?: string;
email?: string;
}
export declare function getConfig(): Config;
export declare function setConfig(value: Config): void;
export declare function getFeatures(): string[];
export declare function setFeatures(value: string[]): void;
interface LoginTmp {
codeVerifier: string;
}
/**
* temporary values for LINE Login getter / setter
*/
export declare function getLoginTmp(): LoginTmp;
export declare function setLoginTmp(value: LoginTmp): void;
export declare function removeLoginTmp(): void;
/**
* Gets the current user's access token.
* You can use the access token obtained with this API to send user information from the LIFF app to the server.
* @see {@link https://developers.line.biz/en/docs/liff/using-user-profile/|Using user information in LIFF apps and servers}
*/
export declare function getAccessToken(): string | null;
export declare function setAccessToken(value: string): void;
/**
* context token & client id will be set
* from token_hash to sessionToken from LINE 10.8.0
*/
export declare const getRawContext: () => string | null;
export declare const getClientId: () => string | null;
/**
* Get the raw ID token of the current user obtained by the LIFF SDK.
* An ID token is a JSON Web Token (JWT) that contains user information.
*
* You can use the ID token obtained with this API when sending the user information from the LIFF app to the server.
* @see {@link https://developers.line.biz/en/docs/liff/using-user-profile/|Using user information in LIFF apps and servers}
*/
export declare function getIDToken(): string | null;
export declare function setIDToken(value: string): void;
/**
* Gets the payload of the ID token that's acquired by the LIFF SDK.
* The payload includes the user display name, profile image URL, and email address.
*
* Use this API when you want to use the display name of the user in the LIFF app.
*/
export declare function getDecodedIDToken(): JWTPayload | null;
export declare function setDecodedIDToken(value: unknown): void;
/**
* featureToken getter / setter
*/
export declare function getFeatureToken(): string | null;
export declare function setFeatureToken(value: string): void;
export interface ProfilePlusInterface {
regionCode: string;
}
export interface AIdInterface {
id: string;
t: boolean;
}
/**
* context getter / setter
*/
export interface Context {
type: 'utou' | 'room' | 'group' | 'none';
utouId?: string;
roomId?: string;
groupId: string;
userId?: string;
endpointUrl: string;
viewType?: string;
accessTokenHash?: string;
permanentLinkPattern?: 'replace' | 'concat';
/**
* profile+ related settings
*/
profilePlus?: ProfilePlusInterface;
/**
* device-related settings
*/
d?: {
autoplay: boolean;
aId: AIdInterface;
};
/**
* whether user can use each methods
*/
availability: {
shareTargetPicker: {
permission: boolean;
minVer: string;
};
};
}
export declare function getContext(): Context | null;
export declare function setContext(value: Context | null): void;
/**
* special handle expire time in cookie
*/
export declare function setExpireTime(expires: Date): void;
export declare function getExpireTime(): string | null;
export declare function removeExpireTime(): void;
+6
View File
@@ -0,0 +1,6 @@
/**
* Checks whether the specified API is available in the environment where you started the LIFF app.
* Specifically, it verifies whether the current LINE version supports the API and whether the terms and conditions for the API have been accepted.
*/
declare const isApiAvailable: (apiName: "shareTargetPicker") => boolean;
export default isApiAvailable;
+8
View File
@@ -0,0 +1,8 @@
/**
* isInClient === true: sessionStorage
* isInClient === false: localStorage
* @export
* @param {string} key
* @param {*} value
*/
export default function remove(key: string): void;
+8
View File
@@ -0,0 +1,8 @@
/**
* isInClient === true: sessionStorage setter
* isInClient === false: localStorage setter
* @export
* @param {string} key
* @param {*} value
*/
export default function set(key: string, value: unknown): void;