@pawover/kit 0.0.0-beta.23 → 0.0.0-beta.24

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.
@@ -1,7 +1,18 @@
1
+ import { t as Except } from "./except-MacUK44u.js";
1
2
  import * as alova_client0 from "alova/client";
2
- import { AlovaFrontMiddlewareContext, AlovaMethodHandler, CompleteHandler, ErrorHandler, RequestHookConfig, SuccessHandler, WatcherHookConfig } from "alova/client";
3
+ import { AlovaFrontMiddleware, AlovaFrontMiddlewareContext, AlovaMethodHandler, CompleteHandler, ErrorHandler, PaginationHookConfig, RequestHookConfig, SuccessHandler, WatcherHookConfig } from "alova/client";
3
4
  import { AlovaGenerics, Method } from "alova";
4
5
 
6
+ //#region src/hooks/alova/useAlovaPagination.d.ts
7
+ interface HookConfig$2<AG extends AlovaGenerics, L extends any[], Args extends any[]> extends Except<PaginationHookConfig<AG, L>, "middleware"> {
8
+ middleware?: AlovaFrontMiddleware<AG, Args> | undefined;
9
+ onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void) | undefined;
10
+ onSuccess?: SuccessHandler<AG, Args> | undefined;
11
+ onError?: ErrorHandler<AG, Args> | undefined;
12
+ onComplete?: CompleteHandler<AG, Args> | undefined;
13
+ }
14
+ declare function useAlovaPagination<AG extends AlovaGenerics, L extends any[], Args extends any[]>(methodHandler: (page: number, pageSize: number, ...args: Args) => Method<AG>, hookConfig?: HookConfig$2<AG, L, Args> | undefined): alova_client0.UsePaginationExposure<AG, L, Args>;
15
+ //#endregion
5
16
  //#region src/hooks/alova/useAlovaRequest.d.ts
6
17
  interface HookConfig$1<AG extends AlovaGenerics, Args extends any[]> extends RequestHookConfig<AG, Args> {
7
18
  onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void) | undefined;
@@ -19,5 +30,5 @@ interface HookConfig<AG extends AlovaGenerics, Args extends any[]> extends Watch
19
30
  }
20
31
  declare function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]>(methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>, watchingStates: AG["StatesExport"]["Watched"][], hookConfig?: HookConfig<AG, Args>): alova_client0.UseHookExposure<AG, Args, unknown>;
21
32
  //#endregion
22
- export { useAlovaRequest, useAlovaWatcher };
33
+ export { useAlovaPagination, useAlovaRequest, useAlovaWatcher };
23
34
  //# sourceMappingURL=hooks-alova.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-alova.d.ts","names":[],"sources":["../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"sourcesContent":[],"mappings":";;;;;UAaU,wBAAsB,2CAA2C,kBAAkB,IAAI;+BAClE,4BAA4B,IAAI;cACjD,eAAe,IAAI;EAFvB,OAAA,CAAA,EAGE,YAHQ,CAGK,EAHL,EAGS,IAHT,CAAA,GAAA,SAAA;EAAY,UAAA,CAAA,EAIjB,eAJiB,CAID,EAJC,EAIG,IAJH,CAAA,GAAA,SAAA;;AAAiE,iBAOjF,eAPiF,CAAA,WAOtD,aAPsD,EAAA,aAAA,GAAA,EAAA,GAAA,GAAA,EAAA,CAAA,CAAA,aAAA,EAQhF,MARgF,CAQzE,EARyE,CAAA,GAQnE,kBARmE,CAQhD,EARgD,EAQ5C,IAR4C,CAAA,EAAA,UAAA,CAAA,EASlF,YATkF,CASvE,EATuE,EASnE,IATmE,CAAA,GAAA,SAAA,CAAA,EASlD,aAAA,CAAA,eATkD,CASlD,EATkD,EASlD,IATkD,EAAA,OAAA,CAAA;;;UCDvF,sBAAsB,2CAA2C,kBAAkB,IAAI;cACnF,eAAe,IAAI;YACrB,aAAa,IAAI;EDDnB,UAAA,CAAA,ECEK,eDFK,CCEW,EDFX,ECEe,IDFf,CAAA,GAAA,SAAA;;AAAyE,iBCK7E,eDL6E,CAAA,WCKlD,aDLkD,EAAA,aAAA,GAAA,EAAA,GAAA,GAAA,EAAA,CAAA,CAAA,aAAA,ECM5E,MDN4E,CCMrE,EDNqE,CAAA,GCM/D,kBDN+D,CCM5C,EDN4C,ECMxC,IDNwC,CAAA,EAAA,cAAA,ECO3E,EDP2E,CAAA,cAAA,CAAA,CAAA,SAAA,CAAA,EAAA,EAAA,UAAA,CAAA,ECQ/E,UDR+E,CCQpE,EDRoE,ECQhE,IDRgE,CAAA,CAAA,ECQtD,aAAA,CAAA,eDRsD,CCQtD,EDRsD,ECQtD,IDRsD,EAAA,OAAA,CAAA"}
1
+ {"version":3,"file":"hooks-alova.d.ts","names":[],"sources":["../src/hooks/alova/useAlovaPagination.ts","../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"sourcesContent":[],"mappings":";;;;;;UAeU,wBAAsB,4DAA4D,OAAO,qBAAqB,IAAI;eAC7G,qBAAqB,IAAI;+BACT,4BAA4B,IAAI;EAFrD,SAAA,CAAA,EAGI,cAHM,CAGS,EAHT,EAGa,IAHb,CAAA,GAAA,SAAA;EAAY,OAAA,CAAA,EAIpB,YAJoB,CAIP,EAJO,EAIH,IAJG,CAAA,GAAA,SAAA;EAAwF,UAAA,CAAA,EAKzG,eALyG,CAKzF,EALyF,EAKrF,IALqF,CAAA,GAAA,SAAA;;AAArB,iBAQnF,kBARmF,CAAA,WAQrD,aARqD,EAAA,UAAA,GAAA,EAAA,EAAA,aAAA,GAAA,EAAA,CAAA,CAAA,aAAA,EAAA,CAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,GAAA,IAAA,EASxC,IATwC,EAAA,GAS/B,MAT+B,CASxB,EATwB,CAAA,EAAA,UAAA,CAAA,EAUpF,YAVoF,CAUzE,EAVyE,EAUrE,CAVqE,EAUlE,IAVkE,CAAA,GAAA,SAAA,CAAA,EAUjD,aAAA,CAAA,qBAViD,CAUjD,EAViD,EAUjD,CAViD,EAUjD,IAViD,CAAA;;;UCFzF,wBAAsB,2CAA2C,kBAAkB,IAAI;+BAClE,4BAA4B,IAAI;cACjD,eAAe,IAAI;YACrB,aAAa,IAAI;EDDnB,UAAA,CAAA,ECEK,eDFK,CCEW,EDFX,ECEe,IDFf,CAAA,GAAA,SAAA;;AAAoG,iBCKxG,eDLwG,CAAA,WCK7E,aDL6E,EAAA,aAAA,GAAA,EAAA,GAAA,GAAA,EAAA,CAAA,CAAA,aAAA,ECMvG,MDNuG,CCMhG,EDNgG,CAAA,GCM1F,kBDN0F,CCMvE,EDNuE,ECMnE,IDNmE,CAAA,EAAA,UAAA,CAAA,ECOzG,YDPyG,CCO9F,EDP8F,ECO1F,IDP0F,CAAA,GAAA,SAAA,CAAA,ECOzE,aAAA,CAAA,eDPyE,CCOzE,EDPyE,ECOzE,IDPyE,EAAA,OAAA,CAAA;;;UEH9G,sBAAsB,2CAA2C,kBAAkB,IAAI;cACnF,eAAe,IAAI;YACrB,aAAa,IAAI;eACd,gBAAgB,IAAI;AFHK;AAGR,iBEGhB,eFHgB,CAAA,WEGW,aFHX,EAAA,aAAA,GAAA,EAAA,GAAA,GAAA,EAAA,CAAA,CAAA,aAAA,EEIf,MFJe,CEIR,EFJQ,CAAA,GEIF,kBFJE,CEIiB,EFJjB,EEIqB,IFJrB,CAAA,EAAA,cAAA,EEKd,EFLc,CAAA,cAAA,CAAA,CAAA,SAAA,CAAA,EAAA,EAAA,UAAA,CAAA,EEMlB,UFNkB,CEMP,EFNO,EEMH,IFNG,CAAA,CAAA,EEMO,aAAA,CAAA,eFNP,CEMO,EFNP,EEMO,IFNP,EAAA,OAAA,CAAA"}
@@ -1,5 +1,29 @@
1
- import { useRequest, useWatcher } from "alova/client";
1
+ import { usePagination, useRequest, useWatcher } from "alova/client";
2
2
 
3
+ //#region src/hooks/alova/useAlovaPagination.ts
4
+ function useAlovaPagination(methodHandler, hookConfig) {
5
+ const config = hookConfig || {};
6
+ config.immediate ?? (config.immediate = true);
7
+ if (config.onBeforeRequest) {
8
+ const middleware = config.middleware;
9
+ config.middleware = async (context, next) => {
10
+ config.onBeforeRequest?.(context);
11
+ if (middleware) {
12
+ async function run() {
13
+ await next();
14
+ }
15
+ await middleware?.(context, run);
16
+ } else await next();
17
+ };
18
+ }
19
+ const exposure = usePagination(methodHandler, hookConfig);
20
+ if (config.onSuccess) exposure.onSuccess(config.onSuccess);
21
+ if (config.onError) exposure.onError(config.onError);
22
+ if (config.onComplete) exposure.onComplete(config.onComplete);
23
+ return exposure;
24
+ }
25
+
26
+ //#endregion
3
27
  //#region src/hooks/alova/useAlovaRequest.ts
4
28
  function useAlovaRequest(methodHandler, hookConfig) {
5
29
  const config = hookConfig || {};
@@ -35,5 +59,5 @@ function useAlovaWatcher(methodHandler, watchingStates, hookConfig = {}) {
35
59
  }
36
60
 
37
61
  //#endregion
38
- export { useAlovaRequest, useAlovaWatcher };
62
+ export { useAlovaPagination, useAlovaRequest, useAlovaWatcher };
39
63
  //# sourceMappingURL=hooks-alova.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-alova.js","names":[],"sources":["../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaFrontMiddlewareContext,\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type RequestHookConfig,\n type SuccessHandler,\n useRequest,\n} from \"alova/client\";\n\ninterface HookConfig<AG extends AlovaGenerics, Args extends any[]> extends RequestHookConfig<AG, Args> {\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void)|undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaRequest<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n hookConfig?: HookConfig<AG, Args> | undefined,\n) {\n const config = hookConfig || {};\n config.immediate ??= true;\n\n if (config.onBeforeRequest) {\n const middleware = config.middleware;\n config.middleware = async (context, next) => {\n config.onBeforeRequest?.(context);\n\n if (middleware) {\n async function run () {\n await next();\n }\n await middleware?.(context, run);\n } else {\n await next();\n }\n };\n }\n\n const exposure = useRequest(methodHandler, config);\n\n if (config.onSuccess) {\n exposure.onSuccess(config.onSuccess);\n }\n if (config.onError) {\n exposure.onError(config.onError);\n }\n if (config.onComplete) {\n exposure.onComplete(config.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type SuccessHandler,\n type WatcherHookConfig,\n useWatcher,\n} from \"alova/client\";\n\ninterface HookConfig<AG extends AlovaGenerics, Args extends any[]> extends WatcherHookConfig<AG, Args> {\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n watchingStates: AG[\"StatesExport\"][\"Watched\"][],\n hookConfig: HookConfig<AG, Args> = {},\n) {\n const config = hookConfig || {};\n const exposure = useWatcher(methodHandler, watchingStates, config);\n\n if (config.onSuccess) {\n exposure.onSuccess(config.onSuccess);\n }\n if (config.onError) {\n exposure.onError(config.onError);\n }\n if (config.onComplete) {\n exposure.onComplete(config.onComplete);\n }\n\n return exposure;\n}\n"],"mappings":";;;AAoBA,SAAgB,gBACd,eACA,YACA;CACA,MAAM,SAAS,cAAc,EAAE;AAC/B,QAAO,cAAP,OAAO,YAAc;AAErB,KAAI,OAAO,iBAAiB;EAC1B,MAAM,aAAa,OAAO;AAC1B,SAAO,aAAa,OAAO,SAAS,SAAS;AAC3C,UAAO,kBAAkB,QAAQ;AAEjC,OAAI,YAAY;IACd,eAAe,MAAO;AACpB,WAAM,MAAM;;AAEd,UAAM,aAAa,SAAS,IAAI;SAEhC,OAAM,MAAM;;;CAKlB,MAAM,WAAW,WAAW,eAAe,OAAO;AAElD,KAAI,OAAO,UACT,UAAS,UAAU,OAAO,UAAU;AAEtC,KAAI,OAAO,QACT,UAAS,QAAQ,OAAO,QAAQ;AAElC,KAAI,OAAO,WACT,UAAS,WAAW,OAAO,WAAW;AAGxC,QAAO;;;;;ACrCT,SAAgB,gBACd,eACA,gBACA,aAAmC,EAAE,EACrC;CACA,MAAM,SAAS,cAAc,EAAE;CAC/B,MAAM,WAAW,WAAW,eAAe,gBAAgB,OAAO;AAElE,KAAI,OAAO,UACT,UAAS,UAAU,OAAO,UAAU;AAEtC,KAAI,OAAO,QACT,UAAS,QAAQ,OAAO,QAAQ;AAElC,KAAI,OAAO,WACT,UAAS,WAAW,OAAO,WAAW;AAGxC,QAAO"}
1
+ {"version":3,"file":"hooks-alova.js","names":[],"sources":["../src/hooks/alova/useAlovaPagination.ts","../src/hooks/alova/useAlovaRequest.ts","../src/hooks/alova/useAlovaWatcher.ts"],"sourcesContent":["/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n usePagination,\n type AlovaFrontMiddleware,\n type AlovaFrontMiddlewareContext,\n type CompleteHandler,\n type ErrorHandler,\n type PaginationHookConfig,\n type SuccessHandler,\n} from \"alova/client\";\nimport type { Except } from \"type-fest\";\n\n\ninterface HookConfig<AG extends AlovaGenerics, L extends any[], Args extends any[]> extends Except<PaginationHookConfig<AG, L>, \"middleware\"> {\n middleware?: AlovaFrontMiddleware<AG, Args> | undefined;\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void) | undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaPagination<AG extends AlovaGenerics, L extends any[], Args extends any[]> (\n methodHandler: (page: number, pageSize: number, ...args: Args) => Method<AG>,\n hookConfig?: HookConfig<AG, L, Args> | undefined,\n) {\n const config = hookConfig || {};\n config.immediate ??= true;\n\n if (config.onBeforeRequest) {\n const middleware = config.middleware;\n config.middleware = async (context, next) => {\n config.onBeforeRequest?.(context);\n\n if (middleware) {\n async function run () {\n await next();\n }\n await middleware?.(context, run);\n } else {\n await next();\n }\n };\n }\n\n const exposure = usePagination(methodHandler, hookConfig as PaginationHookConfig<AG, L>);\n\n if (config.onSuccess) {\n exposure.onSuccess(config.onSuccess);\n }\n if (config.onError) {\n exposure.onError(config.onError);\n }\n if (config.onComplete) {\n exposure.onComplete(config.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaFrontMiddlewareContext,\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type RequestHookConfig,\n type SuccessHandler,\n useRequest,\n} from \"alova/client\";\n\ninterface HookConfig<AG extends AlovaGenerics, Args extends any[]> extends RequestHookConfig<AG, Args> {\n onBeforeRequest?: ((context: AlovaFrontMiddlewareContext<AG, Args>) => void)|undefined;\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaRequest<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n hookConfig?: HookConfig<AG, Args> | undefined,\n) {\n const config = hookConfig || {};\n config.immediate ??= true;\n\n if (config.onBeforeRequest) {\n const middleware = config.middleware;\n config.middleware = async (context, next) => {\n config.onBeforeRequest?.(context);\n\n if (middleware) {\n async function run () {\n await next();\n }\n await middleware?.(context, run);\n } else {\n await next();\n }\n };\n }\n\n const exposure = useRequest(methodHandler, config);\n\n if (config.onSuccess) {\n exposure.onSuccess(config.onSuccess);\n }\n if (config.onError) {\n exposure.onError(config.onError);\n }\n if (config.onComplete) {\n exposure.onComplete(config.onComplete);\n }\n\n return exposure;\n}\n","/* eslint-disable ts/no-explicit-any */\n\nimport type { AlovaGenerics, Method } from \"alova\";\nimport {\n type AlovaMethodHandler,\n type CompleteHandler,\n type ErrorHandler,\n type SuccessHandler,\n type WatcherHookConfig,\n useWatcher,\n} from \"alova/client\";\n\ninterface HookConfig<AG extends AlovaGenerics, Args extends any[]> extends WatcherHookConfig<AG, Args> {\n onSuccess?: SuccessHandler<AG, Args> | undefined;\n onError?: ErrorHandler<AG, Args> | undefined;\n onComplete?: CompleteHandler<AG, Args> | undefined;\n}\n\nexport function useAlovaWatcher<AG extends AlovaGenerics, Args extends any[] = any[]> (\n methodHandler: Method<AG> | AlovaMethodHandler<AG, Args>,\n watchingStates: AG[\"StatesExport\"][\"Watched\"][],\n hookConfig: HookConfig<AG, Args> = {},\n) {\n const config = hookConfig || {};\n const exposure = useWatcher(methodHandler, watchingStates, config);\n\n if (config.onSuccess) {\n exposure.onSuccess(config.onSuccess);\n }\n if (config.onError) {\n exposure.onError(config.onError);\n }\n if (config.onComplete) {\n exposure.onComplete(config.onComplete);\n }\n\n return exposure;\n}\n"],"mappings":";;;AAuBA,SAAgB,mBACd,eACA,YACA;CACA,MAAM,SAAS,cAAc,EAAE;AAC/B,QAAO,cAAP,OAAO,YAAc;AAErB,KAAI,OAAO,iBAAiB;EAC1B,MAAM,aAAa,OAAO;AAC1B,SAAO,aAAa,OAAO,SAAS,SAAS;AAC3C,UAAO,kBAAkB,QAAQ;AAEjC,OAAI,YAAY;IACd,eAAe,MAAO;AACpB,WAAM,MAAM;;AAEd,UAAM,aAAa,SAAS,IAAI;SAEhC,OAAM,MAAM;;;CAKlB,MAAM,WAAW,cAAc,eAAe,WAA0C;AAExF,KAAI,OAAO,UACT,UAAS,UAAU,OAAO,UAAU;AAEtC,KAAI,OAAO,QACT,UAAS,QAAQ,OAAO,QAAQ;AAElC,KAAI,OAAO,WACT,UAAS,WAAW,OAAO,WAAW;AAGxC,QAAO;;;;;ACtCT,SAAgB,gBACd,eACA,YACA;CACA,MAAM,SAAS,cAAc,EAAE;AAC/B,QAAO,cAAP,OAAO,YAAc;AAErB,KAAI,OAAO,iBAAiB;EAC1B,MAAM,aAAa,OAAO;AAC1B,SAAO,aAAa,OAAO,SAAS,SAAS;AAC3C,UAAO,kBAAkB,QAAQ;AAEjC,OAAI,YAAY;IACd,eAAe,MAAO;AACpB,WAAM,MAAM;;AAEd,UAAM,aAAa,SAAS,IAAI;SAEhC,OAAM,MAAM;;;CAKlB,MAAM,WAAW,WAAW,eAAe,OAAO;AAElD,KAAI,OAAO,UACT,UAAS,UAAU,OAAO,UAAU;AAEtC,KAAI,OAAO,QACT,UAAS,QAAQ,OAAO,QAAQ;AAElC,KAAI,OAAO,WACT,UAAS,WAAW,OAAO,WAAW;AAGxC,QAAO;;;;;ACrCT,SAAgB,gBACd,eACA,gBACA,aAAmC,EAAE,EACrC;CACA,MAAM,SAAS,cAAc,EAAE;CAC/B,MAAM,WAAW,WAAW,eAAe,gBAAgB,OAAO;AAElE,KAAI,OAAO,UACT,UAAS,UAAU,OAAO,UAAU;AAEtC,KAAI,OAAO,QACT,UAAS,QAAQ,OAAO,QAAQ;AAElC,KAAI,OAAO,WACT,UAAS,WAAW,OAAO,WAAW;AAGxC,QAAO"}
@@ -2,27 +2,8 @@ import { r as BREAK_POINT_TOKEN_TYPE } from "./index-CCujFuKP.js";
2
2
  import { r as AnyFunction, t as AnyAsyncFunction } from "./index-BPEx210u.js";
3
3
  import { DependencyList, EffectCallback, RefObject } from "react";
4
4
 
5
- //#region src/hooks/react/useCreation.d.ts
6
-
7
- /**
8
- * useCreation
9
- * @reference https://ahooks.js.org/zh-CN/hooks/use-creation
10
- *
11
- * @param factory
12
- * @param deps
13
- */
14
- declare function useCreation<T>(factory: () => T, deps: DependencyList): T;
15
- //#endregion
16
- //#region src/hooks/react/useLatest.d.ts
17
- /**
18
- * 返回当前最新值的 Hook
19
- * @reference https://ahooks.js.org/zh-CN/hooks/use-latest
20
- *
21
- * @param value
22
- */
23
- declare function useLatest<T>(value: T): RefObject<T>;
24
- //#endregion
25
5
  //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/tuple-to-union.d.ts
6
+
26
7
  /**
27
8
  Convert a tuple/array into a union type of its elements.
28
9
 
@@ -76,6 +57,25 @@ type NumberBool = typeof numberBool[number];
76
57
  */
77
58
  type TupleToUnion<ArrayType> = ArrayType extends readonly unknown[] ? ArrayType[number] : never;
78
59
  //#endregion
60
+ //#region src/hooks/react/useCreation.d.ts
61
+ /**
62
+ * useCreation
63
+ * @reference https://ahooks.js.org/zh-CN/hooks/use-creation
64
+ *
65
+ * @param factory
66
+ * @param deps
67
+ */
68
+ declare function useCreation<T>(factory: () => T, deps: DependencyList): T;
69
+ //#endregion
70
+ //#region src/hooks/react/useLatest.d.ts
71
+ /**
72
+ * 返回当前最新值的 Hook
73
+ * @reference https://ahooks.js.org/zh-CN/hooks/use-latest
74
+ *
75
+ * @param value
76
+ */
77
+ declare function useLatest<T>(value: T): RefObject<T>;
78
+ //#endregion
79
79
  //#region src/hooks/react/useMount.d.ts
80
80
  type MountCallback = EffectCallback | AnyAsyncFunction;
81
81
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-react.d.ts","names":["TupleToUnion","ArrayType"],"sources":["../src/hooks/react/useCreation.ts","../src/hooks/react/useLatest.ts","../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/tuple-to-union.d.ts","../src/hooks/react/useMount.ts","../src/hooks/react/useResponsive.ts","../src/hooks/react/useTitle.ts","../src/hooks/react/useUnmount.ts"],"sourcesContent":["/**\nConvert a tuple/array into a union type of its elements.\n\nThis can be useful when you have a fixed set of allowed values and want a type defining only the allowed values, but do not want to repeat yourself.\n\n@example\n```\nimport type {TupleToUnion} from 'type-fest';\n\nconst destinations = ['a', 'b', 'c'] as const;\n\ntype Destination = TupleToUnion<typeof destinations>;\n//=> 'a' | 'b' | 'c'\n\nfunction verifyDestination(destination: unknown): destination is Destination {\n\treturn destinations.includes(destination as any);\n}\n\ntype RequestBody = {\n\tdeliverTo: Destination;\n};\n\nfunction verifyRequestBody(body: unknown): body is RequestBody {\n\tconst {deliverTo} = (body as any);\n\treturn typeof body === 'object' && body !== null && verifyDestination(deliverTo);\n}\n```\n\nAlternatively, you may use `typeof destinations[number]`. If `destinations` is a tuple, there is no difference. However if `destinations` is a string, the resulting type will the union of the characters in the string. Other types of `destinations` may result in a compile error. In comparison, TupleToUnion will return `never` if a tuple is not provided.\n\n@example\n```\nconst destinations = ['a', 'b', 'c'] as const;\n\ntype Destination = typeof destinations[number];\n//=> 'a' | 'b' | 'c'\n\nconst erroringType = new Set(['a', 'b', 'c']);\n\n// @ts-expect-error\ntype ErroringType = typeof erroringType[number];\n// Error: Type 'Set<string>' has no matching index signature for type 'number'. ts(2537)\n\nconst numberBool: {[n: number]: boolean} = {1: true};\n\ntype NumberBool = typeof numberBool[number];\n//=> boolean\n```\n\n@category Array\n*/\nexport type TupleToUnion<ArrayType> = ArrayType extends readonly unknown[] ? ArrayType[number] : never;\n\nexport {};\n"],"x_google_ignoreList":[2],"mappings":";;;;;;;;;;AAgBA;;;AAAsE,iBAAtD,WAAsD,CAAA,CAAA,CAAA,CAAA,OAAA,EAAA,GAAA,GAAvB,CAAuB,EAAA,IAAA,EAAd,cAAc,CAAA,EAAA,CAAA;;;;;;;AAAtE;;AAAwD,iBCRxC,SDQwC,CAAA,CAAA,CAAA,CAAA,KAAA,ECRnB,CDQmB,CAAA,ECRf,SDQe,CCRL,CDQK,CAAA;;;;;;;;AAAxD;;;;;;;;ACRA;;;;;;;;AC2CA;;;;AClDuD;AAavD;;;;ACX8C;AAEhB;AAGA;AAS9B;AAUA;;;;;;;;;ACpBA;;;;ACIA;;;;KJwCYA,0BAA0BC,uCAAuCA;;;KC9CxE,aAAA,GAAgB,iBAAiB;;;AHWtC;;;;;iBGFgB,QAAA,SAAkB;;;KCT7B,UAAA,GAAa,oBAAoB;KAGjC,gBAAA,GAAmB,OAAO;cAEzB;AJMU,UICC,qBAAA,CJDU;EAAoB;;;;;sBIOzB;;EHfN,gBAAS,CAAA,EGiBJ,sBHjBI;;AAA0B,iBGmBnC,aAAA,CHnBmC,OAAA,CAAA,EGmBV,qBHnBU,CAAA,EAAA;EAAV,UAAA,kBAAA;EAAS,OAAA,EAAA,MAAA,GAAA,KAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA;;;;;;UIJxC,eAAA;;;iBAGM,QAAA,yBAAkC;;;;;;;ALSlD;;AAAwD,iBMLxC,UAAA,CNKwC,MAAA,EMLpB,WNKoB,CAAA,EAAA,IAAA"}
1
+ {"version":3,"file":"hooks-react.d.ts","names":["TupleToUnion","ArrayType"],"sources":["../node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/tuple-to-union.d.ts","../src/hooks/react/useCreation.ts","../src/hooks/react/useLatest.ts","../src/hooks/react/useMount.ts","../src/hooks/react/useResponsive.ts","../src/hooks/react/useTitle.ts","../src/hooks/react/useUnmount.ts"],"sourcesContent":["/**\nConvert a tuple/array into a union type of its elements.\n\nThis can be useful when you have a fixed set of allowed values and want a type defining only the allowed values, but do not want to repeat yourself.\n\n@example\n```\nimport type {TupleToUnion} from 'type-fest';\n\nconst destinations = ['a', 'b', 'c'] as const;\n\ntype Destination = TupleToUnion<typeof destinations>;\n//=> 'a' | 'b' | 'c'\n\nfunction verifyDestination(destination: unknown): destination is Destination {\n\treturn destinations.includes(destination as any);\n}\n\ntype RequestBody = {\n\tdeliverTo: Destination;\n};\n\nfunction verifyRequestBody(body: unknown): body is RequestBody {\n\tconst {deliverTo} = (body as any);\n\treturn typeof body === 'object' && body !== null && verifyDestination(deliverTo);\n}\n```\n\nAlternatively, you may use `typeof destinations[number]`. If `destinations` is a tuple, there is no difference. However if `destinations` is a string, the resulting type will the union of the characters in the string. Other types of `destinations` may result in a compile error. In comparison, TupleToUnion will return `never` if a tuple is not provided.\n\n@example\n```\nconst destinations = ['a', 'b', 'c'] as const;\n\ntype Destination = typeof destinations[number];\n//=> 'a' | 'b' | 'c'\n\nconst erroringType = new Set(['a', 'b', 'c']);\n\n// @ts-expect-error\ntype ErroringType = typeof erroringType[number];\n// Error: Type 'Set<string>' has no matching index signature for type 'number'. ts(2537)\n\nconst numberBool: {[n: number]: boolean} = {1: true};\n\ntype NumberBool = typeof numberBool[number];\n//=> boolean\n```\n\n@category Array\n*/\nexport type TupleToUnion<ArrayType> = ArrayType extends readonly unknown[] ? ArrayType[number] : never;\n\nexport {};\n"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;AAmDA;;;;ACnCA;;;;;;;;ACRA;;;;;;;;ACPuD;AAavD;;;;ACX8C;AAEhB;AAGA;AAS9B;AAUA;;;;;;;;;ACpBA;;;;ACIA;;;;KNwCYA,0BAA0BC,uCAAuCA;;;;;;;AAA7E;;;iBCnCgB,8BAA+B,SAAS,iBAAc;;;;;;;ADmCtE;;iBE3CgB,oBAAqB,IAAI,UAAU;;;KCH9C,aAAA,GAAgB,iBAAiB;;;AH8CtC;;;;ACnCA;AAA+C,iBEF/B,QAAA,CFE+B,MAAA,EEFb,aFEa,CAAA,EAAA,IAAA;;;KGX1C,UAAA,GAAa,oBAAoB;KAGjC,gBAAA,GAAmB,OAAO;cAEzB;AJyCMD,UIlCK,qBAAA,CJkCOC;;;;ACnCxB;;EAAwD,iBAAA,CAAA,EGOlC,UHPkC;EAAc;EAAA,gBAAA,CAAA,EGSjD,sBHTiD;;iBGWtD,aAAA,WAAyB;;EFnBzB,OAAA,EAAA,MAAS,GAAA,KAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA,GAAA,IAAA;EAAY,SAAA,EAAA,OAAA;EAAc,gBAAA,wBAAA;CAAV;;;UGJ/B,eAAA;;;iBAGM,QAAA,yBAAkC;;;;;;;AL4ClD;;iBMxCgB,UAAA,SAAoB"}
package/metadata.json CHANGED
@@ -160,6 +160,7 @@
160
160
  ],
161
161
  "hooks": {
162
162
  "alova": [
163
+ "useAlovaPagination",
163
164
  "useAlovaRequest",
164
165
  "useAlovaWatcher"
165
166
  ],
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "pawover's kit",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.0-beta.23",
7
+ "version": "0.0.0-beta.24",
8
8
  "packageManager": "pnpm@10.28.2",
9
9
  "engines": {
10
10
  "node": ">=22.20.0"