@line/liff
Advanced tools
Comparing version 2.6.0 to 2.7.0
import { LiffCore } from '../liff'; | ||
import { Analytics } from '../uts'; | ||
export interface Config { | ||
liffId: string; | ||
analytics?: Analytics; | ||
} | ||
/** | ||
@@ -8,4 +13,2 @@ * Initializes a LIFF app. | ||
*/ | ||
export default function init(this: LiffCore, config: { | ||
liffId: string; | ||
}, successCallback?: () => void, errorCallback?: (error: Error) => void): Promise<void>; | ||
export default function init(this: LiffCore, config: Config, successCallback?: () => void, errorCallback?: (error: Error) => void): Promise<void>; |
@@ -1,6 +0,4 @@ | ||
export interface Config { | ||
liffId: string; | ||
redirectUri?: string; | ||
} | ||
import { LiffCore } from '../liff'; | ||
import { Config } from './index'; | ||
export declare type SubsequentInit = (config: Config) => Promise<void>; | ||
export default function subsequentInit(config: Config): Promise<void>; | ||
export default function subsequentInit(this: LiffCore, config: Config): Promise<void>; |
@@ -23,2 +23,6 @@ import init from './init'; | ||
import { LiffExtendableFunctions } from './init/definition/LiffExtension'; | ||
import { LiffUTS } from './uts'; | ||
interface LiffUts { | ||
analytics: LiffUTS; | ||
} | ||
declare const liffCore: { | ||
@@ -66,5 +70,5 @@ init: typeof init; | ||
}; | ||
export declare type LiffCore = typeof liffCore; | ||
export declare type LiffCore = typeof liffCore & Partial<LiffUts>; | ||
declare type Liff = LiffCore & LiffExtendableFunctions; | ||
declare const liff: Liff; | ||
export default liff; |
@@ -5,2 +5,3 @@ import get from './get'; | ||
import remove from './remove'; | ||
import { Config } from '../init'; | ||
declare const _default: { | ||
@@ -13,6 +14,2 @@ get: typeof get; | ||
export default _default; | ||
interface Config { | ||
liffId?: string; | ||
redirectUri?: string; | ||
} | ||
interface JWTPayload { | ||
@@ -31,4 +28,7 @@ iss?: string; | ||
} | ||
export declare function getConfig(): Config; | ||
export declare function setConfig(value: Config): void; | ||
interface ConfigInStore extends Partial<Config> { | ||
redirectUri?: string; | ||
} | ||
export declare function getConfig(): ConfigInStore; | ||
export declare function setConfig(value: ConfigInStore): void; | ||
/** | ||
@@ -134,2 +134,11 @@ * features (string array of feature names) getter / setter | ||
}; | ||
/** | ||
* mode of UTS tracking | ||
* mode: whether SDK init and send PV or does nothing | ||
* sendRatio: how much SDK filters out of total. (won't send) 0.0 ~ 1.0 (no filter) | ||
*/ | ||
utsTracking: { | ||
mode: 'force' | 'auto' | 'none'; | ||
sendRatio: number; | ||
}; | ||
} | ||
@@ -149,1 +158,22 @@ export declare function getContext(): Context | null; | ||
export declare function getIsSubsequentLiffApp(): boolean; | ||
/** | ||
* store referrer from URL [memory] | ||
*/ | ||
export declare function setReferrer(obj: Record<string, string>): void; | ||
export declare function getReferrer(): undefined | Record<string, string>; | ||
declare const utsExtra: { | ||
isLiffSuccessful: boolean; | ||
isLoggedIn: boolean; | ||
id: string; | ||
version: string; | ||
}; | ||
declare type DeepPartial<T> = { | ||
[P in keyof T]?: DeepPartial<T[P]>; | ||
}; | ||
declare type UtsExtra = typeof utsExtra; | ||
/** | ||
* store value for uts.setExtra('liff') | ||
* @param _utsExtra | ||
*/ | ||
export declare function assignUtsExtra(_utsExtra: DeepPartial<UtsExtra>): void; | ||
export declare function getUtsExtra(): UtsExtra; |
@@ -9,2 +9,12 @@ /** | ||
/** | ||
* decode Base64 with Unicode included | ||
* | ||
* you can refer to encode implementation if you needed: | ||
* https://developer.mozilla.org/ja/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#Solution_4_%E2%80%93_escaping_the_string_before_encoding_it | ||
* @export | ||
* @param {string} str | ||
* @returns {string} | ||
*/ | ||
export declare function decodeUnicode(str: string): string; | ||
/** | ||
* encode Base64URL | ||
@@ -11,0 +21,0 @@ * @export |
declare type Value = undefined | string; | ||
declare type Query = Record<string, Value | Value[]>; | ||
export declare type Query = Record<string, Value | Value[]>; | ||
/** | ||
@@ -4,0 +4,0 @@ * Parse url query string to object |
{ | ||
"name": "@line/liff", | ||
"version": "2.6.0", | ||
"version": "2.7.0", | ||
"main": "dist/lib/index.js", | ||
@@ -61,2 +61,3 @@ "types": "dist/lib", | ||
"@linecorp/reg": "^1.7.0", | ||
"@linecorp/uts": "^3.0.4", | ||
"@types/jest": "^24.0.25", | ||
@@ -75,2 +76,3 @@ "@typescript-eslint/eslint-plugin": "^2.13.0", | ||
"jest": "^24.6.0", | ||
"jest-fetch-mock": "^3.0.3", | ||
"lint-staged": ">=9.5.0", | ||
@@ -77,0 +79,0 @@ "prettier": "^1.19.1", |
Sorry, the diff of this file is too big to display
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
566157
122
1304
33