react-toolkits 0.4.4 → 0.5.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.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/lib/immer-BLf7GM7E.chunk.js +459 -0
- package/lib/index-2yXDMFsB.chunk.js +212 -0
- package/lib/index-46YNBewp.chunk.js +170 -0
- package/lib/index-GnoTyQLT.chunk.js +1448 -0
- package/lib/index-MckNf-V8.chunk.js +179 -0
- package/lib/index-SypqQFGs.chunk.js +380 -0
- package/lib/index-ZZXzToVD.chunk.js +29 -0
- package/lib/index-dETo--R9.chunk.js +39 -0
- package/lib/index-eh8cxTQW.chunk.js +187 -0
- package/lib/index-gdaNSPz6.chunk.js +15895 -0
- package/lib/{index.d.mts → index.d.ts} +407 -360
- package/lib/index.js +35 -27
- package/lib/style.css +1 -0
- package/locales/{index-Xn8Uwe6G.d.mts → en_GB.d.ts} +90 -87
- package/locales/en_GB.js +88 -5
- package/locales/ja_JP.d.ts +90 -0
- package/locales/ja_JP.js +88 -5
- package/locales/ko_KR.d.ts +90 -0
- package/locales/ko_KR.js +88 -5
- package/locales/zh_CN.d.ts +90 -0
- package/locales/zh_CN.js +88 -5
- package/package.json +25 -20
- package/lib/index.css +0 -2
- package/lib/index.css.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/logo-L6MFCL6M.png +0 -0
- package/locales/en_GB.d.mts +0 -5
- package/locales/en_GB.js.map +0 -1
- package/locales/ja_JP.d.mts +0 -5
- package/locales/ja_JP.js.map +0 -1
- package/locales/ko_KR.d.mts +0 -5
- package/locales/ko_KR.js.map +0 -1
- package/locales/zh_CN.d.mts +0 -5
- package/locales/zh_CN.js.map +0 -1
|
@@ -1,360 +1,407 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { MenuDividerType
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { MutatorCallback
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
type
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
code
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
declare
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
declare
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
declare
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
};
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
declare function
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
1
|
+
import type { ButtonProps } from 'antd';
|
|
2
|
+
import type { FC } from 'react';
|
|
3
|
+
import type { FormInstance } from 'antd';
|
|
4
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
5
|
+
import type { Key } from 'react';
|
|
6
|
+
import type { MenuDividerType } from 'antd/es/menu/hooks/useItems';
|
|
7
|
+
import type { MenuItemGroupType } from 'antd/es/menu/hooks/useItems';
|
|
8
|
+
import type { MenuItemType } from 'antd/es/menu/hooks/useItems';
|
|
9
|
+
import type { Merge } from 'ts-essentials';
|
|
10
|
+
import type { ModalFuncProps } from 'antd';
|
|
11
|
+
import type { MutatorCallback } from 'swr/_internal';
|
|
12
|
+
import type { MutatorOptions } from 'swr/_internal';
|
|
13
|
+
import { NamedExoticComponent } from 'react';
|
|
14
|
+
import type { NamePath } from 'antd/es/form/interface';
|
|
15
|
+
import { PersistOptions } from 'zustand/middleware';
|
|
16
|
+
import type { PropsWithChildren } from 'react';
|
|
17
|
+
import type { ReactElement } from 'react';
|
|
18
|
+
import type { ReactNode } from 'react';
|
|
19
|
+
import type { Ref } from 'react';
|
|
20
|
+
import type { StateStorage } from 'zustand/middleware';
|
|
21
|
+
import { StoreApi } from 'zustand';
|
|
22
|
+
import type { SubMenuType } from 'antd/es/menu/hooks/useItems';
|
|
23
|
+
import type { TableProps } from 'antd/es/table';
|
|
24
|
+
import { UseBoundStore } from 'zustand';
|
|
25
|
+
|
|
26
|
+
export declare const ContextProvider: FC<PropsWithChildren<Partial<ContextState>>>;
|
|
27
|
+
|
|
28
|
+
export declare interface ContextState {
|
|
29
|
+
title: string;
|
|
30
|
+
menuItems: NavMenuItem[];
|
|
31
|
+
hideGameSelect: boolean;
|
|
32
|
+
usePermissionApiV2: boolean;
|
|
33
|
+
gameFilter?: (game: Game) => boolean;
|
|
34
|
+
locale?: Locale;
|
|
35
|
+
localeDropdownMenu?: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare const contextStore: StoreApi<ContextState>;
|
|
39
|
+
|
|
40
|
+
export declare const DynamicTags: FC<DynamicTagsProps>;
|
|
41
|
+
|
|
42
|
+
export declare interface DynamicTagsProps {
|
|
43
|
+
initialTags?: string[];
|
|
44
|
+
addable?: boolean;
|
|
45
|
+
removable?: boolean;
|
|
46
|
+
addCallback?: (addedTag: string) => Promise<boolean>;
|
|
47
|
+
removeCallback?: (removedTag: string) => Promise<boolean>;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export declare const FilterFormWrapper: (props: FilterFormWrapperProps) => JSX_2.Element;
|
|
51
|
+
|
|
52
|
+
export declare interface FilterFormWrapperProps extends PropsWithChildren {
|
|
53
|
+
confirmText?: ReactNode;
|
|
54
|
+
onConfirm?: () => void | Promise<void>;
|
|
55
|
+
onReset?: () => void;
|
|
56
|
+
extras?: {
|
|
57
|
+
key: Key;
|
|
58
|
+
children: ReactNode;
|
|
59
|
+
}[];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export declare interface Game {
|
|
63
|
+
id: string;
|
|
64
|
+
name: string;
|
|
65
|
+
area: 'cn' | 'global';
|
|
66
|
+
Ctime: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare const GameSelect: () => JSX_2.Element;
|
|
70
|
+
|
|
71
|
+
export declare interface GameState {
|
|
72
|
+
game: Game | null;
|
|
73
|
+
setGame: (game: Game | null) => void;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export declare const Highlight: (props: HighlightTextsProps) => JSX_2.Element;
|
|
77
|
+
|
|
78
|
+
export declare interface HighlightTextsProps extends PropsWithChildren {
|
|
79
|
+
texts: Array<string | number>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export declare const InfiniteList: <Item extends object, Values extends object | undefined = undefined, Response_1 = any>(props: InfiniteListProps<Item, Values, Response_1>) => JSX_2.Element;
|
|
83
|
+
|
|
84
|
+
declare interface InfiniteListExtra<Values> {
|
|
85
|
+
key: Key;
|
|
86
|
+
children: ReactNode | ((form: FormInstance<Values>) => ReactNode);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export declare interface InfiniteListProps<Item, Values, Response> extends Pick<TableProps<Item>, 'columns' | 'rowKey' | 'tableLayout' | 'expandable' | 'rowSelection' | 'bordered'> {
|
|
90
|
+
url: string;
|
|
91
|
+
getRowKey: (response: Response) => any;
|
|
92
|
+
getDataSource: (data: Response[] | undefined) => Item[];
|
|
93
|
+
code?: string;
|
|
94
|
+
headers?: Record<string, string> | ((form: FormInstance<Values>) => Record<string, string>);
|
|
95
|
+
renderForm?: (form: FormInstance<Values>) => ReactNode;
|
|
96
|
+
transformArg: (values: Values | undefined, rowKey?: string) => Record<any, any>;
|
|
97
|
+
hasMore?: (data: Response[] | undefined) => boolean;
|
|
98
|
+
isGlobalNS?: boolean;
|
|
99
|
+
extras?: InfiniteListExtra<Values>[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
declare type Join<K, P> = K extends string | number ? P extends string | number ? `${K}${'' extends P ? '' : '.'}${P}` : never : never;
|
|
103
|
+
|
|
104
|
+
export declare const Layout: FC<LayoutProps>;
|
|
105
|
+
|
|
106
|
+
export declare interface LayoutProps extends PropsWithChildren {
|
|
107
|
+
extras?: {
|
|
108
|
+
key: Key;
|
|
109
|
+
children: ReactNode;
|
|
110
|
+
}[];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
declare interface ListResponse<T = any> {
|
|
114
|
+
list: T[];
|
|
115
|
+
total: number;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export declare type Locale = {
|
|
119
|
+
global: {
|
|
120
|
+
noEntitlement: string;
|
|
121
|
+
name: string;
|
|
122
|
+
creationTime: string;
|
|
123
|
+
operation: string;
|
|
124
|
+
update: string;
|
|
125
|
+
edit: string;
|
|
126
|
+
delete: string;
|
|
127
|
+
selectAll: string;
|
|
128
|
+
game: string;
|
|
129
|
+
user: string;
|
|
130
|
+
role: string;
|
|
131
|
+
username: string;
|
|
132
|
+
label: string;
|
|
133
|
+
method: string;
|
|
134
|
+
route: string;
|
|
135
|
+
request: string;
|
|
136
|
+
response: string;
|
|
137
|
+
add: string;
|
|
138
|
+
};
|
|
139
|
+
Login: {
|
|
140
|
+
title: string;
|
|
141
|
+
thirdParty: string;
|
|
142
|
+
loginWithIDass: string;
|
|
143
|
+
notRegistered: string;
|
|
144
|
+
};
|
|
145
|
+
NotFound: {
|
|
146
|
+
subTitle: string;
|
|
147
|
+
buttonText: string;
|
|
148
|
+
};
|
|
149
|
+
FilterFormWrapper: {
|
|
150
|
+
confirmText: string;
|
|
151
|
+
resetText: string;
|
|
152
|
+
};
|
|
153
|
+
FormModal: {
|
|
154
|
+
confirmText: string;
|
|
155
|
+
cancelText: string;
|
|
156
|
+
};
|
|
157
|
+
GameSelect: {
|
|
158
|
+
label: string;
|
|
159
|
+
placeholder: string;
|
|
160
|
+
};
|
|
161
|
+
RequireGame: {
|
|
162
|
+
description: string;
|
|
163
|
+
};
|
|
164
|
+
UserWidget: {
|
|
165
|
+
signOutText: string;
|
|
166
|
+
};
|
|
167
|
+
UserList: {
|
|
168
|
+
createTitle: string;
|
|
169
|
+
createSuccessfully: string;
|
|
170
|
+
updateTitle: string;
|
|
171
|
+
updateSuccessfully: string;
|
|
172
|
+
deleteTitle: string;
|
|
173
|
+
deleteContent: string;
|
|
174
|
+
deleteSuccessfully: string;
|
|
175
|
+
};
|
|
176
|
+
RoleList: {
|
|
177
|
+
createTitle: string;
|
|
178
|
+
createSuccessfully: string;
|
|
179
|
+
updateTitle: string;
|
|
180
|
+
updateSuccessfully: string;
|
|
181
|
+
deleteTitle: string;
|
|
182
|
+
deleteContent: string;
|
|
183
|
+
deleteSuccessfully: string;
|
|
184
|
+
};
|
|
185
|
+
PermissionList: {
|
|
186
|
+
failedDescription: string;
|
|
187
|
+
baseSectionTitle: string;
|
|
188
|
+
gameSectionTitle: string;
|
|
189
|
+
gameSectionDescription: string;
|
|
190
|
+
gameSelectPlaceholder: string;
|
|
191
|
+
removeText: string;
|
|
192
|
+
addText: string;
|
|
193
|
+
};
|
|
194
|
+
RoleDetail: {
|
|
195
|
+
title: string;
|
|
196
|
+
};
|
|
197
|
+
InfiniteList: {
|
|
198
|
+
loadingText: string;
|
|
199
|
+
reachEndText: string;
|
|
200
|
+
loadMoreText: string;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
declare type MenuItemGroupType2 = Merge<MenuItemGroupType, {
|
|
205
|
+
children?: NavMenuItem[];
|
|
206
|
+
}>;
|
|
207
|
+
|
|
208
|
+
declare type MenuItemType2 = Merge<MenuItemType, {
|
|
209
|
+
code?: string;
|
|
210
|
+
route?: string;
|
|
211
|
+
}>;
|
|
212
|
+
|
|
213
|
+
export declare const mixedStorage: StateStorage;
|
|
214
|
+
|
|
215
|
+
export declare const NavMenu: NamedExoticComponent<object>;
|
|
216
|
+
|
|
217
|
+
export declare type NavMenuItem = MenuItemType2 | SubMenuType2 | MenuItemGroupType2 | MenuDividerType | null;
|
|
218
|
+
|
|
219
|
+
declare type Paths<T, D extends number = 10> = [D] extends [never] ? never : T extends object ? {
|
|
220
|
+
[K in keyof T]-?: K extends string | number ? `${K}` | Join<K, Paths<T[K]>> : never;
|
|
221
|
+
}[keyof T] : '';
|
|
222
|
+
|
|
223
|
+
export declare const PermissionButton: FC<PropsWithChildren<PermissionButtonProps>>;
|
|
224
|
+
|
|
225
|
+
export declare interface PermissionButtonProps extends Omit<ButtonProps, 'disabled'> {
|
|
226
|
+
code: string;
|
|
227
|
+
showLoading?: boolean;
|
|
228
|
+
isGlobalNS?: boolean;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export declare const PermissionGuard: FC<PropsWithChildren<PermissionGuardProps>>;
|
|
232
|
+
|
|
233
|
+
export declare interface PermissionGuardProps {
|
|
234
|
+
code: string;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export declare const QueryList: <Item extends object, Values extends object | undefined, Response_1 = ListResponse<Item>>(props: QueryListProps<Item, Values, Response_1> & {
|
|
238
|
+
ref?: Ref<QueryListRef<Values>> | undefined;
|
|
239
|
+
}) => ReactElement;
|
|
240
|
+
|
|
241
|
+
export declare enum QueryListAction {
|
|
242
|
+
Confirm = "confirm",
|
|
243
|
+
Reset = "reset",
|
|
244
|
+
Jump = "jump",
|
|
245
|
+
Init = "init"
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
declare type QueryListMutator = <T = any>(key: string, payload?: Partial<{
|
|
249
|
+
page: number;
|
|
250
|
+
size: number;
|
|
251
|
+
}>, data?: ListResponse<T> | Promise<ListResponse<T>> | MutatorCallback<ListResponse<T>>, opts?: MutatorOptions<ListResponse<T>>) => void;
|
|
252
|
+
|
|
253
|
+
export declare interface QueryListProps<Item = any, Values = any, Response = any> extends Pick<TableProps<Item>, 'columns' | 'rowKey' | 'tableLayout' | 'expandable' | 'rowSelection' | 'bordered'> {
|
|
254
|
+
url: string;
|
|
255
|
+
renderForm?: (form: FormInstance<Values>) => ReactNode;
|
|
256
|
+
code?: string;
|
|
257
|
+
isGlobalNS?: boolean;
|
|
258
|
+
headers?: Record<string, string> | ((form: FormInstance<Values>) => Record<string, string>);
|
|
259
|
+
transformArg?: (page: number, size: number, values: Values | undefined) => unknown;
|
|
260
|
+
transformResponse?: (response: Response) => ListResponse<Item>;
|
|
261
|
+
afterSuccess?: (response: ListResponse<Item>, action?: QueryListAction) => void;
|
|
262
|
+
confirmText?: ReactNode;
|
|
263
|
+
noPagination?: boolean;
|
|
264
|
+
extra?: (response: Response | undefined, form: FormInstance<Values>) => ReactNode;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare interface QueryListRef<Values = any> {
|
|
268
|
+
form: FormInstance<Values>;
|
|
269
|
+
setFieldValue: (name: NamePath, value: any) => void;
|
|
270
|
+
setFieldsValue: (values: RecursivePartial_2<Values>) => void;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
declare interface QueryListState {
|
|
274
|
+
keyMap: Map<string, string | null>;
|
|
275
|
+
paginationMap: Map<string, {
|
|
276
|
+
page: number;
|
|
277
|
+
size: number;
|
|
278
|
+
}>;
|
|
279
|
+
mutate: QueryListMutator;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare type RecursivePartial<T> = NonNullable<T> extends object ? {
|
|
283
|
+
[P in keyof T]?: NonNullable<T[P]> extends (infer U)[] ? RecursivePartial<U>[] : NonNullable<T[P]> extends object ? RecursivePartial<T[P]> : T[P];
|
|
284
|
+
} : T;
|
|
285
|
+
|
|
286
|
+
declare type RecursivePartial_2<T> = NonNullable<T> extends object ? {
|
|
287
|
+
[P in keyof T]?: NonNullable<T[P]> extends (infer U)[] ? RecursivePartial_2<U>[] : NonNullable<T[P]> extends object ? RecursivePartial_2<T[P]> : T[P];
|
|
288
|
+
} : T;
|
|
289
|
+
|
|
290
|
+
export declare function request<T = any>(url: string, opts?: RequestOptions): Promise<RequestResponse<T>>;
|
|
291
|
+
|
|
292
|
+
export declare class RequestError extends Error {
|
|
293
|
+
status?: number;
|
|
294
|
+
constructor(opts?: {
|
|
295
|
+
message?: string;
|
|
296
|
+
status?: number;
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
declare interface RequestOptions extends Omit<RequestInit, 'body'> {
|
|
301
|
+
body?: Record<string | number, any> | FormData | null;
|
|
302
|
+
params?: Record<string | number, any> | URLSearchParams | null;
|
|
303
|
+
responseType?: 'json' | 'blob';
|
|
304
|
+
isGlobalNS?: boolean;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
declare type RequestResponse<T> = Pick<Response, 'headers' | 'status' | 'statusText' | 'url'> & {
|
|
308
|
+
data: T;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export declare const RequireGame: FC<PropsWithChildren>;
|
|
312
|
+
|
|
313
|
+
declare type SubMenuType2 = Merge<SubMenuType, {
|
|
314
|
+
children?: NavMenuItem[];
|
|
315
|
+
}>;
|
|
316
|
+
|
|
317
|
+
export declare interface TokenState {
|
|
318
|
+
token: string;
|
|
319
|
+
getUser: () => UserInfo | null;
|
|
320
|
+
setToken: (token: string) => void;
|
|
321
|
+
clearToken: () => void;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export declare function useFormModal<Values>(props: UseFormModalProps<Values>): {
|
|
325
|
+
show: (scopedProps?: Partial<Pick<UseFormModalProps<Values>, 'title'> & {
|
|
326
|
+
initialValues?: RecursivePartial<Values>;
|
|
327
|
+
extraValues?: any;
|
|
328
|
+
}>) => {
|
|
329
|
+
destroy: () => void;
|
|
330
|
+
update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
|
|
331
|
+
} & {
|
|
332
|
+
then<T>(resolve: (confirmed: boolean) => T, reject: VoidFunction): Promise<T>;
|
|
333
|
+
};
|
|
334
|
+
form: FormInstance<Values>;
|
|
335
|
+
contextHolder: JSX_2.Element;
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export declare interface UseFormModalProps<Values> extends Omit<ModalFuncProps, 'icon' | 'className' | 'content' | 'type' | 'onOk' | 'onCancel'> {
|
|
339
|
+
content?: (form: FormInstance<Values>) => ReactNode;
|
|
340
|
+
onConfirm?: (values: Values, form: FormInstance<Values>, extraValues: any) => Promise<void>;
|
|
341
|
+
onCancel?: (form: FormInstance<Values>) => void;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
export declare const useGameStore: UseBoundStore<Omit<StoreApi<GameState>, "persist"> & {
|
|
345
|
+
persist: {
|
|
346
|
+
setOptions: (options: Partial<PersistOptions<GameState, unknown>>) => void;
|
|
347
|
+
clearStorage: () => void;
|
|
348
|
+
rehydrate: () => void | Promise<void>;
|
|
349
|
+
hasHydrated: () => boolean;
|
|
350
|
+
onHydrate: (fn: (state: GameState) => void) => () => void;
|
|
351
|
+
onFinishHydration: (fn: (state: GameState) => void) => () => void;
|
|
352
|
+
getOptions: () => Partial<PersistOptions<GameState, unknown>>;
|
|
353
|
+
};
|
|
354
|
+
}>;
|
|
355
|
+
|
|
356
|
+
export declare function usePermission(code: string | undefined, opts?: {
|
|
357
|
+
isGlobalNS?: boolean;
|
|
358
|
+
suspense?: boolean;
|
|
359
|
+
}): {
|
|
360
|
+
accessible: boolean;
|
|
361
|
+
isValidating: boolean;
|
|
362
|
+
isLoading: boolean;
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
export declare function usePermissions(codes: string[], opts?: {
|
|
366
|
+
isGlobalNS?: boolean;
|
|
367
|
+
suspense?: boolean;
|
|
368
|
+
}): {
|
|
369
|
+
data: Record<string, boolean> | undefined;
|
|
370
|
+
isValidating: boolean;
|
|
371
|
+
isLoading: boolean;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
export declare const useQueryListStore: UseBoundStore<StoreApi<QueryListState>>;
|
|
375
|
+
|
|
376
|
+
declare interface UserInfo {
|
|
377
|
+
authorityId: string;
|
|
378
|
+
exp: number;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
export declare const UserWidget: FC;
|
|
382
|
+
|
|
383
|
+
export declare const useTokenStore: UseBoundStore<Omit<StoreApi<TokenState>, "persist"> & {
|
|
384
|
+
persist: {
|
|
385
|
+
setOptions: (options: Partial<PersistOptions<TokenState, {
|
|
386
|
+
token: string;
|
|
387
|
+
}>>) => void;
|
|
388
|
+
clearStorage: () => void;
|
|
389
|
+
rehydrate: () => void | Promise<void>;
|
|
390
|
+
hasHydrated: () => boolean;
|
|
391
|
+
onHydrate: (fn: (state: TokenState) => void) => () => void;
|
|
392
|
+
onFinishHydration: (fn: (state: TokenState) => void) => () => void;
|
|
393
|
+
getOptions: () => Partial<PersistOptions<TokenState, {
|
|
394
|
+
token: string;
|
|
395
|
+
}>>;
|
|
396
|
+
};
|
|
397
|
+
}>;
|
|
398
|
+
|
|
399
|
+
export declare function useToolkitsContext(): ContextState;
|
|
400
|
+
|
|
401
|
+
export declare function useTranslation(): (key: Paths<Locale>, data?: Record<string, unknown>) => string;
|
|
402
|
+
|
|
403
|
+
export declare function useValidateToken(skip: boolean): void;
|
|
404
|
+
|
|
405
|
+
export declare function withBaseRoutes(routes: ReactNode, props?: Partial<Omit<ContextState, 'hideGameSelect'>>): () => JSX_2.Element;
|
|
406
|
+
|
|
407
|
+
export { }
|