|
1 | | -interface IConfig { |
2 | | - clientId: string; |
3 | | - scope?: string[]; |
4 | | - isTestEnvironment?: boolean; |
5 | | - redirectUri?: string; |
6 | | - continueTo?: string; |
7 | | - responseType?: 'code' | 'token'; |
8 | | - locale?: string; |
9 | | - state?: string; |
| 1 | +import { StoredOptions, ServiceId, ConfigsOptions, LogoutOptions, InitOptions, AuthorizeOptions, ExchangeTokenOptions, TokenInfoOptions, RequestMagicLinkOptions, TokenInfo } from './typings'; |
| 2 | +export * from './typings'; |
| 3 | +export declare class MtLinkSdk { |
| 4 | + storedOptions: StoredOptions; |
| 5 | + init(clientId: string, options?: InitOptions): void; |
| 6 | + authorize(options?: AuthorizeOptions): void; |
| 7 | + onboard(options?: AuthorizeOptions): void; |
| 8 | + logout(options?: LogoutOptions): void; |
| 9 | + openService(serviceId: ServiceId, options?: ConfigsOptions): void; |
| 10 | + requestMagicLink(options?: RequestMagicLinkOptions): Promise<void>; |
| 11 | + exchangeToken(options?: ExchangeTokenOptions): Promise<string>; |
| 12 | + tokenInfo(token: string, options?: TokenInfoOptions): Promise<TokenInfo>; |
10 | 13 | } |
11 | | -export interface IParams { |
12 | | - client_id: string; |
13 | | - locale?: string; |
14 | | - continue?: string; |
| 14 | +declare const mtLinkSdk: MtLinkSdk; |
| 15 | +declare global { |
| 16 | + interface Window { |
| 17 | + mtLinkSdk: MtLinkSdk; |
| 18 | + MtLinkSdk: typeof MtLinkSdk; |
| 19 | + } |
15 | 20 | } |
16 | | -export interface IOauthParams { |
17 | | - client_id: string; |
18 | | - redirect_uri: string; |
19 | | - response_type: string; |
20 | | - scope?: string; |
21 | | - state?: string; |
22 | | -} |
23 | | -export interface IDomains { |
24 | | - vault: string; |
25 | | - myaccount: string; |
26 | | -} |
27 | | -interface IVaultOptions { |
28 | | - backTo?: string; |
29 | | - newTab?: boolean; |
30 | | -} |
31 | | -interface IMyAccountOptions { |
32 | | - backTo?: string; |
33 | | - newTab?: boolean; |
34 | | - email?: string; |
35 | | - authPage?: string; |
36 | | - showAuthToggle?: boolean; |
37 | | -} |
38 | | -declare class LinkSDK { |
39 | | - private domains; |
40 | | - private params; |
41 | | - private oauthParams; |
42 | | - private isInitialized; |
43 | | - init({ clientId, scope, isTestEnvironment, redirectUri, continueTo, responseType, locale, state }: IConfig): void; |
44 | | - authorize({ newTab, email, authPage, backTo, showAuthToggle }?: IMyAccountOptions): void; |
45 | | - logout({ newTab }?: IMyAccountOptions): void; |
46 | | - openVault({ newTab, backTo }?: IVaultOptions): void; |
47 | | - openSettings({ newTab, backTo }?: IMyAccountOptions): void; |
48 | | -} |
49 | | -declare const _default: LinkSDK; |
50 | | -export default _default; |
| 21 | +export default mtLinkSdk; |
0 commit comments