@authing/react-ui-components 4.0.6-zhihu.0 → 4.0.7-hep.0

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.
Files changed (55) hide show
  1. package/lib/index.min.css +2 -2
  2. package/lib/index.min.js +1 -1
  3. package/package.json +2 -2
  4. package/types/AccountMerge/UserRadio.d.ts +5 -0
  5. package/types/AccountMerge/index.d.ts +3 -0
  6. package/types/AccountMerge/interface.d.ts +27 -0
  7. package/types/AccountMerge/utils.d.ts +3 -0
  8. package/types/BindTotp/businessRequest.d.ts +1 -1
  9. package/types/ChangeLanguage/index.d.ts +1 -1
  10. package/types/ChangePassword/businessRequest.d.ts +1 -1
  11. package/types/CompleteInfo/businessRequest.d.ts +1 -1
  12. package/types/CompleteInfo/core/components/TreeSelect.d.ts +11 -0
  13. package/types/CompleteInfo/index.d.ts +1 -0
  14. package/types/CompleteInfo/interface.d.ts +10 -6
  15. package/types/ForgetPassword/core/resetPassword.d.ts +0 -2
  16. package/types/ForgetPassword/interface.d.ts +6 -6
  17. package/types/Guard/GuardModule/stateMachine.d.ts +2 -2
  18. package/types/Guard/config.d.ts +0 -2
  19. package/types/Guard/core/renderModule.d.ts +1 -1
  20. package/types/Guard/event.d.ts +10 -8
  21. package/types/Guard/module.d.ts +3 -1
  22. package/types/IdentityBinding/businessRequest.d.ts +2 -2
  23. package/types/Login/interface.d.ts +2 -2
  24. package/types/Login/socialLogin/index.d.ts +1 -1
  25. package/types/MFA/businessRequest.d.ts +1 -1
  26. package/types/MFA/interface.d.ts +2 -1
  27. package/types/RecoveryCode/businessRequest.d.ts +1 -1
  28. package/types/Type/application.d.ts +10 -13
  29. package/types/Type/index.d.ts +6 -6
  30. package/types/_utils/GuardErrorCode.d.ts +1 -1
  31. package/types/_utils/config/index.d.ts +101 -89
  32. package/types/_utils/hooks/index.d.ts +0 -4
  33. package/types/_utils/index.d.ts +1 -3
  34. package/types/_utils/logger/interface.d.ts +1 -1
  35. package/types/_utils/responseManagement/interface.d.ts +3 -2
  36. package/types/version/version.d.ts +1 -1
  37. package/dist/asset-manifest.json +0 -26
  38. package/dist/index.html +0 -1
  39. package/dist/static/css/2.2cdfb9d1.chunk.css +0 -3
  40. package/dist/static/css/2.2cdfb9d1.chunk.css.map +0 -1
  41. package/dist/static/css/main.f438f284.chunk.css +0 -2
  42. package/dist/static/css/main.f438f284.chunk.css.map +0 -1
  43. package/dist/static/js/2.9a1287ca.chunk.js +0 -3
  44. package/dist/static/js/2.9a1287ca.chunk.js.LICENSE.txt +0 -112
  45. package/dist/static/js/2.9a1287ca.chunk.js.map +0 -1
  46. package/dist/static/js/3.d3328d89.chunk.js +0 -2
  47. package/dist/static/js/3.d3328d89.chunk.js.map +0 -1
  48. package/dist/static/js/main.5735e6f1.chunk.js +0 -2
  49. package/dist/static/js/main.5735e6f1.chunk.js.map +0 -1
  50. package/dist/static/js/runtime-main.e75981a3.js +0 -2
  51. package/dist/static/js/runtime-main.e75981a3.js.map +0 -1
  52. package/dist/static/media/loading.3cf0104f.svg +0 -32
  53. package/types/Login/core/withLandrayQrcode.d.ts +0 -11
  54. package/types/Login/core/withWeComQrcode.d.ts +0 -2
  55. package/types/_utils/types.d.ts +0 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/react-ui-components",
3
- "version": "4.0.6-zhihu.0",
3
+ "version": "4.0.7-hep.0",
4
4
  "private": false,
5
5
  "main": "lib/index.min.js",
6
6
  "typings": "types/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "antd": "^4.8.0",
14
- "authing-js-sdk": "4.23.35",
14
+ "authing-js-sdk": "4.23.36-alpha.1",
15
15
  "classnames": "^2.3.1",
16
16
  "fastclick": "^1.0.6",
17
17
  "global": "^4.4.0",
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { UserRadioItemProps, UserRadioProps } from './interface';
3
+ import './styles.less';
4
+ export declare const UserRadioItem: React.FC<UserRadioItemProps>;
5
+ export declare const UserRadio: React.FC<UserRadioProps>;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './styles.less';
3
+ export declare const GuardAccountMergeView: React.FC;
@@ -0,0 +1,27 @@
1
+ export interface BriefUserInfo {
2
+ displayName: string;
3
+ avatar: string;
4
+ phone: string;
5
+ email: string;
6
+ username: string;
7
+ name: string;
8
+ }
9
+ export interface GuardAccountMergeInitData {
10
+ currentUserInfo: BriefUserInfo;
11
+ existingUserInfo: BriefUserInfo;
12
+ mergeToken?: string;
13
+ }
14
+ export interface UserRadioProps {
15
+ currentUserInfo: BriefUserInfo;
16
+ existingUserInfo: BriefUserInfo;
17
+ onChange?: (value: any) => void;
18
+ value?: any;
19
+ }
20
+ export interface UserRadioItemProps extends BriefUserInfo {
21
+ value: boolean;
22
+ selected: boolean;
23
+ onClick: (value: boolean) => void;
24
+ }
25
+ export declare enum AuthFlowAction {
26
+ MERGE = "confirm-account-merge"
27
+ }
@@ -0,0 +1,3 @@
1
+ import { User } from 'authing-js-sdk';
2
+ export declare const getDisplayName: (user: User) => string;
3
+ export declare const getDisplayNameByEmail: (displayName: string) => string;
@@ -1,4 +1,4 @@
1
- export declare enum BindTotpBusinessAction {
1
+ export declare const enum BindTotpBusinessAction {
2
2
  VerifyTotpFirstTime = "verify-totp-first-time",
3
3
  ConfirmTotpRecoveryCode = "confirm-totp-recovery-code"
4
4
  }
@@ -6,5 +6,5 @@ export declare const LngTextMapping: Record<Lang, {
6
6
  }>;
7
7
  export declare const ChangeLanguage: (props: {
8
8
  onLangChange?: ((lang: Lang) => void) | undefined;
9
- langRange?: string[] | undefined;
9
+ langRange?: Lang[] | undefined;
10
10
  }) => JSX.Element | null;
@@ -1,4 +1,4 @@
1
- export declare enum ChangePasswordBusinessAction {
1
+ export declare const enum ChangePasswordBusinessAction {
2
2
  ResetPassword = "reset-password-first-time",
3
3
  FirstLoginReset = "reset-password-forced",
4
4
  ResetPasswordStrengthDetection = "reset-password-strength-detection"
@@ -1,6 +1,6 @@
1
1
  import { User } from 'authing-js-sdk';
2
2
  import { CompleteInfoRequest, RegisterCompleteInfoInitData } from './interface';
3
- export declare enum CompleteInfoAuthFlowAction {
3
+ export declare const enum CompleteInfoAuthFlowAction {
4
4
  Complete = "complete-completion",
5
5
  Skip = "skip-completion"
6
6
  }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare type OptionType = {
3
+ id: string;
4
+ name: string;
5
+ children: OptionType[];
6
+ };
7
+ interface TreeSelectProps {
8
+ options: OptionType[];
9
+ }
10
+ declare const TreeSelect: React.FC<TreeSelectProps>;
11
+ export default TreeSelect;
@@ -9,3 +9,4 @@ export declare const GuardCompleteInfo: React.FC<{
9
9
  }>;
10
10
  export declare const GuardLoginCompleteInfoView: React.FC;
11
11
  export declare const GuardRegisterCompleteInfoView: React.FC;
12
+ export declare const GuardAccountMergeCompleteInfoView: React.FC;
@@ -5,21 +5,23 @@ export interface CompleteInfoConfig extends IG2Config {
5
5
  export declare const getDefaultCompleteInfoConfig: () => CompleteInfoConfig;
6
6
  export interface CompleteInfoEvents extends IG2Events {
7
7
  onRegisterInfoCompleted?: (user: User, udfs: {
8
- definition: any;
8
+ key: any;
9
9
  value: any;
10
- }[], authClient: AuthenticationClient) => void;
10
+ }[], authClient: AuthenticationClient, opts?: {
11
+ phone?: string;
12
+ canMergeUser?: boolean;
13
+ }) => void;
11
14
  onRegisterInfoCompletedError?: (error: CommonMessage, udfs: {
12
- definition: any;
15
+ key: any;
13
16
  value: any;
14
17
  }[], authClient: AuthenticationClient) => void;
18
+ onAccountMergeCompleteInfo?: (user: User) => void;
15
19
  }
16
20
  export interface GuardCompleteInfoProps extends IG2FCProps, CompleteInfoEvents {
17
21
  config: Partial<CompleteInfoConfig>;
18
22
  }
19
23
  export interface GuardCompleteInfoViewProps extends GuardCompleteInfoProps {
20
24
  config: CompleteInfoConfig;
21
- initData: any;
22
- onLogin?: any;
23
25
  }
24
26
  export declare type ExtendsFieldType = 'user' | 'internal';
25
27
  export interface ExtendsField {
@@ -52,6 +54,7 @@ export interface CompleteInfoMetaData {
52
54
  name: string;
53
55
  required: boolean;
54
56
  validateRules: CompleteInfoRule[];
57
+ checkUnique?: boolean;
55
58
  options?: CompleteInfoSelectOption[];
56
59
  }
57
60
  export declare enum CompleteInfoBaseControls {
@@ -70,7 +73,8 @@ export declare enum CompleteInfoExtendsControls {
70
73
  STRING = "string",
71
74
  TEXT = "text",
72
75
  GENDER = "gender",
73
- COUNTRY = "country"
76
+ COUNTRY = "country",
77
+ TREE = "tree"
74
78
  }
75
79
  export interface CompleteInfoInitData {
76
80
  skip: boolean;
@@ -6,8 +6,6 @@ export declare enum InputMethodMap {
6
6
  interface ResetPasswordProps {
7
7
  onReset: any;
8
8
  publicConfig: any;
9
- onSend: (type: 'email' | 'phone') => void;
10
- onSendError: (type: 'email' | 'phone', error: any) => void;
11
9
  }
12
10
  export declare const ResetPassword: (props: ResetPasswordProps) => JSX.Element;
13
11
  export {};
@@ -1,10 +1,10 @@
1
- import { AuthenticationClient, CommonMessage } from 'authing-js-sdk';
2
- import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
1
+ import { AuthenticationClient, CommonMessage, SceneType } from 'authing-js-sdk';
2
+ import { EmailScene, IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
3
3
  export interface ForgetPasswordEvents extends IG2Events {
4
- onPwdEmailSend?: (authClient: AuthenticationClient) => void;
5
- onPwdEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
6
- onPwdPhoneSend?: (authClient: AuthenticationClient) => void;
7
- onPwdPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
4
+ onEmailSend?: (authClient: AuthenticationClient, sence?: EmailScene) => void;
5
+ onEmailSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: EmailScene) => void;
6
+ onPhoneSend?: (authClient: AuthenticationClient, sence?: SceneType) => void;
7
+ onPhoneSendError?: (error: CommonMessage, authClient: AuthenticationClient, sence?: SceneType) => void;
8
8
  onPwdReset?: (authClient: AuthenticationClient) => void;
9
9
  onPwdResetError?: (error: CommonMessage, authClient: AuthenticationClient) => void;
10
10
  }
@@ -4,7 +4,7 @@ export interface ModuleState {
4
4
  moduleName: GuardModuleType;
5
5
  initData?: any;
6
6
  }
7
- export declare enum ActionType {
7
+ export declare const enum ActionType {
8
8
  ChangeModule = "ChangeModule",
9
9
  Back = "Back",
10
10
  Init = "Init"
@@ -29,7 +29,7 @@ export declare class GuardStateMachine {
29
29
  end: () => void;
30
30
  historyPush: (data: ModuleState, actionType?: ActionType) => void;
31
31
  historyBack: (data: ModuleState) => void;
32
- setConfig: (config: GuardLocalConfig) => void;
32
+ setConfig: (config: Partial<GuardLocalConfig>) => void;
33
33
  isUseHistoryHijack: () => boolean;
34
34
  onPopstate: () => void;
35
35
  }
@@ -2,8 +2,6 @@ import { ReactNode } from 'react';
2
2
  import { GuardModuleType } from '.';
3
3
  import { LoginConfig } from '../Login/interface';
4
4
  import { RegisterConfig } from '../Register/interface';
5
- export interface GuardComponentConfig extends Partial<GuardLocalConfig> {
6
- }
7
5
  export interface GuardLocalConfig extends RegisterConfig, LoginConfig {
8
6
  isSSO?: boolean;
9
7
  defaultScenes?: GuardModuleType;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { GuardProps } from '..';
3
3
  import '../styles.less';
4
- export declare enum LangMAP {
4
+ export declare const enum LangMAP {
5
5
  zhCn = "zh-CN",
6
6
  enUs = "en-US",
7
7
  jaJp = "ja-JP"
@@ -51,10 +51,10 @@ export declare const GuardEventsCamelToKebabMapping: {
51
51
  readonly onRegister: "register";
52
52
  readonly onBeforeRegister: "before-register";
53
53
  readonly onRegisterError: "register-error";
54
- readonly onPwdEmailSend: "pwd-email-send";
55
- readonly onPwdEmailSendError: "pwd-email-send-error";
56
- readonly onPwdPhoneSend: "pwd-phone-send";
57
- readonly onPwdPhoneSendError: "pwd-phone-send-error";
54
+ readonly onEmailSend: "email-send";
55
+ readonly onEmailSendError: "email-send-error";
56
+ readonly onPhoneSend: "phone-send";
57
+ readonly onPhoneSendError: "phone-send-error";
58
58
  readonly onPwdReset: "pwd-reset";
59
59
  readonly onPwdResetError: "pwd-reset-error";
60
60
  readonly onClose: "close";
@@ -63,6 +63,7 @@ export declare const GuardEventsCamelToKebabMapping: {
63
63
  readonly onRegisterInfoCompleted: "register-info-completed";
64
64
  readonly onRegisterInfoCompletedError: "register-info-completed-error";
65
65
  readonly onLangChange: "lang-change";
66
+ readonly onBeforeChangeModule: "before-change-module";
66
67
  };
67
68
  export interface GuardEventsKebabToCamelType {
68
69
  load: GuardEvents['onLoad'];
@@ -73,10 +74,10 @@ export interface GuardEventsKebabToCamelType {
73
74
  'before-register': GuardEvents['onBeforeRegister'];
74
75
  register: GuardEvents['onRegister'];
75
76
  'register-error': GuardEvents['onRegisterError'];
76
- 'pwd-email-send': GuardEvents['onPwdEmailSend'];
77
- 'pwd-email-send-error': GuardEvents['onPwdEmailSendError'];
78
- 'pwd-phone-send': GuardEvents['onPwdPhoneSend'];
79
- 'pwd-phone-send-error': GuardEvents['onPwdPhoneSendError'];
77
+ 'email-send': GuardEvents['onEmailSend'];
78
+ 'email-send-error': GuardEvents['onEmailSendError'];
79
+ 'phone-send': GuardEvents['onPhoneSend'];
80
+ 'phone-send-error': GuardEvents['onPhoneSendError'];
80
81
  'pwd-reset': GuardEvents['onPwdReset'];
81
82
  'pwd-reset-error': GuardEvents['onPwdResetError'];
82
83
  close: GuardEvents['onClose'];
@@ -85,4 +86,5 @@ export interface GuardEventsKebabToCamelType {
85
86
  'register-info-completed': GuardEvents['onRegisterInfoCompleted'];
86
87
  'register-info-completed-error': GuardEvents['onRegisterInfoCompletedError'];
87
88
  'lang-change': GuardEvents['onLangChange'];
89
+ 'before-change-module': GuardEvents['onBeforeChangeModule'];
88
90
  }
@@ -1,4 +1,4 @@
1
- export declare enum GuardModuleType {
1
+ export declare const enum GuardModuleType {
2
2
  ERROR = "error",
3
3
  LOGIN = "login",
4
4
  REGISTER = "register",
@@ -14,10 +14,12 @@ export declare enum GuardModuleType {
14
14
  LOGIN_COMPLETE_INFO = "loginCompleteInfo",
15
15
  REGISTER_PASSWORD = "registerPassword",
16
16
  REGISTER_COMPLETE_INFO = "registerCompleteInfo",
17
+ CUSTOM_COMPLETE_INFO = "customCompleteInfo",
17
18
  RECOVERY_CODE = "recoveryCode",
18
19
  SUBMIT_SUCCESS = "submitSuccess",
19
20
  IDENTITY_BINDING_ASK = "identityBindingAsk",
20
21
  IDENTITY_BINDING = "identityBinding",
22
+ ACCOUNT_MERGE = "accountMerge",
21
23
  SELF_UNLOCK = "selfUnlock"
22
24
  }
23
25
  export interface GuardModuleAction {
@@ -1,4 +1,4 @@
1
- export declare enum IdentityBindingBusinessAction {
1
+ export declare const enum IdentityBindingBusinessAction {
2
2
  PhoneCode = "phone-code",
3
3
  EmailCode = "emial-code",
4
4
  Password = "password"
@@ -17,7 +17,7 @@ export interface PasswordParams {
17
17
  password: string;
18
18
  captchaCode: string;
19
19
  }
20
- export declare enum IdentityBindingAction {
20
+ export declare const enum IdentityBindingAction {
21
21
  CreateUser = "create-federation-account",
22
22
  BindByPassword = "bind-identity-by-password",
23
23
  BindByPhoneCode = "bind-identity-by-phone-code",
@@ -1,7 +1,7 @@
1
1
  import { IG2Config, IG2Events, IG2FCProps, IG2FCViewProps } from '../Type';
2
- import { AuthenticationClient, SocialConnectionProvider, User } from 'authing-js-sdk';
2
+ import { AuthenticationClient, User } from 'authing-js-sdk';
3
3
  import { QrCodeAuthenticationClient } from 'authing-js-sdk/build/main/lib/authentication/QrCodeAuthenticationClient';
4
- import { Agreement, LoginMethods, PasswordLoginMethods } from '../Type/application';
4
+ import { Agreement, LoginMethods, PasswordLoginMethods, SocialConnectionProvider } from '../Type/application';
5
5
  export interface LoginConfig extends IG2Config {
6
6
  autoRegister?: boolean;
7
7
  disableResetPwd?: boolean;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import './style.less';
3
3
  import { GuardLocalConfig } from '../../Guard';
4
+ import { ApplicationConfig, SocialConnectionItem } from '../../Type/application';
4
5
  import { StoreInstance } from '../../Guard/core/hooks/useMultipleAccounts';
5
- import { ApplicationConfig, SocialConnectionItem } from '../../Type';
6
6
  export interface SocialLoginProps {
7
7
  appId: string;
8
8
  config: GuardLocalConfig;
@@ -1,4 +1,4 @@
1
- export declare enum MfaBusinessAction {
1
+ export declare const enum MfaBusinessAction {
2
2
  VerifyEmail = "verify-email",
3
3
  VerifySms = "verify-sms",
4
4
  VerifyTotp = "verify-totp",
@@ -7,7 +7,7 @@ export declare const getDefaultMFAConfig: () => MFAConfig;
7
7
  export interface MFAEvents extends IG2Events {
8
8
  onLogin?: (user: User, authClient: AuthenticationClient) => void;
9
9
  }
10
- export declare enum MFAType {
10
+ export declare const enum MFAType {
11
11
  SMS = "SMS",
12
12
  EMAIL = "EMAIL",
13
13
  TOTP = "OTP",
@@ -29,6 +29,7 @@ export interface GuardMFAInitData {
29
29
  nickme?: string;
30
30
  username?: string;
31
31
  current?: MFAType;
32
+ thirdPartyOrigin?: boolean;
32
33
  }
33
34
  export interface GuardMFAProps extends IG2FCProps, MFAEvents {
34
35
  config: Partial<MFAConfig>;
@@ -1,4 +1,4 @@
1
- export declare enum TotpRecoveryCodeBusinessAction {
1
+ export declare const enum TotpRecoveryCodeBusinessAction {
2
2
  RecoveryTotp = "recovery-totp",
3
3
  ConfirmTotpRecoveryCode = "confirm-totp-recovery-code"
4
4
  }
@@ -1,20 +1,20 @@
1
1
  import { Lang } from '..';
2
2
  import { PasswordStrength } from '../_utils';
3
- export declare enum LoginMethods {
3
+ export * from 'authing-js-sdk';
4
+ export declare const enum LoginMethods {
4
5
  LDAP = "ldap",
5
6
  AppQr = "app-qrcode",
6
7
  Password = "password",
7
8
  PhoneCode = "phone-code",
8
9
  WxMinQr = "wechat-miniprogram-qrcode",
9
10
  AD = "ad",
10
- WechatMpQrcode = "wechatmp-qrcode",
11
- WechatworkCorpQrconnect = "wechatwork-corp-qrconnect"
11
+ WechatMpQrcode = "wechatmp-qrcode"
12
12
  }
13
- export declare enum OIDCConnectionMode {
13
+ export declare const enum OIDCConnectionMode {
14
14
  FRONT_CHANNEL = "FRONT_CHANNEL",
15
15
  BACK_CHANNEL = "BACK_CHANNEL"
16
16
  }
17
- export declare enum SocialConnectionProvider {
17
+ export declare const enum SocialConnectionProvider {
18
18
  ALIPAY = "alipay",
19
19
  GOOGLE = "google",
20
20
  WECHATPC = "wechat:pc",
@@ -41,7 +41,7 @@ export declare enum SocialConnectionProvider {
41
41
  QINGCLOUD = "qingcloud",
42
42
  FACEBOOK = "facebook"
43
43
  }
44
- export declare enum Protocol {
44
+ export declare const enum Protocol {
45
45
  AD = "ad",
46
46
  CAS = "cas",
47
47
  LDAP = "ldap",
@@ -98,7 +98,7 @@ export interface SocialConnectionItem {
98
98
  authorizationUrl: string;
99
99
  tooltip: Record<Lang, string>;
100
100
  }
101
- export declare enum RegisterMethods {
101
+ export declare const enum RegisterMethods {
102
102
  Email = "email",
103
103
  Phone = "phone",
104
104
  EmailCode = "emailCode"
@@ -107,12 +107,6 @@ export declare type QrcodeTabsSettings = Record<LoginMethods, Array<{
107
107
  id: string;
108
108
  title: string;
109
109
  isDefault?: boolean;
110
- QRConfig?: {
111
- corpId: string;
112
- agentId: string;
113
- redirectUrl: string;
114
- identifier: string;
115
- };
116
110
  }>>;
117
111
  export interface OidcClientMetadata {
118
112
  grant_types: string[];
@@ -259,6 +253,9 @@ export interface ApplicationConfig {
259
253
  verifyCodeLength: number;
260
254
  websocket: string;
261
255
  welcomeMessage: any;
256
+ userPortal?: {
257
+ mergeAccount?: boolean;
258
+ };
262
259
  skipComplateFileds: boolean;
263
260
  selfUnlockStrategy: 'captcha' | 'password-captcha';
264
261
  defaultLanguageConfig: Lang;
@@ -5,7 +5,7 @@ import { ApplicationConfig } from './application';
5
5
  export * from './application';
6
6
  export type { CommonMessage, User };
7
7
  export declare type Lang = 'zh-CN' | 'en-US' | 'zh-TW' | 'ja-JP';
8
- export declare enum GuardMode {
8
+ export declare const enum GuardMode {
9
9
  Modal = "modal",
10
10
  Normal = "normal"
11
11
  }
@@ -33,7 +33,7 @@ export interface IG2Config {
33
33
  title?: string;
34
34
  logo?: string;
35
35
  lang?: string;
36
- langRange?: string[];
36
+ langRange?: Lang[];
37
37
  host: string;
38
38
  isHost?: boolean;
39
39
  mode: GuardMode;
@@ -48,18 +48,18 @@ export interface IG2Config {
48
48
  }
49
49
  export interface IG2Events {
50
50
  onLoad?: (authClient: AuthenticationClient) => void;
51
- onLoadError?: (error: CommonMessage) => void;
51
+ onLoadError?: (error: any) => void;
52
52
  onClose?: () => void;
53
53
  onLangChange?: (lang: Lang) => void;
54
54
  __changeModule?: (moduleName: GuardModuleType, initData?: any) => void;
55
55
  }
56
56
  export declare const getDefaultG2Config: () => IG2Config;
57
57
  export declare const LanguageMap: any;
58
- export declare enum InputMethod {
58
+ export declare const enum InputMethod {
59
59
  EmailCode = "email-code",
60
60
  PhoneCode = "phone-code"
61
61
  }
62
- export declare enum GuardPageSene {
62
+ export declare const enum GuardPageSene {
63
63
  Global = "global"
64
64
  }
65
65
  export interface GuardPageConfig {
@@ -68,7 +68,7 @@ export interface GuardPageConfig {
68
68
  defaultLanguage: Lang | 'browser';
69
69
  };
70
70
  }
71
- export declare enum EmailScene {
71
+ export declare const enum EmailScene {
72
72
  WELCOME_EMAIL = "WELCOME_EMAIL",
73
73
  FIRST_CREATED_USER = "FIRST_CREATED_USER",
74
74
  REGISTER_VERIFY_CODE = "REGISTER_VERIFY_CODE",
@@ -1,4 +1,4 @@
1
- export declare enum ErrorCode {
1
+ export declare const enum ErrorCode {
2
2
  OTP_MFA_CODE = 1635,
3
3
  APP_MFA_CODE = 1636,
4
4
  INPUT_CAPTCHACODE = 2000,