@pawover/kit 0.0.0-beta.41 → 0.0.0-beta.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/enums.d.ts +1 -1
- package/dist/{except-MacUK44u.d.ts → except-C_xUtgFe.d.ts} +44 -19
- package/dist/except-C_xUtgFe.d.ts.map +1 -0
- package/dist/hooks-react.d.ts +42 -10
- package/dist/hooks-react.d.ts.map +1 -1
- package/dist/hooks-react.js +48 -39
- package/dist/hooks-react.js.map +1 -1
- package/dist/{index-Bn_PNnsM.d.ts → index-CN5K25yO.d.ts} +2 -2
- package/dist/{index-Bn_PNnsM.d.ts.map → index-CN5K25yO.d.ts.map} +1 -1
- package/dist/index-DBPmnr4a.d.ts.map +1 -1
- package/dist/index.d.ts +345 -34
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/patches-fetchEventSource.d.ts +1 -1
- package/dist/patches-fetchEventSource.js +1 -1
- package/dist/{utils-_dtCs-qa.js → utils-adQi5T1g.js} +12 -2
- package/dist/utils-adQi5T1g.js.map +1 -0
- package/dist/{value-of-DUmTbnuw.d.ts → value-of-DPr10cdW.d.ts} +2 -2
- package/dist/{value-of-DUmTbnuw.d.ts.map → value-of-DPr10cdW.d.ts.map} +1 -1
- package/package.json +11 -7
- package/dist/except-MacUK44u.d.ts.map +0 -1
- package/dist/utils-_dtCs-qa.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as ValueOf } from "./value-of-
|
|
1
|
+
import { t as ValueOf } from "./value-of-DPr10cdW.js";
|
|
2
2
|
|
|
3
3
|
//#region src/enums/date.d.ts
|
|
4
4
|
declare const DATE_FORMAT: {
|
|
@@ -209,4 +209,4 @@ declare const THEME_MODE_ENUM: {
|
|
|
209
209
|
};
|
|
210
210
|
//#endregion
|
|
211
211
|
export { MIME as a, DATE_FORMAT as c, THEME_TYPE as i, THEME_MODE_ENUM as n, BREAK_POINT_TOKEN_ENUM as o, THEME_MODE_TYPE as r, BREAK_POINT_TOKEN_TYPE as s, THEME_ENUM as t };
|
|
212
|
-
//# sourceMappingURL=index-
|
|
212
|
+
//# sourceMappingURL=index-CN5K25yO.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-CN5K25yO.d.ts","names":[],"sources":["../src/enums/date.ts","../src/enums/grid.ts","../src/enums/mime.ts","../src/enums/theme.ts"],"sourcesContent":[],"mappings":";;;cAAa;;;EAAA,SAAA,aAmDH,EAAA,qBAAA;;;;ECnDE,SAAA,OAAA,EAAA,YAAsB;EAErB,SAAA,YAAA,EAAA,qBA2BH;;;;ECzBG,SA+HH,OAAA,EAAA,aAAA;;;;ECjIE,SAAA,UAAU,EAAA,UAAkB;EAC3B,SAAA,gBAGH,EAAA,UAAA;EAEE,SAAA,SAAe,EAAA,OAAA;EACd,SAAA,YAIH,EAAA,QAAA;;;;;;;;;;;;;;;;KFbE,sBAAA,GAAyB,oBAAoB;;cAE5C;EDFA,SAAA,EAAA,EAAA,GAmDH;;;;ECnDE,SAAA,KAAA,EAAA,GAAA;EAEC,SAAA,KAAA,EAAA,GAAA;;;;ECEA,SA+HH,EAAA,EAAA,GAAA;;;;ECjIE,SAAA,KAAU,EAAA,IAAA;EACT,SAAA,KAGH,EAAA,IAAA;EAEE,SAAA,GAAA,EAAA,IAAe;EACd,SAAA,MAAA,EAAA,IAIH;;;;;;;;;;AHbV;cEIa;;;EDJD;EAEC,SAAA,IAAA,EAAA,WA2BH;;;;ECzBG,SA+HH,GAAA,EAAA,UAAA;;;;ECjIE,SAAA,GAAA,EAAU,UAAA;EACT;EAKD,SAAA,KAAA,EAAA,uBAAiC;EAChC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAPD,UAAA,GAAa,eAAe;cAC3B;EHHA,SAAA,KAmDH,EAAA,OAAA;;;KG3CE,eAAA,GAAkB,eAAe;AFRjC,cESC,eFTqB,EAAA;EAErB,SAAA,KAAA,EAAA,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-DBPmnr4a.d.ts","names":["Split","TupleToUnion","ALPHABET","Alphabet","ValidChar","ApiNameCheck","N","P","R","L","AdvancedRecordMode","AdvancedRecord","K","A","mode","PropertyKey","AnyObject","T","Record","PlainObject","TreeLike","CK","AnyFunction","R$1","AnyAsyncFunction","Promise","AnyGeneratorFunction","Generator","AnyAsyncGeneratorFunction","AsyncGenerator"],"sources":["../node_modules/.pnpm/@pawover+types@0.0.0-alpha._d6a4faea50420a71bc77e0a59520b8b6/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/advancedRecord.d.ts\ntype AdvancedRecordMode = [\"?\" | \"!\", \"W\" | \"R\"];\ntype AdvancedRecord<K extends PropertyKey, A = unknown, mode extends AdvancedRecordMode = [\"!\", \"W\"]> = {\n \"!\": {\n R: { readonly [P in K]: A };\n W: { [P in K]: A };\n };\n \"?\": {\n R: { readonly [P in K]?: A };\n W: { [P in K]?: A };\n };\n}[mode[0]][mode[1]];\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 { AdvancedRecord, AdvancedRecordMode, AnyAsyncFunction, AnyAsyncGeneratorFunction, AnyFunction, AnyGeneratorFunction, AnyObject, type ApiNameCheck, PlainObject, TreeLike };\n//# sourceMappingURL=index.d.ts.map"],"x_google_ignoreList":[0],"mappings":";;AA+B+E;AAEN;;KANpEgB,SAQ+EO,CAAAA,UAR3DR,WAQ2DQ,GAR7CR,WAQ6CQ,EAAAA,IAAAA,GAAAA,CAAAA,GARrBL,MAQqBK,CARdX,CAQcW,EARXN,CAQWM,CAAAA;;KAN/EJ,WAM8E,CAAA,UANxDJ,WAMwD,GAN1CA,WAM0C,EAAA,IAAA,OAAA,CAAA,GANdG,MAMc,CANPN,CAMO,EANJK,CAMI,CAAA;AAAA;KAJ9EG,QAKuFb,CAAAA,UALpES,SAKoET,EAAAA,WAAAA,MAAAA,GAAAA,UAAAA,CAAAA,GALvBU,CAKuBV,GALnBW,MAKmBX,CALZc,EAKYd,EALRa,QAKQb,CALCU,CAKDV,EALIc,EAKJd,CAAAA,EAAAA,CAAAA;;KAHvFe,WAG0GC,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,GAAAA,EAH/ChB,CAG+CgB,EAAAA,GAHzCA,GAGyCA;;KAD1GC,gBAC6FG,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,IAAAA,EAD5BpB,CAC4BoB,EAAAA,GADtBF,OACsBE,CADdJ,GACcI,CAAAA;KAA7FD,oBAAsG,CAAA,UAAA,GAAA,EAAA,GAAA,GAAA,EAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAAfnB,CAAe,EAAA,GAAToB,SAAS,CAACV,CAAD,EAAIM,GAAJ,EAASjB,CAAT,CAAA;AAAA,KACtGsB,yBAAAA,CAAAA,
|
|
1
|
+
{"version":3,"file":"index-DBPmnr4a.d.ts","names":["Split","TupleToUnion","ALPHABET","Alphabet","ValidChar","ApiNameCheck","N","P","R","L","AdvancedRecordMode","AdvancedRecord","K","A","mode","PropertyKey","AnyObject","T","Record","PlainObject","TreeLike","CK","AnyFunction","R$1","AnyAsyncFunction","Promise","AnyGeneratorFunction","Generator","AnyAsyncGeneratorFunction","AsyncGenerator"],"sources":["../node_modules/.pnpm/@pawover+types@0.0.0-alpha._d6a4faea50420a71bc77e0a59520b8b6/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/advancedRecord.d.ts\ntype AdvancedRecordMode = [\"?\" | \"!\", \"W\" | \"R\"];\ntype AdvancedRecord<K extends PropertyKey, A = unknown, mode extends AdvancedRecordMode = [\"!\", \"W\"]> = {\n \"!\": {\n R: { readonly [P in K]: A };\n W: { [P in K]: A };\n };\n \"?\": {\n R: { readonly [P in K]?: A };\n W: { [P in K]?: A };\n };\n}[mode[0]][mode[1]];\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 { AdvancedRecord, AdvancedRecordMode, AnyAsyncFunction, AnyAsyncGeneratorFunction, AnyFunction, AnyGeneratorFunction, AnyObject, type ApiNameCheck, PlainObject, TreeLike };\n//# sourceMappingURL=index.d.ts.map"],"x_google_ignoreList":[0],"mappings":";;AA+B+E;AAEN;;KANpEgB,SAQ+EO,CAAAA,UAR3DR,WAQ2DQ,GAR7CR,WAQ6CQ,EAAAA,IAAAA,GAAAA,CAAAA,GARrBL,MAQqBK,CARdX,CAQcW,EARXN,CAQWM,CAAAA;;KAN/EJ,WAM8E,CAAA,UANxDJ,WAMwD,GAN1CA,WAM0C,EAAA,IAAA,OAAA,CAAA,GANdG,MAMc,CANPN,CAMO,EANJK,CAMI,CAAA;AAAA;KAJ9EG,QAKuFb,CAAAA,UALpES,SAKoET,EAAAA,WAAAA,MAAAA,GAAAA,UAAAA,CAAAA,GALvBU,CAKuBV,GALnBW,MAKmBX,CALZc,EAKYd,EALRa,QAKQb,CALCU,CAKDV,EALIc,EAKJd,CAAAA,EAAAA,CAAAA;;KAHvFe,WAG0GC,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,GAAAA,EAH/ChB,CAG+CgB,EAAAA,GAHzCA,GAGyCA;;KAD1GC,gBAC6FG,CAAAA,UAAAA,GAAAA,EAAAA,GAAAA,GAAAA,EAAAA,EAAAA,MAAAA,GAAAA,CAAAA,GAAAA,CAAAA,GAAAA,IAAAA,EAD5BpB,CAC4BoB,EAAAA,GADtBF,OACsBE,CADdJ,GACcI,CAAAA;KAA7FD,oBAAsG,CAAA,UAAA,GAAA,EAAA,GAAA,GAAA,EAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAAfnB,CAAe,EAAA,GAAToB,SAAS,CAACV,CAAD,EAAIM,GAAJ,EAASjB,CAAT,CAAA;AAAA,KACtGsB,yBAAAA,CAAAA,UAAyBX,GAAAM,EAAAA,GAAAjB,GAAAA,EAAAA,EAAA,IAAA,GAAA,EAAA,MAAA,GAAA,EAAA,IAAA,GAAA,CAAA,GAAA,CAAA,GAAA,IAAA,EAAmEC,CAAnE,EAAA,GAAyEsB,cAAzE,CAAwFZ,CAAxF,EAA2FM,GAA3F,EAAgGjB,CAAhG,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { t as ValueOf } from "./value-of-
|
|
1
|
+
import { a as IsEqual, c as IsExactOptionalPropertyTypesEnabled, d as If, f as IsNever, h as UnionToIntersection, i as HomomorphicPick, l as Not, m as IsAny, n as ApplyDefaultOptions, o as Simplify, p as OptionalKeysOf, r as CollapseLiterals, s as IfNotAnyOrNever, t as Except, u as UnknownArray } from "./except-C_xUtgFe.js";
|
|
2
|
+
import { t as ValueOf } from "./value-of-DPr10cdW.js";
|
|
3
3
|
import { a as AnyObject, i as AnyGeneratorFunction, n as AnyAsyncGeneratorFunction, o as PlainObject, r as AnyFunction, s as TreeLike, t as AnyAsyncFunction } from "./index-DBPmnr4a.js";
|
|
4
4
|
import { clone, cloneDeep, cloneDeepWith } from "lodash-es";
|
|
5
5
|
import { BigNumber, MathExpression, MathJsInstance, Matrix } from "mathjs";
|
|
6
6
|
|
|
7
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
7
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/basic.d.ts
|
|
8
8
|
/**
|
|
9
9
|
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
|
|
10
10
|
|
|
@@ -15,7 +15,7 @@ type Class<T, Arguments extends unknown[] = any[]> = {
|
|
|
15
15
|
new (...arguments_: Arguments): T;
|
|
16
16
|
};
|
|
17
17
|
//#endregion
|
|
18
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
18
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/internal/array.d.ts
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
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.
|
|
@@ -59,7 +59,7 @@ type _CollapseRestElement<TArray extends UnknownArray, ForwardAccumulator extend
|
|
|
59
59
|
: First], BackwardAccumulator> : never // Should never happen, since `[(infer First)?, ...infer Rest]` is a top-type for arrays.
|
|
60
60
|
: never; // Should never happen
|
|
61
61
|
//#endregion
|
|
62
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
62
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/numeric.d.ts
|
|
63
63
|
type _Numeric = number | bigint;
|
|
64
64
|
type Zero = 0 | 0n;
|
|
65
65
|
|
|
@@ -106,7 +106,7 @@ type IsNegative<T extends _Numeric> = T extends Negative<T> ? true : false;
|
|
|
106
106
|
//#region node_modules/.pnpm/tagged-tag@1.0.0/node_modules/tagged-tag/index.d.ts
|
|
107
107
|
declare const tag: unique symbol;
|
|
108
108
|
//#endregion
|
|
109
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
109
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/tagged.d.ts
|
|
110
110
|
// eslint-disable-next-line type-fest/require-exported-types
|
|
111
111
|
type TagContainer<Token> = {
|
|
112
112
|
readonly [tag]: Token;
|
|
@@ -197,7 +197,7 @@ const moneyByAccountType: Record<UnwrapTagged<AccountType>, number> = {
|
|
|
197
197
|
// Without UnwrapTagged, the following expression would throw a type error.
|
|
198
198
|
const money = moneyByAccountType.SAVINGS; // TS error: Property 'SAVINGS' does not exist
|
|
199
199
|
|
|
200
|
-
// Attempting to pass
|
|
200
|
+
// Attempting to pass a non-Tagged type to UnwrapTagged will raise a type error.
|
|
201
201
|
// @ts-expect-error
|
|
202
202
|
type WontWork = UnwrapTagged<string>;
|
|
203
203
|
```
|
|
@@ -282,7 +282,7 @@ type Person = {
|
|
|
282
282
|
@deprecated Use {@link Tagged} instead
|
|
283
283
|
*/
|
|
284
284
|
//#endregion
|
|
285
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
285
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/is-literal.d.ts
|
|
286
286
|
/**
|
|
287
287
|
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).
|
|
288
288
|
|
|
@@ -345,7 +345,7 @@ type _IsStringLiteral<S> =
|
|
|
345
345
|
// and since `{}` extends index signatures, the result becomes `false`.
|
|
346
346
|
S extends string ? {} extends Record<S, never> ? false : true : false;
|
|
347
347
|
//#endregion
|
|
348
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
348
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/tuple-of.d.ts
|
|
349
349
|
/**
|
|
350
350
|
Create a tuple type of the specified length with elements of the specified type.
|
|
351
351
|
|
|
@@ -413,7 +413,162 @@ Note: If you need a readonly tuple, simply wrap this type with `Readonly`, for e
|
|
|
413
413
|
type TupleOf<Length extends number, Fill = unknown> = IfNotAnyOrNever<Length, _TupleOf<If<IsNegative<Length>, 0, Length>, Fill, []>, Fill[], []>;
|
|
414
414
|
type _TupleOf<L extends number, Fill, Accumulator extends UnknownArray> = number extends L ? Fill[] : L extends Accumulator['length'] ? Accumulator : _TupleOf<L, Fill, [...Accumulator, Fill]>;
|
|
415
415
|
//#endregion
|
|
416
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
416
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/some-extend.d.ts
|
|
417
|
+
/**
|
|
418
|
+
@see {@link SomeExtend}
|
|
419
|
+
*/
|
|
420
|
+
type SomeExtendOptions = {
|
|
421
|
+
/**
|
|
422
|
+
Consider `never` elements to match the target type only if the target type itself is `never` (or `any`).
|
|
423
|
+
- When set to `true` (default), `never` is _not_ treated as a bottom type, instead, it is treated as a type that matches only itself (or `any`).
|
|
424
|
+
- When set to `false`, `never` is treated as a bottom type, and behaves as it normally would.
|
|
425
|
+
@default true
|
|
426
|
+
@example
|
|
427
|
+
```
|
|
428
|
+
import type {SomeExtend} from 'type-fest';
|
|
429
|
+
type A = SomeExtend<[1, 2, never], string, {strictNever: true}>;
|
|
430
|
+
//=> false
|
|
431
|
+
type B = SomeExtend<[1, 2, never], string, {strictNever: false}>;
|
|
432
|
+
//=> true
|
|
433
|
+
type C = SomeExtend<[1, never], never, {strictNever: true}>;
|
|
434
|
+
//=> true
|
|
435
|
+
type D = SomeExtend<[1, never], never, {strictNever: false}>;
|
|
436
|
+
//=> true
|
|
437
|
+
type E = SomeExtend<[never], any, {strictNever: true}>;
|
|
438
|
+
//=> true
|
|
439
|
+
type F = SomeExtend<[never], any, {strictNever: false}>;
|
|
440
|
+
//=> true
|
|
441
|
+
```
|
|
442
|
+
*/
|
|
443
|
+
strictNever?: boolean;
|
|
444
|
+
};
|
|
445
|
+
type DefaultSomeExtendOptions = {
|
|
446
|
+
strictNever: true;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
/**
|
|
450
|
+
Returns a boolean for whether some element in an array type extends another type.
|
|
451
|
+
|
|
452
|
+
@example
|
|
453
|
+
```
|
|
454
|
+
import type {SomeExtend} from 'type-fest';
|
|
455
|
+
|
|
456
|
+
type A = SomeExtend<['1', '2', 3], number>;
|
|
457
|
+
//=> true
|
|
458
|
+
|
|
459
|
+
type B = SomeExtend<[1, 2, 3], string>;
|
|
460
|
+
//=> false
|
|
461
|
+
|
|
462
|
+
type C = SomeExtend<[string, number | string], number>;
|
|
463
|
+
//=> boolean
|
|
464
|
+
|
|
465
|
+
type D = SomeExtend<[true, boolean, true], false>;
|
|
466
|
+
//=> boolean
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
Note: Behaviour of optional elements depend on the `exactOptionalPropertyTypes` compiler option. When the option is disabled, the target type must include `undefined` for a successful match.
|
|
470
|
+
|
|
471
|
+
```
|
|
472
|
+
// @exactOptionalPropertyTypes: true
|
|
473
|
+
import type {SomeExtend} from 'type-fest';
|
|
474
|
+
|
|
475
|
+
type A = SomeExtend<[1?, 2?, '3'?], string>;
|
|
476
|
+
//=> true
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
// @exactOptionalPropertyTypes: false
|
|
481
|
+
import type {SomeExtend} from 'type-fest';
|
|
482
|
+
|
|
483
|
+
type A = SomeExtend<[1?, 2?, '3'?], string>;
|
|
484
|
+
//=> boolean
|
|
485
|
+
|
|
486
|
+
type B = SomeExtend<[1?, 2?, '3'?], string | undefined>;
|
|
487
|
+
//=> true
|
|
488
|
+
```
|
|
489
|
+
|
|
490
|
+
@see {@link SomeExtendOptions}
|
|
491
|
+
|
|
492
|
+
@category Utilities
|
|
493
|
+
@category Array
|
|
494
|
+
*/
|
|
495
|
+
type SomeExtend<TArray extends UnknownArray, Type$1, Options extends SomeExtendOptions = {}> = _SomeExtend<CollapseRestElement<TArray>, Type$1, ApplyDefaultOptions<SomeExtendOptions, DefaultSomeExtendOptions, Options>>;
|
|
496
|
+
type _SomeExtend<TArray extends UnknownArray, Type$1, Options extends Required<SomeExtendOptions>> = IfNotAnyOrNever<TArray, TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type$1>, IsAny<Type$1>>, Not<Options['strictNever']>> extends true
|
|
497
|
+
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, return `true`.
|
|
498
|
+
? true : _SomeExtend<Rest, Type$1, Options> : First extends Type$1 ? true : _SomeExtend<Rest, Type$1, Options> : false, false, false>;
|
|
499
|
+
//#endregion
|
|
500
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/or-all.d.ts
|
|
501
|
+
/**
|
|
502
|
+
Returns a boolean for whether any of the given elements is `true`.
|
|
503
|
+
|
|
504
|
+
Use-cases:
|
|
505
|
+
- Check if at least one condition in a list of booleans is met.
|
|
506
|
+
|
|
507
|
+
@example
|
|
508
|
+
```
|
|
509
|
+
import type {OrAll} from 'type-fest';
|
|
510
|
+
|
|
511
|
+
type FFT = OrAll<[false, false, true]>;
|
|
512
|
+
//=> true
|
|
513
|
+
|
|
514
|
+
type FFF = OrAll<[false, false, false]>;
|
|
515
|
+
//=> false
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Note: When `boolean` is passed as an element, it is distributed into separate cases, and the final result is a union of those cases.
|
|
519
|
+
For example, `OrAll<[false, boolean]>` expands to `OrAll<[false, true]> | OrAll<[false, false]>`, which simplifies to `true | false` (i.e., `boolean`).
|
|
520
|
+
|
|
521
|
+
@example
|
|
522
|
+
```
|
|
523
|
+
import type {OrAll} from 'type-fest';
|
|
524
|
+
|
|
525
|
+
type A = OrAll<[false, boolean]>;
|
|
526
|
+
//=> boolean
|
|
527
|
+
|
|
528
|
+
type B = OrAll<[true, boolean]>;
|
|
529
|
+
//=> true
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
Note: If `never` is passed as an element, it is treated as `false` and the result is computed accordingly.
|
|
533
|
+
|
|
534
|
+
@example
|
|
535
|
+
```
|
|
536
|
+
import type {OrAll} from 'type-fest';
|
|
537
|
+
|
|
538
|
+
type A = OrAll<[never, never, true]>;
|
|
539
|
+
//=> true
|
|
540
|
+
|
|
541
|
+
type B = OrAll<[never, never, false]>;
|
|
542
|
+
//=> false
|
|
543
|
+
|
|
544
|
+
type C = OrAll<[never, never, never]>;
|
|
545
|
+
//=> false
|
|
546
|
+
|
|
547
|
+
type D = OrAll<[never, never, boolean]>;
|
|
548
|
+
//=> boolean
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
Note: If `any` is passed as an element, it is treated as `boolean` and the result is computed accordingly.
|
|
552
|
+
|
|
553
|
+
@example
|
|
554
|
+
```
|
|
555
|
+
import type {OrAll} from 'type-fest';
|
|
556
|
+
|
|
557
|
+
type A = OrAll<[false, any]>;
|
|
558
|
+
//=> boolean
|
|
559
|
+
|
|
560
|
+
type B = OrAll<[true, any]>;
|
|
561
|
+
//=> true
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
Note: `OrAll<[]>` evaluates to `false` because there are no `true` elements in an empty tuple. See [Wikipedia: Clause (logic) > Empty clauses](https://en.wikipedia.org/wiki/Clause_(logic)#Empty_clauses:~:text=The%20truth%20evaluation%20of%20an%20empty%20disjunctive%20clause%20is%20always%20false.).
|
|
565
|
+
|
|
566
|
+
@see {@link Or}
|
|
567
|
+
@see {@link AndAll}
|
|
568
|
+
*/
|
|
569
|
+
type OrAll<T extends readonly boolean[]> = SomeExtend<T, true>;
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/or.d.ts
|
|
417
572
|
/**
|
|
418
573
|
Returns a boolean for whether either of two given types is true.
|
|
419
574
|
|
|
@@ -487,15 +642,13 @@ type G = Or<never, never>;
|
|
|
487
642
|
//=> false
|
|
488
643
|
```
|
|
489
644
|
|
|
645
|
+
@see {@link OrAll}
|
|
490
646
|
@see {@link And}
|
|
491
647
|
@see {@link Xor}
|
|
492
648
|
*/
|
|
493
|
-
type Or<A$1 extends boolean, B$1 extends boolean> =
|
|
494
|
-
// `never` is treated as `false`
|
|
495
|
-
|
|
496
|
-
type _Or<A$1 extends boolean, B$1 extends boolean> = A$1 extends true ? true : B$1 extends true ? true : false;
|
|
649
|
+
type Or<A$1 extends boolean, B$1 extends boolean> = OrAll<[A$1, B$1]>;
|
|
497
650
|
//#endregion
|
|
498
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
651
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/all-extend.d.ts
|
|
499
652
|
/**
|
|
500
653
|
@see {@link AllExtend}
|
|
501
654
|
*/
|
|
@@ -579,11 +732,85 @@ type B = AllExtend<[1?, 2?, 3?], number | undefined>;
|
|
|
579
732
|
@category Array
|
|
580
733
|
*/
|
|
581
734
|
type AllExtend<TArray extends UnknownArray, Type$1, Options extends AllExtendOptions = {}> = _AllExtend<CollapseRestElement<TArray>, Type$1, ApplyDefaultOptions<AllExtendOptions, DefaultAllExtendOptions, Options>>;
|
|
582
|
-
type _AllExtend<TArray extends UnknownArray, Type$1, Options extends Required<AllExtendOptions>> = IfNotAnyOrNever<TArray,
|
|
583
|
-
// If target `Type` is also `never`
|
|
584
|
-
? _AllExtend<Rest, Type$1, Options> : false : First extends Type$1 ? _AllExtend<Rest, Type$1, Options> : false : true
|
|
735
|
+
type _AllExtend<TArray extends UnknownArray, Type$1, Options extends Required<AllExtendOptions>> = IfNotAnyOrNever<TArray, TArray extends readonly [infer First, ...infer Rest] ? IsNever<First> extends true ? Or<Or<IsNever<Type$1>, IsAny<Type$1>>, Not<Options['strictNever']>> extends true
|
|
736
|
+
// If target `Type` is also `never`, or is `any`, or `strictNever` is disabled, recurse further.
|
|
737
|
+
? _AllExtend<Rest, Type$1, Options> : false : First extends Type$1 ? _AllExtend<Rest, Type$1, Options> : false : true, false, false>;
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/and-all.d.ts
|
|
740
|
+
/**
|
|
741
|
+
Returns a boolean for whether all of the given elements are `true`.
|
|
742
|
+
|
|
743
|
+
Use-cases:
|
|
744
|
+
- Check if all conditions in a list of booleans are met.
|
|
745
|
+
|
|
746
|
+
@example
|
|
747
|
+
```
|
|
748
|
+
import type {AndAll} from 'type-fest';
|
|
749
|
+
|
|
750
|
+
type TTT = AndAll<[true, true, true]>;
|
|
751
|
+
//=> true
|
|
752
|
+
|
|
753
|
+
type TTF = AndAll<[true, true, false]>;
|
|
754
|
+
//=> false
|
|
755
|
+
|
|
756
|
+
type TFT = AndAll<[true, false, true]>;
|
|
757
|
+
//=> false
|
|
758
|
+
```
|
|
759
|
+
|
|
760
|
+
Note: When `boolean` is passed as an element, it is distributed into separate cases, and the final result is a union of those cases.
|
|
761
|
+
For example, `AndAll<[true, boolean]>` expands to `AndAll<[true, true]> | AndAll<[true, false]>`, which simplifies to `true | false` (i.e., `boolean`).
|
|
762
|
+
|
|
763
|
+
@example
|
|
764
|
+
```
|
|
765
|
+
import type {AndAll} from 'type-fest';
|
|
766
|
+
|
|
767
|
+
type A = AndAll<[true, boolean]>;
|
|
768
|
+
//=> boolean
|
|
769
|
+
|
|
770
|
+
type B = AndAll<[false, boolean]>;
|
|
771
|
+
//=> false
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
Note: If any of the elements is `never`, the result becomes `false`.
|
|
775
|
+
|
|
776
|
+
@example
|
|
777
|
+
```
|
|
778
|
+
import type {AndAll} from 'type-fest';
|
|
779
|
+
|
|
780
|
+
type A = AndAll<[true, true, never]>;
|
|
781
|
+
//=> false
|
|
782
|
+
|
|
783
|
+
type B = AndAll<[false, never, never]>;
|
|
784
|
+
//=> false
|
|
785
|
+
|
|
786
|
+
type C = AndAll<[never, never, never]>;
|
|
787
|
+
//=> false
|
|
788
|
+
|
|
789
|
+
type D = AndAll<[boolean, true, never]>;
|
|
790
|
+
//=> false
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
Note: If `any` is passed as an element, it is treated as `boolean` and the result is computed accordingly.
|
|
794
|
+
|
|
795
|
+
@example
|
|
796
|
+
```
|
|
797
|
+
import type {AndAll} from 'type-fest';
|
|
798
|
+
|
|
799
|
+
type A = AndAll<[false, any]>;
|
|
800
|
+
//=> false
|
|
801
|
+
|
|
802
|
+
type B = AndAll<[true, any]>;
|
|
803
|
+
//=> boolean
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
Note: `AndAll<[]>` evaluates to `true` due to the concept of [vacuous truth](https://en.wikipedia.org/wiki/Logical_conjunction#:~:text=In%20keeping%20with%20the%20concept%20of%20vacuous%20truth%2C%20when%20conjunction%20is%20defined%20as%20an%20operator%20or%20function%20of%20arbitrary%20arity%2C%20the%20empty%20conjunction%20(AND%2Ding%20over%20an%20empty%20set%20of%20operands)%20is%20often%20defined%20as%20having%20the%20result%20true.), i.e., there are no `false` elements in an empty tuple.
|
|
807
|
+
|
|
808
|
+
@see {@link And}
|
|
809
|
+
@see {@link OrAll}
|
|
810
|
+
*/
|
|
811
|
+
type AndAll<T extends readonly boolean[]> = AllExtend<T, true>;
|
|
585
812
|
//#endregion
|
|
586
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
813
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/and.d.ts
|
|
587
814
|
/**
|
|
588
815
|
Returns a boolean for whether two given types are both true.
|
|
589
816
|
|
|
@@ -657,23 +884,111 @@ type G = And<never, never>;
|
|
|
657
884
|
//=> false
|
|
658
885
|
```
|
|
659
886
|
|
|
887
|
+
@see {@link AndAll}
|
|
660
888
|
@see {@link Or}
|
|
661
889
|
@see {@link Xor}
|
|
662
890
|
*/
|
|
663
|
-
type And<A$1 extends boolean, B$1 extends boolean> =
|
|
891
|
+
type And<A$1 extends boolean, B$1 extends boolean> = AndAll<[A$1, B$1]>;
|
|
664
892
|
//#endregion
|
|
665
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
893
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/exclude-exactly.d.ts
|
|
666
894
|
/**
|
|
667
|
-
|
|
895
|
+
A stricter version of `Exclude<T, U>` that excludes types only when they are exactly identical.
|
|
668
896
|
|
|
669
897
|
@example
|
|
670
898
|
```
|
|
671
|
-
type
|
|
672
|
-
|
|
899
|
+
import type {ExcludeExactly} from 'type-fest';
|
|
900
|
+
|
|
901
|
+
type TestExclude1 = Exclude<'a' | 'b' | 'c' | 1 | 2 | 3, string>;
|
|
902
|
+
//=> 1 | 2 | 3
|
|
903
|
+
|
|
904
|
+
type TestExcludeExactly1 = ExcludeExactly<'a' | 'b' | 'c' | 1 | 2 | 3, string>;
|
|
905
|
+
//=> 'a' | 'b' | 'c' | 1 | 2 | 3
|
|
906
|
+
|
|
907
|
+
type TestExclude2 = Exclude<'a' | 'b' | 'c' | 1 | 2 | 3, any>;
|
|
908
|
+
//=> never
|
|
909
|
+
|
|
910
|
+
type TestExcludeExactly2 = ExcludeExactly<'a' | 'b' | 'c' | 1 | 2 | 3, any>;
|
|
911
|
+
//=> 'a' | 'b' | 'c' | 1 | 2 | 3
|
|
912
|
+
|
|
913
|
+
type TestExclude3 = Exclude<{a: string} | {a: string; b: string}, {a: string}>;
|
|
914
|
+
//=> never
|
|
915
|
+
|
|
916
|
+
type TestExcludeExactly3 = ExcludeExactly<{a: string} | {a: string; b: string}, {a: string}>;
|
|
917
|
+
//=> {a: string; b: string}
|
|
673
918
|
```
|
|
919
|
+
|
|
920
|
+
@category Improved Built-in
|
|
674
921
|
*/
|
|
675
|
-
type
|
|
922
|
+
type ExcludeExactly<Union, Delete> = IfNotAnyOrNever<Union, _ExcludeExactly<Union, Delete>,
|
|
923
|
+
// If `Union` is `any`, then if `Delete` is `any`, return `never`, else return `Union`.
|
|
924
|
+
If<IsAny<Delete>, never, Union>,
|
|
925
|
+
// If `Union` is `never`, then if `Delete` is `never`, return `never`, else return `Union`.
|
|
926
|
+
If<IsNever<Delete>, never, Union>>;
|
|
927
|
+
type _ExcludeExactly<Union, Delete> = IfNotAnyOrNever<Delete, Union extends unknown // For distributing `Union`
|
|
928
|
+
? [Delete extends unknown // For distributing `Delete`
|
|
929
|
+
? If<IsEqual<Union, Delete>, true, never> : never] extends [never] ? Union : never : never,
|
|
930
|
+
// If `Delete` is `any` or `never`, then return `Union`,
|
|
931
|
+
// because `Union` cannot be `any` or `never` here.
|
|
932
|
+
Union, Union>;
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/union-member.d.ts
|
|
935
|
+
/**
|
|
936
|
+
Returns an arbitrary member of a union type.
|
|
937
|
+
|
|
938
|
+
Use-cases:
|
|
939
|
+
- Implementing recursive type functions that accept a union type.
|
|
940
|
+
|
|
941
|
+
@example
|
|
942
|
+
```
|
|
943
|
+
import type {UnionMember, IsNever} from 'type-fest';
|
|
944
|
+
|
|
945
|
+
type UnionLength<T, Acc extends any[] = []> =
|
|
946
|
+
UnionMember<T> extends infer Member
|
|
947
|
+
? IsNever<Member> extends false
|
|
948
|
+
? UnionLength<Exclude<T, Member>, [...Acc, Member]>
|
|
949
|
+
: Acc['length']
|
|
950
|
+
: never;
|
|
951
|
+
|
|
952
|
+
type T1 = UnionLength<'foo' | 'bar' | 'baz'>;
|
|
953
|
+
//=> 3
|
|
954
|
+
|
|
955
|
+
type T2 = UnionLength<{a: string}>;
|
|
956
|
+
//=> 1
|
|
957
|
+
```
|
|
958
|
+
|
|
959
|
+
- Picking an arbitrary member from a union
|
|
960
|
+
|
|
961
|
+
@example
|
|
962
|
+
```
|
|
963
|
+
import type {UnionMember, Primitive, LiteralToPrimitive} from 'type-fest';
|
|
964
|
+
|
|
965
|
+
type IsHomogenous<T extends Primitive> = [T] extends [LiteralToPrimitive<UnionMember<T>>] ? true : false;
|
|
966
|
+
|
|
967
|
+
type T1 = IsHomogenous<1 | 2 | 3 | 4>;
|
|
968
|
+
//=> true
|
|
969
|
+
|
|
970
|
+
type T2 = IsHomogenous<'foo' | 'bar'>;
|
|
971
|
+
//=> true
|
|
676
972
|
|
|
973
|
+
type T3 = IsHomogenous<'foo' | 'bar' | 1>;
|
|
974
|
+
//=> false
|
|
975
|
+
```
|
|
976
|
+
|
|
977
|
+
Returns `never` when the input is `never`.
|
|
978
|
+
|
|
979
|
+
@example
|
|
980
|
+
```
|
|
981
|
+
import type {UnionMember} from 'type-fest';
|
|
982
|
+
|
|
983
|
+
type LastNever = UnionMember<never>;
|
|
984
|
+
//=> never
|
|
985
|
+
```
|
|
986
|
+
|
|
987
|
+
@category Type
|
|
988
|
+
*/
|
|
989
|
+
type UnionMember<T> = IsNever<T> extends true ? never : UnionToIntersection<T extends any ? () => T : never> extends (() => (infer R)) ? R : never;
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/union-to-tuple.d.ts
|
|
677
992
|
/**
|
|
678
993
|
Convert a union type into an unordered tuple type of its elements.
|
|
679
994
|
|
|
@@ -709,9 +1024,9 @@ const petList = Object.keys(pets) as UnionToTuple<Pet>;
|
|
|
709
1024
|
|
|
710
1025
|
@category Array
|
|
711
1026
|
*/
|
|
712
|
-
type UnionToTuple<T, L =
|
|
1027
|
+
type UnionToTuple<T, L = UnionMember<T>> = IsNever<T> extends false ? [...UnionToTuple<ExcludeExactly<T, L>>, L] : [];
|
|
713
1028
|
//#endregion
|
|
714
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
1029
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/set-optional.d.ts
|
|
715
1030
|
/**
|
|
716
1031
|
Create a type that makes the given keys optional. The remaining keys are kept as is. The sister of the `SetRequired` type.
|
|
717
1032
|
|
|
@@ -728,11 +1043,7 @@ type Foo = {
|
|
|
728
1043
|
};
|
|
729
1044
|
|
|
730
1045
|
type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
|
|
731
|
-
|
|
732
|
-
// a: number;
|
|
733
|
-
// b?: string; // Was already optional and still is.
|
|
734
|
-
// c?: boolean; // Is now optional.
|
|
735
|
-
// }
|
|
1046
|
+
//=> {a: number; b?: string; c?: boolean}
|
|
736
1047
|
```
|
|
737
1048
|
|
|
738
1049
|
@category Object
|
|
@@ -745,7 +1056,7 @@ Except<BaseType, Keys> &
|
|
|
745
1056
|
// Pick the keys that should be mutable from the base type and make them mutable.
|
|
746
1057
|
Partial<HomomorphicPick<BaseType, Keys>>> : never;
|
|
747
1058
|
//#endregion
|
|
748
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
1059
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/split.d.ts
|
|
749
1060
|
/**
|
|
750
1061
|
Split options.
|
|
751
1062
|
|
|
@@ -804,7 +1115,7 @@ type SplitHelper<S extends string, Delimiter extends string, Options extends Req
|
|
|
804
1115
|
: string[] : never // Should never happen
|
|
805
1116
|
: never; // Should never happen
|
|
806
1117
|
//#endregion
|
|
807
|
-
//#region node_modules/.pnpm/type-fest@5.
|
|
1118
|
+
//#region node_modules/.pnpm/type-fest@5.5.0/node_modules/type-fest/source/replace.d.ts
|
|
808
1119
|
type ReplaceOptions = {
|
|
809
1120
|
all?: boolean;
|
|
810
1121
|
};
|