react-toolkits 2.31.2 → 2.31.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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +1 -26
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -43,34 +43,9 @@ interface KyMethods {
|
|
|
43
43
|
}
|
|
44
44
|
/** useKy 配置选项 */
|
|
45
45
|
interface UseKyOptions {
|
|
46
|
-
/** 状态码字段配置:字段名 -> 成功码列表 */
|
|
47
|
-
statusFields?: Record<string, readonly number[]>;
|
|
48
|
-
/** 自定义响应成功判断函数 */
|
|
49
|
-
isSuccess?: (data: unknown, status: number) => boolean;
|
|
50
|
-
/** 错误消息字段列表(按优先级) */
|
|
51
|
-
errorFields?: readonly string[];
|
|
52
|
-
/** 自定义错误消息提取函数 */
|
|
53
|
-
extractErrorMessage?: (data: unknown) => string;
|
|
54
|
-
/** 401 未授权处理 */
|
|
55
|
-
onUnauthorized?: (data?: unknown) => void;
|
|
56
|
-
/** 403 禁止访问处理 */
|
|
57
|
-
onForbidden?: (data?: unknown) => void;
|
|
58
|
-
/** 412 未注册处理 */
|
|
59
|
-
onUnregistered?: (data?: unknown) => void;
|
|
60
|
-
/** 其他 HTTP 错误处理 */
|
|
61
|
-
onError?: (status: number, data?: unknown, errorMessage?: string) => void;
|
|
62
|
-
/** 网络错误处理 */
|
|
63
|
-
onNetworkError?: (error: Error) => void;
|
|
64
|
-
/** 是否禁用默认的错误提示 */
|
|
65
|
-
disableDefaultErrorNotification?: boolean;
|
|
66
46
|
/** 自定义 hooks(拦截器) */
|
|
67
47
|
hooks?: Partial<Hooks>;
|
|
68
48
|
}
|
|
69
|
-
/** 导出类型(向后兼容) */
|
|
70
|
-
type BusinessStatusCodeConfig = Pick<UseKyOptions, 'statusFields'>;
|
|
71
|
-
type ErrorMessageConfig = Pick<UseKyOptions, 'errorFields' | 'extractErrorMessage'>;
|
|
72
|
-
type HttpErrorHandlers = Pick<UseKyOptions, 'onUnauthorized' | 'onForbidden' | 'onUnregistered' | 'onError' | 'onNetworkError'>;
|
|
73
|
-
type ResponseValidationConfig = Pick<UseKyOptions, 'isSuccess'>;
|
|
74
49
|
/**
|
|
75
50
|
* Ky HTTP 客户端类
|
|
76
51
|
*/
|
|
@@ -1462,4 +1437,4 @@ declare function useAuth(code?: string | string[], config?: RequestOptions): {
|
|
|
1462
1437
|
declare function useMenuList(): _tanstack_react_query.UseQueryResult<MenuListItem[], Error>;
|
|
1463
1438
|
declare const useGames: () => _tanstack_react_query.UseQueryResult<Game[], Error>;
|
|
1464
1439
|
|
|
1465
|
-
export { APP_ID_HEADER, AuthButton, type AuthButtonProps,
|
|
1440
|
+
export { APP_ID_HEADER, AuthButton, type AuthButtonProps, DynamicTags, type DynamicTagsProps, ExpandableParagraph, type ExpandableParagraphProps, FRONTEND_ROUTE_PREFIX, FilterFormWrapper, type FilterFormWrapperProps, type Game, type GameSelectConfig, type GameSelectProps, type HeaderExtra, type HeaderExtraConfig, Highlight, type HighlightProps, InfiniteList, type InfiniteListDataAdapter, type InfiniteListPayload, type InfiniteListProps, type InfiniteListRef, type InfiniteListRequestConfig, type InfiniteListRequestConfigType, type JsonResponse, KeepAlive, type KeepAliveCacheItem, KeepAliveOutlet, type KeepAliveOutletProps, type KeepAliveProps, KeepAliveProvider, type KeepAliveProviderProps, KyClient, type KyClientOptions, Layout, type LayoutProps, Logo, type LogoProps, type MenuListItem, type NavItem, type NavMenuItemGroupType, type NavMenuItemType, type NavSubMenuType, type NavigationConfig, NotFound, OperationLogList, type PageParam, type Permission, PermissionMode, QueryList, QueryListAction, type QueryListPayload, type QueryListProps, type QueryListRef, type RecursivePartial, type RequestOptions, RequireAuth, type RequireAuthProps, RequireGame, type ResponseType, type RouteMatchRule, SSO_URL, SelectAll, type SelectAllProps, type ShowFormOptions$1 as ShowFormDrawerOptions, type ShowFormOptions as ShowFormModalOptions, SignIn, ToolkitsProvider, type ToolkitsProviderProps, type UseDrawerOperation, type UseDrawerProps, type UseFormDrawerProps, type UseFormDrawerReturn, type UseFormModalProps, type UseFormModalReturn, type UseKeepAliveReturn, type UseKyOptions, type UseModalOperation, type UseModalProps, UserDropdown, type VisibilityState, WILDCARD, createVisibilityStoreConfig, generateId, _default$1 as menuRoutes, mixedStorage, _default as permissionRoutes, useAuth, useDrawer, useDrawerStore, useFormDrawer, useFormModal, useGames, useInfiniteListStore, useKeepAlive, useKeepAliveContext, useMenuList, useModal, useModalStore, useQueryListStore, useToolkitsStore };
|