@gup-fe/js-sdk 2.1.2 → 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?: {
@@ -51,7 +77,7 @@ export declare function login({ loginTypes, defaultLoginType, gameId, onLoginSuc
51
77
  loginTypes?: LoginTypes[];
52
78
  defaultLoginType?: LoginTypes;
53
79
  gameId: string;
54
- onLoginSuccess?: (data: any) => void;
80
+ onLoginSuccess?: (data: CallbackLoginData) => void;
55
81
  onLoginError?: (error: any) => void;
56
82
  }): {
57
83
  close: () => void;
@@ -125,8 +151,8 @@ export declare interface PhoneLoginResponse {
125
151
  declare interface Props extends Omit<ConfigContextType, 'setCurrentLoginType' | 'setIsShowGiantLogo' | 'isShowGiantLogo' | 'autoLoginConfig'> {
126
152
  open?: boolean;
127
153
  onOpenChange?: (open: boolean) => void;
128
- onPhoneLoginSuccess?: (data: PhoneLoginResponse) => void;
129
- onAccountLoginSuccess?: (data: PhoneLoginResponse) => void;
154
+ onPhoneLoginSuccess?: (data: CallbackLoginData_2) => void;
155
+ onAccountLoginSuccess?: (data: CallbackLoginData_2) => void;
130
156
  sceneId?: number;
131
157
  onUidLoginSuccess?: (data: any) => void;
132
158
  onLoginSuccess?: (data: any) => void;