@gup-fe/js-sdk 2.1.1 → 2.1.3

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.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { CallbackLoginData as CallbackLoginData_2 } from 'dist';
1
2
  import { default as default_2 } from 'react';
2
3
  import { JSX } from 'react/jsx-runtime';
3
4
  import * as React_2 from 'react';
@@ -7,6 +8,31 @@ declare interface AutoLoginConfig {
7
8
  days?: number;
8
9
  }
9
10
 
11
+ export declare interface CallbackLoginData {
12
+ account: {
13
+ account_type: number;
14
+ mobile: string;
15
+ type: number;
16
+ uid: string;
17
+ view_name: string;
18
+ };
19
+ entity: {
20
+ account: string;
21
+ account_type: number;
22
+ openid: string;
23
+ time: number;
24
+ type: number;
25
+ };
26
+ token: string;
27
+ sign: string;
28
+ accid: string;
29
+ extra_data: {
30
+ [key: string]: unknown;
31
+ };
32
+ gaplaySign?: string;
33
+ realname?: string;
34
+ }
35
+
10
36
  declare interface ConfigContextType {
11
37
  gameId: string;
12
38
  autoLoginConfig: AutoLoginConfig;
@@ -16,10 +42,10 @@ declare interface ConfigContextType {
16
42
  currentLoginType?: LoginTypes;
17
43
  defaultLoginType?: LoginTypes;
18
44
  setCurrentLoginType: (newLoginType: LoginTypes) => void;
19
- onUidLoginSuccess?: (data: any) => void;
20
- onPhoneLoginSuccess?: ((data: PhoneLoginResponse) => void) | ((data: PhoneLoginResponse) => Promise<void>);
21
- onAccountLoginSuccess?: (data: PhoneLoginResponse) => void;
22
- onLoginSuccess?: (data: any) => void;
45
+ onUidLoginSuccess?: (data: CallbackLoginData) => void;
46
+ onPhoneLoginSuccess?: ((data: CallbackLoginData) => void) | ((data: CallbackLoginData) => Promise<void>);
47
+ onAccountLoginSuccess?: (data: CallbackLoginData) => void;
48
+ onLoginSuccess?: (data: CallbackLoginData) => void;
23
49
  onLoginError?: (error: any) => void;
24
50
  closeable?: boolean;
25
51
  uidLoginConfig?: {
@@ -47,10 +73,11 @@ declare interface ConfigProviderProps {
47
73
 
48
74
  export declare function Login({ open, onOpenChange, sceneId, onPhoneLoginSuccess, onAccountLoginSuccess, onUidLoginSuccess, onLoginSuccess, onLoginError, closeable, mountToaster, toastConfigs, ...props }: Props): JSX.Element;
49
75
 
50
- export declare function login({ loginTypes, gameId, onLoginSuccess, onLoginError, }: {
76
+ export declare function login({ loginTypes, defaultLoginType, gameId, onLoginSuccess, onLoginError, }: {
51
77
  loginTypes?: LoginTypes[];
78
+ defaultLoginType?: LoginTypes;
52
79
  gameId: string;
53
- onLoginSuccess?: (data: any) => void;
80
+ onLoginSuccess?: (data: CallbackLoginData) => void;
54
81
  onLoginError?: (error: any) => void;
55
82
  }): {
56
83
  close: () => void;
@@ -124,8 +151,8 @@ export declare interface PhoneLoginResponse {
124
151
  declare interface Props extends Omit<ConfigContextType, 'setCurrentLoginType' | 'setIsShowGiantLogo' | 'isShowGiantLogo' | 'autoLoginConfig'> {
125
152
  open?: boolean;
126
153
  onOpenChange?: (open: boolean) => void;
127
- onPhoneLoginSuccess?: (data: PhoneLoginResponse) => void;
128
- onAccountLoginSuccess?: (data: PhoneLoginResponse) => void;
154
+ onPhoneLoginSuccess?: (data: CallbackLoginData_2) => void;
155
+ onAccountLoginSuccess?: (data: CallbackLoginData_2) => void;
129
156
  sceneId?: number;
130
157
  onUidLoginSuccess?: (data: any) => void;
131
158
  onLoginSuccess?: (data: any) => void;