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

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,5 +1,5 @@
1
- import { r as BREAK_POINT_TOKEN_TYPE } from "./index-BKUSlLXA.js";
2
- import { r as AnyFunction, t as AnyAsyncFunction } from "./index-CjoMz104.js";
1
+ import { r as BREAK_POINT_TOKEN_TYPE } from "./index-CCujFuKP.js";
2
+ import { r as AnyFunction, t as AnyAsyncFunction } from "./index-BPEx210u.js";
3
3
  import { DependencyList, EffectCallback, RefObject } from "react";
4
4
 
5
5
  //#region src/hooks/react/useCreation.d.ts
@@ -22,6 +22,60 @@ declare function useCreation<T>(factory: () => T, deps: DependencyList): T;
22
22
  */
23
23
  declare function useLatest<T>(value: T): RefObject<T>;
24
24
  //#endregion
25
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/tuple-to-union.d.ts
26
+ /**
27
+ Convert a tuple/array into a union type of its elements.
28
+
29
+ This 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.
30
+
31
+ @example
32
+ ```
33
+ import type {TupleToUnion} from 'type-fest';
34
+
35
+ const destinations = ['a', 'b', 'c'] as const;
36
+
37
+ type Destination = TupleToUnion<typeof destinations>;
38
+ //=> 'a' | 'b' | 'c'
39
+
40
+ function verifyDestination(destination: unknown): destination is Destination {
41
+ return destinations.includes(destination as any);
42
+ }
43
+
44
+ type RequestBody = {
45
+ deliverTo: Destination;
46
+ };
47
+
48
+ function verifyRequestBody(body: unknown): body is RequestBody {
49
+ const {deliverTo} = (body as any);
50
+ return typeof body === 'object' && body !== null && verifyDestination(deliverTo);
51
+ }
52
+ ```
53
+
54
+ Alternatively, 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.
55
+
56
+ @example
57
+ ```
58
+ const destinations = ['a', 'b', 'c'] as const;
59
+
60
+ type Destination = typeof destinations[number];
61
+ //=> 'a' | 'b' | 'c'
62
+
63
+ const erroringType = new Set(['a', 'b', 'c']);
64
+
65
+ // @ts-expect-error
66
+ type ErroringType = typeof erroringType[number];
67
+ // Error: Type 'Set<string>' has no matching index signature for type 'number'. ts(2537)
68
+
69
+ const numberBool: {[n: number]: boolean} = {1: true};
70
+
71
+ type NumberBool = typeof numberBool[number];
72
+ //=> boolean
73
+ ```
74
+
75
+ @category Array
76
+ */
77
+ type TupleToUnion<ArrayType> = ArrayType extends readonly unknown[] ? ArrayType[number] : never;
78
+ //#endregion
25
79
  //#region src/hooks/react/useMount.d.ts
26
80
  type MountCallback = EffectCallback | AnyAsyncFunction;
27
81
  /**
@@ -34,8 +88,9 @@ type MountCallback = EffectCallback | AnyAsyncFunction;
34
88
  declare function useMount(effect: MountCallback): void;
35
89
  //#endregion
36
90
  //#region src/hooks/react/useResponsive.d.ts
37
- type Breakpoint = "xxl" | "xl" | "lg" | "md" | "sm" | "xs";
91
+ type Breakpoint = TupleToUnion<typeof tuple>;
38
92
  type ResponsiveValues = Record<Breakpoint, boolean>;
93
+ declare const tuple: readonly ["xxxl", "xxl", "xl", "lg", "md", "sm", "xs"];
39
94
  interface ResponsiveHookOptions {
40
95
  /**
41
96
  * 紧凑布局断点
@@ -48,7 +103,7 @@ interface ResponsiveHookOptions {
48
103
  }
49
104
  declare function useResponsive(options?: ResponsiveHookOptions): {
50
105
  responsive: ResponsiveValues;
51
- current: Breakpoint;
106
+ current: "xxxl" | "xxl" | "xl" | "lg" | "md" | "sm" | "xs";
52
107
  isCompact: boolean;
53
108
  breakPointTokens: BREAK_POINT_TOKEN_TYPE;
54
109
  };
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-react.d.ts","names":[],"sources":["../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":[],"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;;;KEXnD,aAAA,GAAgB,iBAAiB;;;AFWtC;;;;;iBEFgB,QAAA,SAAkB;;;KCV7B,UAAA;KAGA,gBAAA,GAAmB,OAAO;UAQd,qBAAA;;AHCjB;;;;EAAsE,iBAAA,CAAA,EGKhD,UHLgD;;qBGOjD;;AFfL,iBEiBA,aAAA,CFjBS,OAAA,CAAA,EEiBgB,qBFjBhB,CAAA,EAAA;EAAY,UAAA,kBAAA;EAAc,OAAA,YAAA;EAAV,SAAA,EAAA,OAAA;EAAS,gBAAA,wBAAA;;;;UGJxC,eAAA;;;iBAGM,QAAA,yBAAkC;;;;;;;AJSlD;;AAAwD,iBKLxC,UAAA,CLKwC,MAAA,EKLpB,WLKoB,CAAA,EAAA,IAAA"}
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,5 +1,5 @@
1
- import { Ot as isEqual, Pt as isFunction, R as isBrowser, S as objectAssign, ft as isPromiseLike, y as objectKeys } from "./utils-QG8UI8ZT.js";
2
- import { n as BREAK_POINT_TOKEN_ENUM } from "./enums-Bv0coVvD.js";
1
+ import { B as arrayZipToObject, Ot as isEqual, Pt as isFunction, R as isBrowser, S as objectAssign, ft as isPromiseLike, y as objectKeys } from "./utils-QG8UI8ZT.js";
2
+ import { n as BREAK_POINT_TOKEN_ENUM } from "./enums-XkYDzrre.js";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
 
5
5
  //#region src/hooks/react/useCreation.ts
@@ -62,36 +62,32 @@ function useMount(effect) {
62
62
 
63
63
  //#endregion
64
64
  //#region src/hooks/react/useResponsive.ts
65
+ const tuple = [
66
+ "xxxl",
67
+ "xxl",
68
+ "xl",
69
+ "lg",
70
+ "md",
71
+ "sm",
72
+ "xs"
73
+ ];
74
+ const TUPLE = [
75
+ "XXXL",
76
+ "XXL",
77
+ "XL",
78
+ "LG",
79
+ "MD",
80
+ "SM",
81
+ "XS"
82
+ ];
65
83
  const subscriberList = /* @__PURE__ */ new Set();
66
- const { XS, SM, MD, LG, XL, XXL } = BREAK_POINT_TOKEN_ENUM;
67
- const defaultResponsiveValues = {
68
- xxl: false,
69
- xl: false,
70
- lg: false,
71
- md: false,
72
- sm: false,
73
- xs: false
74
- };
75
- let responsiveConfig = {
76
- xxl: XXL,
77
- xl: XL,
78
- lg: LG,
79
- md: MD,
80
- sm: SM,
81
- xs: XS
82
- };
84
+ const defaultResponsiveValues = arrayZipToObject(tuple, tuple.map(() => false));
85
+ let responsiveConfig = arrayZipToObject(tuple, TUPLE.map((t) => BREAK_POINT_TOKEN_ENUM[t]));
83
86
  let responsiveValues = { ...defaultResponsiveValues };
84
87
  function useResponsive(options) {
85
88
  const { compactBreakPoint = "xl", breakPointTokens = {} } = options || {};
86
89
  const tokens = objectAssign(BREAK_POINT_TOKEN_ENUM, breakPointTokens);
87
- responsiveConfig = {
88
- xxl: tokens.XXL,
89
- xl: tokens.XL,
90
- lg: tokens.LG,
91
- md: tokens.MD,
92
- sm: tokens.SM,
93
- xs: tokens.XS
94
- };
90
+ responsiveConfig = arrayZipToObject(tuple, TUPLE.map((t) => tokens[t]));
95
91
  calculate();
96
92
  const [responsive, setResponsive] = useState(responsiveValues);
97
93
  const isCompact = !responsive[compactBreakPoint];
@@ -1 +1 @@
1
- {"version":3,"file":"hooks-react.js","names":["defaultResponsiveValues: ResponsiveValues","responsiveConfig: ResponsiveConfig","responsiveValues: ResponsiveValues","tokens: BREAK_POINT_TOKEN_TYPE"],"sources":["../src/hooks/react/useCreation.ts","../src/hooks/react/useLatest.ts","../src/hooks/react/useMount.ts","../src/hooks/react/useResponsive.ts","../src/hooks/react/useUnmount.ts","../src/hooks/react/useTitle.ts"],"sourcesContent":["import { useRef, type DependencyList } from \"react\";\nimport { isEqual } from \"src/utils\";\n\ninterface RefObject<T> {\n deps: DependencyList;\n result: T;\n isInitialized: boolean;\n}\n\n/**\n * useCreation\n * @reference https://ahooks.js.org/zh-CN/hooks/use-creation\n *\n * @param factory\n * @param deps\n */\nexport function useCreation<T> (factory: () => T, deps: DependencyList) {\n const { current } = useRef<RefObject<T>>({ deps, result: undefined!, isInitialized: false });\n\n if (current.isInitialized === false || !isEqual(current.deps, deps)) {\n current.deps = deps;\n current.result = factory();\n current.isInitialized = true;\n }\n\n return current.result;\n}\n\n","import { useRef, type RefObject } from \"react\";\n\n/**\n * 返回当前最新值的 Hook\n * @reference https://ahooks.js.org/zh-CN/hooks/use-latest\n *\n * @param value\n */\nexport function useLatest<T> (value: T): RefObject<T> {\n const ref = useRef(value);\n ref.current = value;\n\n return ref;\n}\n\n","import type { AnyAsyncFunction } from \"@pawover/types\";\nimport { useEffect, type EffectCallback } from \"react\";\nimport { isFunction, isPromiseLike } from \"src/utils\";\nimport { useLatest } from \"./useLatest\";\n\ntype MountCallback = EffectCallback | AnyAsyncFunction;\n\n/**\n * 在组件初始化时执行的 Hook\n * - 即使在严格模式下也只执行一次\n * @reference https://ahooks.js.org/hooks/use-mount\n *\n * @param effect 副作用函数\n */\nexport function useMount (effect: MountCallback) {\n if (!isFunction(effect)) {\n console.error(`useMount expected parameter is a function, but got ${typeof effect}`);\n }\n\n let isMounted = false;\n const effectRef = useLatest(effect);\n\n useEffect(() => {\n if (isMounted) {\n return;\n }\n\n isMounted = true;\n const result = effectRef.current?.();\n // If fn returns a Promise, don't return it as cleanup function\n if (isPromiseLike(result)) {\n return;\n }\n\n return result as ReturnType<EffectCallback>;\n }, []);\n}\n\n","import { useEffect, useState } from \"react\";\nimport { BREAK_POINT_TOKEN_ENUM, type BREAK_POINT_TOKEN_TYPE } from \"src/enums\";\nimport { objectAssign, objectKeys } from \"src/utils\";\n\ntype Breakpoint = \"xxl\" | \"xl\" | \"lg\" | \"md\" | \"sm\" | \"xs\";\ntype Subscriber = () => void;\ntype ResponsiveConfig = Record<Breakpoint, number>;\ntype ResponsiveValues = Record<Breakpoint, boolean>;\n\nconst subscriberList = new Set<Subscriber>();\nconst { XS, SM, MD, LG, XL, XXL } = BREAK_POINT_TOKEN_ENUM;\nconst defaultResponsiveValues: ResponsiveValues = { xxl: false, xl: false, lg: false, md: false, sm: false, xs: false };\nlet responsiveConfig: ResponsiveConfig = { xxl: XXL, xl: XL, lg: LG, md: MD, sm: SM, xs: XS };\nlet responsiveValues: ResponsiveValues = { ...defaultResponsiveValues };\n\nexport interface ResponsiveHookOptions {\n /**\n * 紧凑布局断点\n * - 低于此断点时使用紧凑布局\n * @default \"xl\"\n */\n compactBreakPoint?: Breakpoint;\n /** 屏幕响应断点 token 配置 */\n breakPointTokens?: BREAK_POINT_TOKEN_TYPE;\n}\nexport function useResponsive (options?: ResponsiveHookOptions) {\n const { compactBreakPoint = \"xl\", breakPointTokens = {} } = options || {};\n const tokens: BREAK_POINT_TOKEN_TYPE = objectAssign(BREAK_POINT_TOKEN_ENUM, breakPointTokens);\n responsiveConfig = { xxl: tokens.XXL, xl: tokens.XL, lg: tokens.LG, md: tokens.MD, sm: tokens.SM, xs: tokens.XS };\n\n calculate();\n\n const [responsive, setResponsive] = useState<ResponsiveValues>(responsiveValues);\n const isCompact = !responsive[compactBreakPoint];\n const current = objectKeys(defaultResponsiveValues).find((key) => responsive[key] === true) || \"xs\";\n\n useEffect(() => {\n addListener();\n\n const subscriber = () => {\n setResponsive(responsiveValues);\n };\n\n subscriberList.add(subscriber);\n\n return () => {\n subscriberList.delete(subscriber);\n\n if (subscriberList.size === 0) {\n removeListener();\n }\n };\n }, []);\n\n return { responsive, current, isCompact, breakPointTokens: tokens };\n}\n\nfunction resizeListener () {\n const oldInfo = responsiveValues;\n calculate();\n\n if (oldInfo === responsiveValues) {\n return;\n }\n\n for (const subscriber of subscriberList) {\n subscriber();\n }\n}\nfunction addListener () {\n window.addEventListener(\"resize\", resizeListener);\n}\nfunction removeListener () {\n window.removeEventListener(\"resize\", resizeListener);\n}\nfunction calculate () {\n const width = window.innerWidth;\n const newValues = { ...defaultResponsiveValues };\n let shouldUpdate = false;\n\n for (const key of objectKeys(responsiveConfig)) {\n newValues[key] = width >= responsiveConfig[key];\n if (newValues[key] !== responsiveValues[key]) {\n shouldUpdate = true;\n }\n }\n if (shouldUpdate) {\n responsiveValues = newValues;\n }\n}\n\n","import type { AnyFunction } from \"@pawover/types\";\nimport { useEffect } from \"react\";\nimport { isFunction } from \"src/utils\";\nimport { useLatest } from \"./useLatest\";\n\n/**\n * 在组件卸载时执行的 Hook\n * @reference https://ahooks.js.org/zh-CN/hooks/use-unmount\n *\n * @param effect 副作用函数\n */\nexport function useUnmount (effect: AnyFunction) {\n if (!isFunction(effect)) {\n console.error(`useUnmount expected parameter is a function, got ${typeof effect}`);\n }\n\n const effectRef = useLatest(effect);\n\n useEffect(\n () => () => {\n effectRef.current?.();\n },\n [],\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { isBrowser } from \"../../utils\";\nimport { useUnmount } from \"./useUnmount\";\n\ninterface TitleHookConfig {\n isRestoreOnUnmount?: boolean;\n}\nexport function useTitle (title: string, config?: TitleHookConfig | undefined) {\n if (!isBrowser()) {\n return;\n }\n\n const titleRef = useRef(document.title);\n\n useEffect(() => {\n document.title = title;\n }, [title]);\n\n useUnmount(() => {\n if (config?.isRestoreOnUnmount) {\n document.title = titleRef.current;\n }\n });\n}\n"],"mappings":";;;;;;;;;;;;AAgBA,SAAgB,YAAgB,SAAkB,MAAsB;CACtE,MAAM,EAAE,YAAY,OAAqB;EAAE;EAAM,QAAQ;EAAY,eAAe;EAAO,CAAC;AAE5F,KAAI,QAAQ,kBAAkB,SAAS,CAAC,QAAQ,QAAQ,MAAM,KAAK,EAAE;AACnE,UAAQ,OAAO;AACf,UAAQ,SAAS,SAAS;AAC1B,UAAQ,gBAAgB;;AAG1B,QAAO,QAAQ;;;;;;;;;;;ACjBjB,SAAgB,UAAc,OAAwB;CACpD,MAAM,MAAM,OAAO,MAAM;AACzB,KAAI,UAAU;AAEd,QAAO;;;;;;;;;;;;ACET,SAAgB,SAAU,QAAuB;AAC/C,KAAI,CAAC,WAAW,OAAO,CACrB,SAAQ,MAAM,sDAAsD,OAAO,SAAS;CAGtF,IAAI,YAAY;CAChB,MAAM,YAAY,UAAU,OAAO;AAEnC,iBAAgB;AACd,MAAI,UACF;AAGF,cAAY;EACZ,MAAM,SAAS,UAAU,WAAW;AAEpC,MAAI,cAAc,OAAO,CACvB;AAGF,SAAO;IACN,EAAE,CAAC;;;;;AC1BR,MAAM,iCAAiB,IAAI,KAAiB;AAC5C,MAAM,EAAE,IAAI,IAAI,IAAI,IAAI,IAAI,QAAQ;AACpC,MAAMA,0BAA4C;CAAE,KAAK;CAAO,IAAI;CAAO,IAAI;CAAO,IAAI;CAAO,IAAI;CAAO,IAAI;CAAO;AACvH,IAAIC,mBAAqC;CAAE,KAAK;CAAK,IAAI;CAAI,IAAI;CAAI,IAAI;CAAI,IAAI;CAAI,IAAI;CAAI;AAC7F,IAAIC,mBAAqC,EAAE,GAAG,yBAAyB;AAYvE,SAAgB,cAAe,SAAiC;CAC9D,MAAM,EAAE,oBAAoB,MAAM,mBAAmB,EAAE,KAAK,WAAW,EAAE;CACzE,MAAMC,SAAiC,aAAa,wBAAwB,iBAAiB;AAC7F,oBAAmB;EAAE,KAAK,OAAO;EAAK,IAAI,OAAO;EAAI,IAAI,OAAO;EAAI,IAAI,OAAO;EAAI,IAAI,OAAO;EAAI,IAAI,OAAO;EAAI;AAEjH,YAAW;CAEX,MAAM,CAAC,YAAY,iBAAiB,SAA2B,iBAAiB;CAChF,MAAM,YAAY,CAAC,WAAW;CAC9B,MAAM,UAAU,WAAW,wBAAwB,CAAC,MAAM,QAAQ,WAAW,SAAS,KAAK,IAAI;AAE/F,iBAAgB;AACd,eAAa;EAEb,MAAM,mBAAmB;AACvB,iBAAc,iBAAiB;;AAGjC,iBAAe,IAAI,WAAW;AAE9B,eAAa;AACX,kBAAe,OAAO,WAAW;AAEjC,OAAI,eAAe,SAAS,EAC1B,iBAAgB;;IAGnB,EAAE,CAAC;AAEN,QAAO;EAAE;EAAY;EAAS;EAAW,kBAAkB;EAAQ;;AAGrE,SAAS,iBAAkB;CACzB,MAAM,UAAU;AAChB,YAAW;AAEX,KAAI,YAAY,iBACd;AAGF,MAAK,MAAM,cAAc,eACvB,aAAY;;AAGhB,SAAS,cAAe;AACtB,QAAO,iBAAiB,UAAU,eAAe;;AAEnD,SAAS,iBAAkB;AACzB,QAAO,oBAAoB,UAAU,eAAe;;AAEtD,SAAS,YAAa;CACpB,MAAM,QAAQ,OAAO;CACrB,MAAM,YAAY,EAAE,GAAG,yBAAyB;CAChD,IAAI,eAAe;AAEnB,MAAK,MAAM,OAAO,WAAW,iBAAiB,EAAE;AAC9C,YAAU,OAAO,SAAS,iBAAiB;AAC3C,MAAI,UAAU,SAAS,iBAAiB,KACtC,gBAAe;;AAGnB,KAAI,aACF,oBAAmB;;;;;;;;;;;AC5EvB,SAAgB,WAAY,QAAqB;AAC/C,KAAI,CAAC,WAAW,OAAO,CACrB,SAAQ,MAAM,oDAAoD,OAAO,SAAS;CAGpF,MAAM,YAAY,UAAU,OAAO;AAEnC,uBACc;AACV,YAAU,WAAW;IAEvB,EAAE,CACH;;;;;AChBH,SAAgB,SAAU,OAAe,QAAsC;AAC7E,KAAI,CAAC,WAAW,CACd;CAGF,MAAM,WAAW,OAAO,SAAS,MAAM;AAEvC,iBAAgB;AACd,WAAS,QAAQ;IAChB,CAAC,MAAM,CAAC;AAEX,kBAAiB;AACf,MAAI,QAAQ,mBACV,UAAS,QAAQ,SAAS;GAE5B"}
1
+ {"version":3,"file":"hooks-react.js","names":["defaultResponsiveValues: ResponsiveValues","responsiveConfig: ResponsiveConfig","responsiveValues: ResponsiveValues","tokens: BREAK_POINT_TOKEN_TYPE"],"sources":["../src/hooks/react/useCreation.ts","../src/hooks/react/useLatest.ts","../src/hooks/react/useMount.ts","../src/hooks/react/useResponsive.ts","../src/hooks/react/useUnmount.ts","../src/hooks/react/useTitle.ts"],"sourcesContent":["import { useRef, type DependencyList } from \"react\";\nimport { isEqual } from \"src/utils\";\n\ninterface RefObject<T> {\n deps: DependencyList;\n result: T;\n isInitialized: boolean;\n}\n\n/**\n * useCreation\n * @reference https://ahooks.js.org/zh-CN/hooks/use-creation\n *\n * @param factory\n * @param deps\n */\nexport function useCreation<T> (factory: () => T, deps: DependencyList) {\n const { current } = useRef<RefObject<T>>({ deps, result: undefined!, isInitialized: false });\n\n if (current.isInitialized === false || !isEqual(current.deps, deps)) {\n current.deps = deps;\n current.result = factory();\n current.isInitialized = true;\n }\n\n return current.result;\n}\n\n","import { useRef, type RefObject } from \"react\";\n\n/**\n * 返回当前最新值的 Hook\n * @reference https://ahooks.js.org/zh-CN/hooks/use-latest\n *\n * @param value\n */\nexport function useLatest<T> (value: T): RefObject<T> {\n const ref = useRef(value);\n ref.current = value;\n\n return ref;\n}\n\n","import type { AnyAsyncFunction } from \"@pawover/types\";\nimport { useEffect, type EffectCallback } from \"react\";\nimport { isFunction, isPromiseLike } from \"src/utils\";\nimport { useLatest } from \"./useLatest\";\n\ntype MountCallback = EffectCallback | AnyAsyncFunction;\n\n/**\n * 在组件初始化时执行的 Hook\n * - 即使在严格模式下也只执行一次\n * @reference https://ahooks.js.org/hooks/use-mount\n *\n * @param effect 副作用函数\n */\nexport function useMount (effect: MountCallback) {\n if (!isFunction(effect)) {\n console.error(`useMount expected parameter is a function, but got ${typeof effect}`);\n }\n\n let isMounted = false;\n const effectRef = useLatest(effect);\n\n useEffect(() => {\n if (isMounted) {\n return;\n }\n\n isMounted = true;\n const result = effectRef.current?.();\n // If fn returns a Promise, don't return it as cleanup function\n if (isPromiseLike(result)) {\n return;\n }\n\n return result as ReturnType<EffectCallback>;\n }, []);\n}\n\n","import { useEffect, useState } from \"react\";\nimport { BREAK_POINT_TOKEN_ENUM, type BREAK_POINT_TOKEN_TYPE } from \"src/enums\";\nimport { arrayZipToObject, objectAssign, objectKeys } from \"src/utils\";\nimport type { TupleToUnion } from \"type-fest\";\n\ntype Breakpoint = TupleToUnion<typeof tuple>;\ntype Subscriber = () => void;\ntype ResponsiveConfig = Record<Breakpoint, number>;\ntype ResponsiveValues = Record<Breakpoint, boolean>;\n\nconst tuple = [\"xxxl\", \"xxl\", \"xl\", \"lg\", \"md\", \"sm\", \"xs\"] as const;\nconst TUPLE = [\"XXXL\", \"XXL\", \"XL\", \"LG\", \"MD\", \"SM\", \"XS\"] as const;\nconst subscriberList = new Set<Subscriber>();\nconst defaultResponsiveValues: ResponsiveValues = arrayZipToObject(tuple, tuple.map(() => false));\nlet responsiveConfig: ResponsiveConfig = arrayZipToObject(tuple, TUPLE.map((t) => BREAK_POINT_TOKEN_ENUM[t]));\nlet responsiveValues: ResponsiveValues = { ...defaultResponsiveValues };\n\nexport interface ResponsiveHookOptions {\n /**\n * 紧凑布局断点\n * - 低于此断点时使用紧凑布局\n * @default \"xl\"\n */\n compactBreakPoint?: Breakpoint;\n /** 屏幕响应断点 token 配置 */\n breakPointTokens?: BREAK_POINT_TOKEN_TYPE;\n}\nexport function useResponsive (options?: ResponsiveHookOptions) {\n const { compactBreakPoint = \"xl\", breakPointTokens = {} } = options || {};\n const tokens: BREAK_POINT_TOKEN_TYPE = objectAssign(BREAK_POINT_TOKEN_ENUM, breakPointTokens);\n responsiveConfig = arrayZipToObject(tuple, TUPLE.map((t) => tokens[t]));\n\n calculate();\n\n const [responsive, setResponsive] = useState<ResponsiveValues>(responsiveValues);\n const isCompact = !responsive[compactBreakPoint];\n const current = objectKeys(defaultResponsiveValues).find((key) => responsive[key] === true) || \"xs\";\n\n useEffect(() => {\n addListener();\n\n const subscriber = () => {\n setResponsive(responsiveValues);\n };\n\n subscriberList.add(subscriber);\n\n return () => {\n subscriberList.delete(subscriber);\n\n if (subscriberList.size === 0) {\n removeListener();\n }\n };\n }, []);\n\n return { responsive, current, isCompact, breakPointTokens: tokens };\n}\n\nfunction resizeListener () {\n const oldInfo = responsiveValues;\n calculate();\n\n if (oldInfo === responsiveValues) {\n return;\n }\n\n for (const subscriber of subscriberList) {\n subscriber();\n }\n}\nfunction addListener () {\n window.addEventListener(\"resize\", resizeListener);\n}\nfunction removeListener () {\n window.removeEventListener(\"resize\", resizeListener);\n}\nfunction calculate () {\n const width = window.innerWidth;\n const newValues = { ...defaultResponsiveValues };\n let shouldUpdate = false;\n\n for (const key of objectKeys(responsiveConfig)) {\n newValues[key] = width >= responsiveConfig[key];\n if (newValues[key] !== responsiveValues[key]) {\n shouldUpdate = true;\n }\n }\n if (shouldUpdate) {\n responsiveValues = newValues;\n }\n}\n\n","import type { AnyFunction } from \"@pawover/types\";\nimport { useEffect } from \"react\";\nimport { isFunction } from \"src/utils\";\nimport { useLatest } from \"./useLatest\";\n\n/**\n * 在组件卸载时执行的 Hook\n * @reference https://ahooks.js.org/zh-CN/hooks/use-unmount\n *\n * @param effect 副作用函数\n */\nexport function useUnmount (effect: AnyFunction) {\n if (!isFunction(effect)) {\n console.error(`useUnmount expected parameter is a function, got ${typeof effect}`);\n }\n\n const effectRef = useLatest(effect);\n\n useEffect(\n () => () => {\n effectRef.current?.();\n },\n [],\n );\n}\n","import { useEffect, useRef } from \"react\";\nimport { isBrowser } from \"../../utils\";\nimport { useUnmount } from \"./useUnmount\";\n\ninterface TitleHookConfig {\n isRestoreOnUnmount?: boolean;\n}\nexport function useTitle (title: string, config?: TitleHookConfig | undefined) {\n if (!isBrowser()) {\n return;\n }\n\n const titleRef = useRef(document.title);\n\n useEffect(() => {\n document.title = title;\n }, [title]);\n\n useUnmount(() => {\n if (config?.isRestoreOnUnmount) {\n document.title = titleRef.current;\n }\n });\n}\n"],"mappings":"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"}
@@ -1,4 +1,4 @@
1
- //#region node_modules/.pnpm/@pawover+types@0.0.0-alpha._21b6cac9429d99063479ebc6e15adca3/node_modules/@pawover/types/dist/index.d.ts
1
+ //#region node_modules/.pnpm/@pawover+types@0.0.0-alpha._2f84ec986ed9c8cd8cf34605feea084b/node_modules/@pawover/types/dist/index.d.ts
2
2
 
3
3
  //#endregion
4
4
  //#region src/index.d.ts
@@ -18,4 +18,4 @@ type AnyAsyncGeneratorFunction<P extends any[] = any[], T = any, R$1 = any, N =
18
18
 
19
19
  //#endregion
20
20
  export { AnyObject as a, AnyGeneratorFunction as i, AnyAsyncGeneratorFunction as n, PlainObject as o, AnyFunction as r, TreeLike as s, AnyAsyncFunction as t };
21
- //# sourceMappingURL=index-CjoMz104.d.ts.map
21
+ //# sourceMappingURL=index-BPEx210u.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CjoMz104.d.ts","names":["Split","TupleToUnion","ALPHABET","Alphabet","ValidChar","ApiNameCheck","N","P","R","L","AnyObject","K","T","PropertyKey","Record","PlainObject","TreeLike","CK","AnyFunction","R$1","AnyAsyncFunction","Promise","AnyGeneratorFunction","Generator","AnyAsyncGeneratorFunction","AsyncGenerator"],"sources":["../node_modules/.pnpm/@pawover+types@0.0.0-alpha._21b6cac9429d99063479ebc6e15adca3/node_modules/@pawover/types/dist/index.d.ts"],"sourcesContent":["import { Split, TupleToUnion } from \"type-fest\";\n\n//#region src/api.d.ts\n/** 字母表 */\ntype ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n/** 单个字母 */\ntype Alphabet = TupleToUnion<Split<ALPHABET, \"\">>;\n/** 有效字符 */\ntype ValidChar = Alphabet | \"_\";\n/** 定义 API 命名 - 键名检查 */\ntype ApiNameCheck<N extends string, P extends string = \"\"> = N extends `${infer L extends ValidChar}${infer R}` ? ApiNameCheck<R, `${P}${L}`> : P extends `${infer S}_` ? S : P;\n//#endregion\n//#region src/index.d.ts\n/** 任意对象类型 */\ntype AnyObject<K extends PropertyKey = PropertyKey, T = any> = Record<K, T>;\n/** 普通对象类型 */\ntype PlainObject<K extends PropertyKey = PropertyKey, T = unknown> = Record<K, T>;\n/** 描述树类型 */\ntype TreeLike<T extends AnyObject, CK extends string = \"children\"> = T & Record<CK, TreeLike<T, CK>[]>;\n/** 描述函数类型 */\ntype AnyFunction<P extends any[] = any[], R$1 = any> = (...arg: P) => R$1;\n/** 描述异步函数类型 */\ntype AnyAsyncFunction<P extends any[] = any[], R$1 = any> = (...args: P) => Promise<R$1>;\ntype AnyGeneratorFunction<P extends any[] = any[], T = any, R$1 = any, N = any> = (...args: P) => Generator<T, R$1, N>;\ntype AnyAsyncGeneratorFunction<P extends any[] = any[], T = any, R$1 = any, N = any> = (...args: P) => AsyncGenerator<T, R$1, N>;\n//#endregion\nexport { AnyAsyncFunction, AnyAsyncGeneratorFunction, AnyFunction, AnyGeneratorFunction, AnyObject, type ApiNameCheck, PlainObject, TreeLike };\n//# sourceMappingURL=index.d.ts.map"],"x_google_ignoreList":[0],"mappings":";;;;;KAcKU,SAEsE,CAAA,UAFlDG,WAEkD,GAFpCA,WAEoC,EAAA,IAAA,GAAA,CAAA,GAFZC,MAEY,CAFLH,CAEK,EAFFC,CAEE,CAAA;AAAA;KAAtEG,WAEmBL,CAAAA,UAFGG,WAEHH,GAFiBG,WAEjBH,EAAAA,IAAAA,OAAAA,CAAAA,GAF6CI,MAE7CJ,CAFoDC,CAEpDD,EAFuDE,CAEvDF,CAAAA;;KAAnBM,QAA2EC,CAAAA,UAAxDP,SAAwDO,EAAAA,WAAAA,MAAAA,GAAAA,UAAAA,CAAAA,GAAXL,CAAWK,GAAPH,MAAOG,CAAAA,EAAAA,EAAID,QAAJC,CAAaL,CAAbK,EAAgBA,EAAhBA,CAAAA,EAAAA,CAAAA;;KAE3EC,WAF2FD,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,GAAAA,EAEhCV,CAFgCU,EAAAA,GAE1BE,GAF0BF;;KAI3FG,gBAJoEN,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,IAAAA,EAIHP,CAJGO,EAAAA,GAIGO,OAJHP,CAIWK,GAJXL,CAAAA;KAKpEQ,oBAL0E,CAAA,UAAA,GAAA,EAAA,GAAA,GAAA,EAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAKaf,CALb,EAAA,GAKmBgB,SALnB,CAK6BX,CAL7B,EAKgCO,GALhC,EAKqCb,CALrC,CAAA;AAAA,KAM1EkB,yBAJWL,CAAAA,UAAsDA,GAAG,EAAA,GAAA,GAAA,EAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAIwBZ,CAJxB,EAAA,GAI8BkB,cAJ9B,CAI6Cb,CAJ7C,EAIgDO,GAJhD,EAIqDb,CAJrD,CAAA;AAAA"}
1
+ {"version":3,"file":"index-BPEx210u.d.ts","names":["Split","TupleToUnion","ALPHABET","Alphabet","ValidChar","ApiNameCheck","N","P","R","L","AnyObject","K","T","PropertyKey","Record","PlainObject","TreeLike","CK","AnyFunction","R$1","AnyAsyncFunction","Promise","AnyGeneratorFunction","Generator","AnyAsyncGeneratorFunction","AsyncGenerator"],"sources":["../node_modules/.pnpm/@pawover+types@0.0.0-alpha._2f84ec986ed9c8cd8cf34605feea084b/node_modules/@pawover/types/dist/index.d.ts"],"sourcesContent":["import { Split, TupleToUnion } from \"type-fest\";\n\n//#region src/api.d.ts\n/** 字母表 */\ntype ALPHABET = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n/** 单个字母 */\ntype Alphabet = TupleToUnion<Split<ALPHABET, \"\">>;\n/** 有效字符 */\ntype ValidChar = Alphabet | \"_\";\n/** 定义 API 命名 - 键名检查 */\ntype ApiNameCheck<N extends string, P extends string = \"\"> = N extends `${infer L extends ValidChar}${infer R}` ? ApiNameCheck<R, `${P}${L}`> : P extends `${infer S}_` ? S : P;\n//#endregion\n//#region src/index.d.ts\n/** 任意对象类型 */\ntype AnyObject<K extends PropertyKey = PropertyKey, T = any> = Record<K, T>;\n/** 普通对象类型 */\ntype PlainObject<K extends PropertyKey = PropertyKey, T = unknown> = Record<K, T>;\n/** 描述树类型 */\ntype TreeLike<T extends AnyObject, CK extends string = \"children\"> = T & Record<CK, TreeLike<T, CK>[]>;\n/** 描述函数类型 */\ntype AnyFunction<P extends any[] = any[], R$1 = any> = (...arg: P) => R$1;\n/** 描述异步函数类型 */\ntype AnyAsyncFunction<P extends any[] = any[], R$1 = any> = (...args: P) => Promise<R$1>;\ntype AnyGeneratorFunction<P extends any[] = any[], T = any, R$1 = any, N = any> = (...args: P) => Generator<T, R$1, N>;\ntype AnyAsyncGeneratorFunction<P extends any[] = any[], T = any, R$1 = any, N = any> = (...args: P) => AsyncGenerator<T, R$1, N>;\n//#endregion\nexport { AnyAsyncFunction, AnyAsyncGeneratorFunction, AnyFunction, AnyGeneratorFunction, AnyObject, type ApiNameCheck, PlainObject, TreeLike };\n//# sourceMappingURL=index.d.ts.map"],"x_google_ignoreList":[0],"mappings":";;;;;KAcKU,SAEsE,CAAA,UAFlDG,WAEkD,GAFpCA,WAEoC,EAAA,IAAA,GAAA,CAAA,GAFZC,MAEY,CAFLH,CAEK,EAFFC,CAEE,CAAA;AAAA;KAAtEG,WAEmBL,CAAAA,UAFGG,WAEHH,GAFiBG,WAEjBH,EAAAA,IAAAA,OAAAA,CAAAA,GAF6CI,MAE7CJ,CAFoDC,CAEpDD,EAFuDE,CAEvDF,CAAAA;;KAAnBM,QAA2EC,CAAAA,UAAxDP,SAAwDO,EAAAA,WAAAA,MAAAA,GAAAA,UAAAA,CAAAA,GAAXL,CAAWK,GAAPH,MAAOG,CAAAA,EAAAA,EAAID,QAAJC,CAAaL,CAAbK,EAAgBA,EAAhBA,CAAAA,EAAAA,CAAAA;;KAE3EC,WAF2FD,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,GAAAA,EAEhCV,CAFgCU,EAAAA,GAE1BE,GAF0BF;;KAI3FG,gBAJoEN,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,IAAAA,EAIHP,CAJGO,EAAAA,GAIGO,OAJHP,CAIWK,GAJXL,CAAAA;KAKpEQ,oBAL0E,CAAA,UAAA,GAAA,EAAA,GAAA,GAAA,EAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAKaf,CALb,EAAA,GAKmBgB,SALnB,CAK6BX,CAL7B,EAKgCO,GALhC,EAKqCb,CALrC,CAAA;AAAA,KAM1EkB,yBAJWL,CAAAA,UAAsDA,GAAG,EAAA,GAAA,GAAA,EAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAIwBZ,CAJxB,EAAA,GAI8BkB,cAJ9B,CAI6Cb,CAJ7C,EAIgDO,GAJhD,EAIqDb,CAJrD,CAAA;AAAA"}
@@ -2,23 +2,26 @@
2
2
  type BREAK_POINT_TOKEN_TYPE = Record<keyof typeof BREAK_POINT_TOKEN_ENUM, number>;
3
3
  /** 屏幕响应断点 token 配置 */
4
4
  declare const BREAK_POINT_TOKEN_ENUM: {
5
- readonly XS: 576;
6
- readonly XSMin: 576;
7
- readonly XSMax: 767;
8
- readonly SM: 768;
9
- readonly SMMin: 768;
10
- readonly SMMax: 991;
11
- readonly MD: 992;
12
- readonly MDMin: 992;
13
- readonly MDMax: 1199;
14
- readonly LG: 1200;
15
- readonly LGMin: 1200;
16
- readonly LGMax: 1599;
17
- readonly XL: 1600;
18
- readonly XLMin: 1600;
19
- readonly XLMax: 1919;
20
- readonly XXL: 1920;
21
- readonly XXLMin: 1920;
5
+ readonly XS: 480;
6
+ readonly XSMax: 575;
7
+ readonly XSMin: 480;
8
+ readonly SM: 576;
9
+ readonly SMMax: 767;
10
+ readonly SMMin: 576;
11
+ readonly MD: 768;
12
+ readonly MDMax: 991;
13
+ readonly MDMin: 768;
14
+ readonly LG: 992;
15
+ readonly LGMax: 1199;
16
+ readonly LGMin: 992;
17
+ readonly XL: 1200;
18
+ readonly XLMax: 1599;
19
+ readonly XLMin: 1200;
20
+ readonly XXL: 1600;
21
+ readonly XXLMax: 1919;
22
+ readonly XXLMin: 1600;
23
+ readonly XXXL: 1920;
24
+ readonly XXXLMin: 1920;
22
25
  };
23
26
  //#endregion
24
27
  //#region src/enums/mime.d.ts
@@ -156,4 +159,4 @@ declare const MIME: {
156
159
  };
157
160
  //#endregion
158
161
  export { BREAK_POINT_TOKEN_ENUM as n, BREAK_POINT_TOKEN_TYPE as r, MIME as t };
159
- //# sourceMappingURL=index-BKUSlLXA.d.ts.map
162
+ //# sourceMappingURL=index-CCujFuKP.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CCujFuKP.d.ts","names":[],"sources":["../src/enums/grid.ts","../src/enums/mime.ts"],"sourcesContent":[],"mappings":";KAAY,sBAAA,GAAyB,oBAAoB;AAAzD;AAEa,cAAA,sBA2BH,EAAA;;;;ECzBG,SA+HH,EAAA,EAAA,GAAA;;;;;;;;;;;;;;;;;;;;;ADnIV;AAEA;;cCEa;;EAAA,SA+HH,IAAA,EAAA,YAAA"}
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { a as Simplify, c as Not, d as IsNever, f as OptionalKeysOf, i as HomomorphicPick, l as UnknownArray, m as UnionToIntersection, n as ApplyDefaultOptions, o as IfNotAnyOrNever, p as IsAny, r as CollapseLiterals, s as IsExactOptionalPropertyTypesEnabled, t as Except, u as If } from "./except-C38JazcR.js";
2
- import { a as AnyObject, i as AnyGeneratorFunction, n as AnyAsyncGeneratorFunction, o as PlainObject, r as AnyFunction, s as TreeLike, t as AnyAsyncFunction } from "./index-CjoMz104.js";
1
+ import { a as Simplify, c as Not, d as IsNever, f as OptionalKeysOf, i as HomomorphicPick, l as UnknownArray, m as UnionToIntersection, n as ApplyDefaultOptions, o as IfNotAnyOrNever, p as IsAny, r as CollapseLiterals, s as IsExactOptionalPropertyTypesEnabled, t as Except, u as If } from "./except-MacUK44u.js";
2
+ import { a as AnyObject, i as AnyGeneratorFunction, n as AnyAsyncGeneratorFunction, o as PlainObject, r as AnyFunction, s as TreeLike, t as AnyAsyncFunction } from "./index-BPEx210u.js";
3
3
  import { BigNumber, MathExpression, MathJsInstance, Matrix } from "mathjs";
4
4
 
5
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/basic.d.ts
5
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/basic.d.ts
6
6
  /**
7
7
  Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
8
8
 
@@ -13,7 +13,7 @@ type Class<T, Arguments extends unknown[] = any[]> = {
13
13
  new (...arguments_: Arguments): T;
14
14
  };
15
15
  //#endregion
16
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/array.d.ts
16
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/internal/array.d.ts
17
17
 
18
18
  /**
19
19
  Transforms a tuple type by replacing it's rest element with a single element that has the same type as the rest element, while keeping all the non-rest elements intact.
@@ -57,7 +57,7 @@ type _CollapseRestElement<TArray extends UnknownArray, ForwardAccumulator extend
57
57
  : First], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
58
58
  : never; // Should never happen
59
59
  //#endregion
60
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/numeric.d.ts
60
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/numeric.d.ts
61
61
  type _Numeric = number | bigint;
62
62
  type Zero = 0 | 0n;
63
63
 
@@ -104,7 +104,7 @@ type IsNegative<T extends _Numeric> = T extends Negative<T> ? true : false;
104
104
  //#region node_modules/.pnpm/tagged-tag@1.0.0/node_modules/tagged-tag/index.d.ts
105
105
  declare const tag: unique symbol;
106
106
  //#endregion
107
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/tagged.d.ts
107
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/tagged.d.ts
108
108
  // eslint-disable-next-line type-fest/require-exported-types
109
109
  type TagContainer<Token> = {
110
110
  readonly [tag]: Token;
@@ -280,7 +280,7 @@ type Person = {
280
280
  @deprecated Use {@link Tagged} instead
281
281
  */
282
282
  //#endregion
283
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-literal.d.ts
283
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/is-literal.d.ts
284
284
  /**
285
285
  Returns a boolean for whether the given type is a `string` [literal type](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types).
286
286
 
@@ -343,7 +343,7 @@ type _IsStringLiteral<S> =
343
343
  // and since `{}` extends index signatures, the result becomes `false`.
344
344
  S extends string ? {} extends Record<S, never> ? false : true : false;
345
345
  //#endregion
346
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/tuple-of.d.ts
346
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/tuple-of.d.ts
347
347
  /**
348
348
  Create a tuple type of the specified length with elements of the specified type.
349
349
 
@@ -411,7 +411,7 @@ Note: If you need a readonly tuple, simply wrap this type with `Readonly`, for e
411
411
  type TupleOf<Length extends number, Fill = unknown> = IfNotAnyOrNever<Length, _TupleOf<If<IsNegative<Length>, 0, Length>, Fill, []>, Fill[], []>;
412
412
  type _TupleOf<L extends number, Fill, Accumulator extends UnknownArray> = number extends L ? Fill[] : L extends Accumulator['length'] ? Accumulator : _TupleOf<L, Fill, [...Accumulator, Fill]>;
413
413
  //#endregion
414
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/or.d.ts
414
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/or.d.ts
415
415
  /**
416
416
  Returns a boolean for whether either of two given types is true.
417
417
 
@@ -493,7 +493,7 @@ type Or<A$1 extends boolean, B$1 extends boolean> = _Or<If<IsNever<A$1>, false,
493
493
 
494
494
  type _Or<A$1 extends boolean, B$1 extends boolean> = A$1 extends true ? true : B$1 extends true ? true : false;
495
495
  //#endregion
496
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/all-extend.d.ts
496
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/all-extend.d.ts
497
497
  /**
498
498
  @see {@link AllExtend}
499
499
  */
@@ -581,7 +581,7 @@ type _AllExtend<TArray extends UnknownArray, Type$1, Options extends Required<Al
581
581
  // If target `Type` is also `never` OR `strictNever` is disabled, recurse further.
582
582
  ? _AllExtend<Rest, Type$1, Options> : false : First extends Type$1 ? _AllExtend<Rest, Type$1, Options> : false : true>, false, false>;
583
583
  //#endregion
584
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/and.d.ts
584
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/and.d.ts
585
585
  /**
586
586
  Returns a boolean for whether two given types are both true.
587
587
 
@@ -660,7 +660,7 @@ type G = And<never, never>;
660
660
  */
661
661
  type And<A$1 extends boolean, B$1 extends boolean> = AllExtend<[A$1, B$1], true>;
662
662
  //#endregion
663
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/union-to-tuple.d.ts
663
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/union-to-tuple.d.ts
664
664
  /**
665
665
  Returns the last element of a union type.
666
666
 
@@ -709,7 +709,7 @@ const petList = Object.keys(pets) as UnionToTuple<Pet>;
709
709
  */
710
710
  type UnionToTuple<T, L = LastOfUnion<T>> = IsNever<T> extends false ? [...UnionToTuple<Exclude<T, L>>, L] : [];
711
711
  //#endregion
712
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/set-optional.d.ts
712
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/set-optional.d.ts
713
713
  /**
714
714
  Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type.
715
715
 
@@ -743,7 +743,7 @@ Except<BaseType, Keys> &
743
743
  // Pick the keys that should be mutable from the base type and make them mutable.
744
744
  Partial<HomomorphicPick<BaseType, Keys>>> : never;
745
745
  //#endregion
746
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/value-of.d.ts
746
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/value-of.d.ts
747
747
  /**
748
748
  Create a union of the given object's values, and optionally specify which keys to get the values from.
749
749
 
@@ -767,7 +767,7 @@ type C = ValueOf<{id: number; name: string; active: boolean}, 'id' | 'name'>;
767
767
  */
768
768
  type ValueOf<ObjectType, ValueType extends keyof ObjectType = keyof ObjectType> = ObjectType[ValueType];
769
769
  //#endregion
770
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/split.d.ts
770
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/split.d.ts
771
771
  /**
772
772
  Split options.
773
773
 
@@ -826,7 +826,7 @@ type SplitHelper<S extends string, Delimiter extends string, Options extends Req
826
826
  : string[] : never // Should never happen
827
827
  : never; // Should never happen
828
828
  //#endregion
829
- //#region node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/replace.d.ts
829
+ //#region node_modules/.pnpm/type-fest@5.4.4/node_modules/type-fest/source/replace.d.ts
830
830
  type ReplaceOptions = {
831
831
  all?: boolean;
832
832
  };