@sinclair/typebox 0.32.0-dev-12 → 0.32.0-dev-13
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/build/import/index.d.mts +5 -5
- package/build/import/index.mjs +3 -3
- package/build/import/type/composite/composite.d.mts +2 -2
- package/build/import/type/extends/extends-mapped-result-from-result.d.mts +13 -0
- package/build/import/type/extends/extends-mapped-result-from-result.mjs +14 -0
- package/build/import/type/extends/extends-mapped-result.d.mts +13 -9
- package/build/import/type/extends/extends-mapped-result.mjs +15 -8
- package/build/import/type/extends/extends.d.mts +4 -4
- package/build/import/type/extends/extends.mjs +4 -4
- package/build/import/type/extends/index.d.mts +1 -1
- package/build/import/type/extends/index.mjs +1 -1
- package/build/import/type/indexed/index.d.mts +2 -2
- package/build/import/type/indexed/index.mjs +2 -2
- package/build/import/type/indexed/{indexed-mapped.d.mts → indexed-mapped-result.d.mts} +4 -4
- package/build/import/type/indexed/{indexed-mapped.mjs → indexed-mapped-result.mjs} +3 -3
- package/build/import/type/indexed/indexed-property-keys.d.mts +3 -3
- package/build/import/type/indexed/indexed-property-keys.mjs +2 -2
- package/build/import/type/indexed/{indexed-type.d.mts → indexed-result.d.mts} +2 -2
- package/build/import/type/indexed/{indexed-type.mjs → indexed-result.mjs} +1 -1
- package/build/import/type/indexed/indexed.d.mts +6 -6
- package/build/import/type/indexed/indexed.mjs +6 -6
- package/build/import/type/intrinsic/capitalize.d.mts +4 -0
- package/build/import/type/intrinsic/capitalize.mjs +5 -0
- package/build/import/type/intrinsic/index.d.mts +5 -0
- package/build/import/type/intrinsic/index.mjs +5 -0
- package/build/import/type/intrinsic/intrinsic-mapped-result.d.mts +15 -0
- package/build/import/type/intrinsic/intrinsic-mapped-result.mjs +21 -0
- package/build/import/type/intrinsic/intrinsic.d.mts +9 -14
- package/build/import/type/intrinsic/intrinsic.mjs +10 -21
- package/build/import/type/intrinsic/lowercase.d.mts +4 -0
- package/build/import/type/intrinsic/lowercase.mjs +5 -0
- package/build/import/type/intrinsic/uncapitalize.d.mts +4 -0
- package/build/import/type/intrinsic/uncapitalize.mjs +5 -0
- package/build/import/type/intrinsic/uppercase.d.mts +4 -0
- package/build/import/type/intrinsic/uppercase.mjs +5 -0
- package/build/import/type/mapped/index.d.mts +2 -0
- package/build/import/type/mapped/index.mjs +2 -0
- package/build/import/type/mapped/mapped-key.d.mts +8 -0
- package/build/import/type/mapped/mapped-key.mjs +7 -0
- package/build/import/type/mapped/mapped-result.d.mts +9 -0
- package/build/import/type/mapped/mapped-result.mjs +7 -0
- package/build/import/type/mapped/mapped.d.mts +17 -27
- package/build/import/type/mapped/mapped.mjs +22 -32
- package/build/import/type/omit/index.d.mts +1 -0
- package/build/import/type/omit/index.mjs +1 -0
- package/build/import/type/omit/omit-mapped-result.d.mts +15 -0
- package/build/import/type/omit/omit-mapped-result.mjs +20 -0
- package/build/import/type/omit/omit.d.mts +5 -2
- package/build/import/type/omit/omit.mjs +12 -6
- package/build/import/type/pick/index.d.mts +1 -0
- package/build/import/type/pick/index.mjs +1 -0
- package/build/import/type/pick/pick-mapped-result.d.mts +15 -0
- package/build/import/type/pick/pick-mapped-result.mjs +20 -0
- package/build/import/type/pick/pick.d.mts +5 -2
- package/build/import/type/pick/pick.mjs +12 -6
- package/build/import/type/record/record.mjs +4 -4
- package/build/import/type/type/json.d.mts +15 -13
- package/build/import/value/transform/decode.mjs +2 -2
- package/build/import/value/transform/encode.mjs +2 -2
- package/build/require/index.d.ts +5 -5
- package/build/require/index.js +7 -6
- package/build/require/type/composite/composite.d.ts +2 -2
- package/build/require/type/extends/extends-mapped-result-from-result.d.ts +13 -0
- package/build/require/type/extends/extends-mapped-result-from-result.js +18 -0
- package/build/require/type/extends/extends-mapped-result.d.ts +13 -9
- package/build/require/type/extends/extends-mapped-result.js +17 -10
- package/build/require/type/extends/extends.d.ts +4 -4
- package/build/require/type/extends/extends.js +3 -3
- package/build/require/type/extends/index.d.ts +1 -1
- package/build/require/type/extends/index.js +1 -1
- package/build/require/type/indexed/index.d.ts +2 -2
- package/build/require/type/indexed/index.js +2 -2
- package/build/require/type/indexed/{indexed-mapped.d.ts → indexed-mapped-result.d.ts} +4 -4
- package/build/require/type/indexed/{indexed-mapped.js → indexed-mapped-result.js} +5 -5
- package/build/require/type/indexed/indexed-property-keys.d.ts +3 -3
- package/build/require/type/indexed/indexed-property-keys.js +4 -4
- package/build/require/type/indexed/{indexed-type.d.ts → indexed-result.d.ts} +2 -2
- package/build/require/type/indexed/{indexed-type.js → indexed-result.js} +3 -3
- package/build/require/type/indexed/indexed.d.ts +6 -6
- package/build/require/type/indexed/indexed.js +5 -5
- package/build/require/type/intrinsic/capitalize.d.ts +4 -0
- package/build/require/type/intrinsic/capitalize.js +9 -0
- package/build/require/type/intrinsic/index.d.ts +5 -0
- package/build/require/type/intrinsic/index.js +5 -0
- package/build/require/type/intrinsic/intrinsic-mapped-result.d.ts +15 -0
- package/build/require/type/intrinsic/intrinsic-mapped-result.js +25 -0
- package/build/require/type/intrinsic/intrinsic.d.ts +9 -14
- package/build/require/type/intrinsic/intrinsic.js +10 -25
- package/build/require/type/intrinsic/lowercase.d.ts +4 -0
- package/build/require/type/intrinsic/lowercase.js +9 -0
- package/build/require/type/intrinsic/uncapitalize.d.ts +4 -0
- package/build/require/type/intrinsic/uncapitalize.js +9 -0
- package/build/require/type/intrinsic/uppercase.d.ts +4 -0
- package/build/require/type/intrinsic/uppercase.js +9 -0
- package/build/require/type/mapped/index.d.ts +2 -0
- package/build/require/type/mapped/index.js +2 -0
- package/build/require/type/mapped/mapped-key.d.ts +8 -0
- package/build/require/type/mapped/mapped-key.js +11 -0
- package/build/require/type/mapped/mapped-result.d.ts +9 -0
- package/build/require/type/mapped/mapped-result.js +11 -0
- package/build/require/type/mapped/mapped.d.ts +17 -27
- package/build/require/type/mapped/mapped.js +31 -45
- package/build/require/type/omit/index.d.ts +1 -0
- package/build/require/type/omit/index.js +1 -0
- package/build/require/type/omit/omit-mapped-result.d.ts +15 -0
- package/build/require/type/omit/omit-mapped-result.js +24 -0
- package/build/require/type/omit/omit.d.ts +5 -2
- package/build/require/type/omit/omit.js +10 -4
- package/build/require/type/pick/index.d.ts +1 -0
- package/build/require/type/pick/index.js +1 -0
- package/build/require/type/pick/pick-mapped-result.d.ts +15 -0
- package/build/require/type/pick/pick-mapped-result.js +24 -0
- package/build/require/type/pick/pick.d.ts +5 -2
- package/build/require/type/pick/pick.js +10 -4
- package/build/require/type/record/record.js +2 -2
- package/build/require/type/type/json.d.ts +15 -13
- package/build/require/value/transform/decode.js +1 -1
- package/build/require/value/transform/encode.js +1 -1
- package/package.json +1 -1
- package/readme.md +115 -47
- package/build/import/type/extends/extends-mapped.d.mts +0 -17
- package/build/import/type/extends/extends-mapped.mjs +0 -21
- package/build/require/type/extends/extends-mapped.d.ts +0 -17
- package/build/require/type/extends/extends-mapped.js +0 -25
package/build/import/index.d.mts
CHANGED
|
@@ -21,25 +21,25 @@ export { Extends, type TExtends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCh
|
|
|
21
21
|
export { Extract, type TExtract } from './type/extract/index.mjs';
|
|
22
22
|
export { Function, type TFunction } from './type/function/index.mjs';
|
|
23
23
|
export { Increment, type Assert, type AssertType, type AssertRest, type AssertProperties, type Ensure, type Evaluate, type TupleToIntersect, type TupleToUnion, type UnionToTuple } from './type/helpers/index.mjs';
|
|
24
|
-
export { Index, type TIndex, type
|
|
24
|
+
export { Index, IndexPropertyKeys, IndexMappedResult, type TIndex, type TIndexPropertyKeys, type TIndexMappedResult } from './type/indexed/index.mjs';
|
|
25
25
|
export { InstanceType, type TInstanceType } from './type/instance-type/index.mjs';
|
|
26
26
|
export { Integer, type TInteger, type IntegerOptions } from './type/integer/index.mjs';
|
|
27
27
|
export { Intersect, type TIntersect, type IntersectOptions } from './type/intersect/index.mjs';
|
|
28
28
|
export { Iterator, type TIterator } from './type/iterator/index.mjs';
|
|
29
|
-
export { Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase
|
|
29
|
+
export { Intrinsic, type TIntrinsic, Capitalize, type TCapitalize, Lowercase, type TLowercase, Uncapitalize, type TUncapitalize, Uppercase, type TUppercase } from './type/intrinsic/index.mjs';
|
|
30
30
|
export { KeyOf, type TKeyOf, KeyOfPropertyKeys, KeyOfPattern } from './type/keyof/index.mjs';
|
|
31
31
|
export { Literal, type TLiteral } from './type/literal/index.mjs';
|
|
32
|
-
export { Mapped, type
|
|
32
|
+
export { Mapped, MappedKey, MappedResult, type TMapped, type TMappedKey, type TMappedResult, type TMappedFunction } from './type/mapped/index.mjs';
|
|
33
33
|
export { Never, type TNever } from './type/never/index.mjs';
|
|
34
34
|
export { Not, type TNot } from './type/not/index.mjs';
|
|
35
35
|
export { Null, type TNull } from './type/null/index.mjs';
|
|
36
36
|
export { Number, type TNumber, type NumberOptions } from './type/number/index.mjs';
|
|
37
37
|
export { Object, type TObject, type TProperties, type ObjectOptions } from './type/object/index.mjs';
|
|
38
|
-
export { Omit, type TOmit } from './type/omit/index.mjs';
|
|
38
|
+
export { Omit, type TOmit, type TOmitMappedResult } from './type/omit/index.mjs';
|
|
39
39
|
export { Optional, type TOptional } from './type/optional/index.mjs';
|
|
40
40
|
export { Parameters, type TParameters } from './type/parameters/index.mjs';
|
|
41
41
|
export { Partial, type TPartial } from './type/partial/index.mjs';
|
|
42
|
-
export { Pick, type TPick } from './type/pick/index.mjs';
|
|
42
|
+
export { Pick, type TPick, type TPickMappedResult } from './type/pick/index.mjs';
|
|
43
43
|
export { Promise, type TPromise } from './type/promise/index.mjs';
|
|
44
44
|
export { Readonly, type TReadonly } from './type/readonly/index.mjs';
|
|
45
45
|
export { ReadonlyOptional, type TReadonlyOptional } from './type/readonly-optional/index.mjs';
|
package/build/import/index.mjs
CHANGED
|
@@ -21,15 +21,15 @@ export { Extends, ExtendsCheck, ExtendsResult, ExtendsUndefinedCheck } from './t
|
|
|
21
21
|
export { Extract } from './type/extract/index.mjs';
|
|
22
22
|
export { Function } from './type/function/index.mjs';
|
|
23
23
|
export { Increment } from './type/helpers/index.mjs';
|
|
24
|
-
export { Index,
|
|
24
|
+
export { Index, IndexPropertyKeys, IndexMappedResult } from './type/indexed/index.mjs';
|
|
25
25
|
export { InstanceType } from './type/instance-type/index.mjs';
|
|
26
26
|
export { Integer } from './type/integer/index.mjs';
|
|
27
27
|
export { Intersect } from './type/intersect/index.mjs';
|
|
28
28
|
export { Iterator } from './type/iterator/index.mjs';
|
|
29
|
-
export { Capitalize, Lowercase, Uncapitalize, Uppercase
|
|
29
|
+
export { Intrinsic, Capitalize, Lowercase, Uncapitalize, Uppercase } from './type/intrinsic/index.mjs';
|
|
30
30
|
export { KeyOf, KeyOfPropertyKeys, KeyOfPattern } from './type/keyof/index.mjs';
|
|
31
31
|
export { Literal } from './type/literal/index.mjs';
|
|
32
|
-
export { Mapped } from './type/mapped/index.mjs';
|
|
32
|
+
export { Mapped, MappedKey, MappedResult } from './type/mapped/index.mjs';
|
|
33
33
|
export { Never } from './type/never/index.mjs';
|
|
34
34
|
export { Not } from './type/not/index.mjs';
|
|
35
35
|
export { Null } from './type/null/index.mjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { UnionToTuple, Assert, Evaluate } from '../helpers/index.mjs';
|
|
2
2
|
import { type TObject, type ObjectOptions } from '../object/index.mjs';
|
|
3
3
|
import { type TIntersect } from '../intersect/index.mjs';
|
|
4
|
-
import {
|
|
4
|
+
import { type TIndex } from '../indexed/index.mjs';
|
|
5
5
|
type CompositeKeys<T extends TObject[]> = T extends [infer L extends TObject, ...infer R extends TObject[]] ? keyof L['properties'] | CompositeKeys<R> : never;
|
|
6
6
|
type CompositeIndex<T extends TIntersect<TObject[]>, K extends string[]> = K extends [infer L extends string, ...infer R extends string[]] ? {
|
|
7
|
-
[_ in L]:
|
|
7
|
+
[_ in L]: TIndex<T, [L]>;
|
|
8
8
|
} & CompositeIndex<T, R> : {};
|
|
9
9
|
type CompositeReduce<T extends TObject[]> = UnionToTuple<CompositeKeys<T>> extends infer K ? Evaluate<CompositeIndex<TIntersect<T>, Assert<K, string[]>>> : {};
|
|
10
10
|
export type CompositeResolve<T extends TObject[]> = TIntersect<T> extends TIntersect ? TObject<CompositeReduce<T>> : TObject<{}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TSchema } from '../schema/index.mjs';
|
|
2
|
+
import type { TProperties } from '../object/index.mjs';
|
|
3
|
+
import { type TMappedResult } from '../mapped/index.mjs';
|
|
4
|
+
import { type TExtends } from './extends.mjs';
|
|
5
|
+
type MappedResultExtendsPropertyKeys<K extends TProperties, U extends TSchema, L extends TSchema, R extends TSchema> = ({
|
|
6
|
+
[K2 in keyof K]: TExtends<K[K2], U, L, R>;
|
|
7
|
+
});
|
|
8
|
+
declare function MappedResultExtendsPropertyKeys<K extends TProperties, U extends TSchema, L extends TSchema, R extends TSchema>(K: K, U: U, L: L, R: R): MappedResultExtendsPropertyKeys<K, U, L, R>;
|
|
9
|
+
type MappedResultExtendsProperties<K extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema> = (MappedResultExtendsPropertyKeys<K['properties'], U, L, R>);
|
|
10
|
+
declare function MappedResultExtendsProperties<K extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema>(K: K, U: U, L: L, R: R): MappedResultExtendsProperties<K, U, L, R>;
|
|
11
|
+
export type TExtendsMappedResultFromResult<T extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = MappedResultExtendsProperties<T, U, L, R>> = (TMappedResult<P>);
|
|
12
|
+
export declare function ExtendsMappedResultFromResult<T extends TMappedResult, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = MappedResultExtendsProperties<T, U, L, R>>(T: T, U: U, L: L, R: R): TMappedResult<P>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Extends } from './extends.mjs';
|
|
3
|
+
function MappedResultExtendsPropertyKeys(K, U, L, R) {
|
|
4
|
+
return globalThis.Object.getOwnPropertyNames(K).reduce((Acc, K2) => {
|
|
5
|
+
return { ...Acc, [K2]: Extends(K[K2], U, L, R) };
|
|
6
|
+
}, {});
|
|
7
|
+
}
|
|
8
|
+
function MappedResultExtendsProperties(K, U, L, R) {
|
|
9
|
+
return MappedResultExtendsPropertyKeys(K.properties, U, L, R);
|
|
10
|
+
}
|
|
11
|
+
export function ExtendsMappedResultFromResult(T, U, L, R) {
|
|
12
|
+
const P = MappedResultExtendsProperties(T, U, L, R);
|
|
13
|
+
return MappedResult(P);
|
|
14
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import type { TSchema } from '../schema/index.mjs';
|
|
2
2
|
import type { TProperties } from '../object/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import type { Assert } from '../helpers/index.mjs';
|
|
4
|
+
import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
|
|
5
|
+
import { TLiteral, TLiteralValue } from '../literal/index.mjs';
|
|
4
6
|
import { type TExtends } from './extends.mjs';
|
|
5
|
-
type
|
|
6
|
-
[
|
|
7
|
-
}
|
|
8
|
-
declare function
|
|
9
|
-
type
|
|
10
|
-
declare function
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
type MappedExtendsPropertyKey<K extends PropertyKey, U extends TSchema, L extends TSchema, R extends TSchema> = {
|
|
8
|
+
[_ in K]: TExtends<TLiteral<Assert<K, TLiteralValue>>, U, L, R>;
|
|
9
|
+
};
|
|
10
|
+
declare function MappedExtendsPropertyKey<K extends PropertyKey, U extends TSchema, L extends TSchema, R extends TSchema>(K: K, U: U, L: L, R: R): MappedExtendsPropertyKey<K, U, L, R>;
|
|
11
|
+
type MappedExtendsPropertyKeys<K extends PropertyKey[], U extends TSchema, L extends TSchema, R extends TSchema> = (K extends [infer LK extends PropertyKey, ...infer RK extends PropertyKey[]] ? MappedExtendsPropertyKey<LK, U, L, R> & MappedExtendsPropertyKeys<RK, U, L, R> : {});
|
|
12
|
+
declare function MappedExtendsPropertyKeys<K extends PropertyKey[], U extends TSchema, L extends TSchema, R extends TSchema>(K: [...K], U: U, L: L, R: R): MappedExtendsPropertyKeys<K, U, L, R>;
|
|
13
|
+
type MappedExtendsProperties<K extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema> = (MappedExtendsPropertyKeys<K['keys'], U, L, R>);
|
|
14
|
+
declare function MappedExtendsProperties<K extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema>(K: K, U: U, L: L, R: R): MappedExtendsProperties<K, U, L, R>;
|
|
15
|
+
export type TExtendsMappedResult<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = MappedExtendsProperties<T, U, L, R>> = (TMappedResult<P>);
|
|
16
|
+
export declare function ExtendsMappedResult<T extends TMappedKey, U extends TSchema, L extends TSchema, R extends TSchema, P extends TProperties = MappedExtendsProperties<T, U, L, R>>(T: T, U: U, L: L, R: R): TMappedResult<P>;
|
|
13
17
|
export {};
|
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Literal } from '../literal/index.mjs';
|
|
2
3
|
import { Extends } from './extends.mjs';
|
|
3
|
-
function
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
}
|
|
4
|
+
function MappedExtendsPropertyKey(K, U, L, R) {
|
|
5
|
+
return {
|
|
6
|
+
[K]: Extends(Literal(K), U, L, R)
|
|
7
|
+
};
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
9
|
+
function MappedExtendsPropertyKeys(K, U, L, R) {
|
|
10
|
+
const [LK, ...RK] = K;
|
|
11
|
+
return (K.length > 0
|
|
12
|
+
? { ...MappedExtendsPropertyKey(LK, U, L, R), ...MappedExtendsPropertyKeys(RK, U, L, R) }
|
|
13
|
+
: {});
|
|
10
14
|
}
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
function MappedExtendsProperties(K, U, L, R) {
|
|
16
|
+
return MappedExtendsPropertyKeys(K.keys, U, L, R);
|
|
17
|
+
}
|
|
18
|
+
export function ExtendsMappedResult(T, U, L, R) {
|
|
19
|
+
const P = MappedExtendsProperties(T, U, L, R);
|
|
13
20
|
return MappedResult(P);
|
|
14
21
|
}
|
|
@@ -3,12 +3,12 @@ import type { Static } from '../static/index.mjs';
|
|
|
3
3
|
import { type TUnion } from '../union/index.mjs';
|
|
4
4
|
import { TMappedKey, TMappedResult } from '../mapped/index.mjs';
|
|
5
5
|
import { UnionToTuple } from '../helpers/index.mjs';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { type TExtendsMappedResult } from './extends-mapped-result.mjs';
|
|
7
|
+
import { type TExtendsMappedResultFromResult } from './extends-mapped-result-from-result.mjs';
|
|
8
8
|
type ExtendsResolve<L extends TSchema, R extends TSchema, T extends TSchema, U extends TSchema> = ((Static<L> extends Static<R> ? T : U) extends infer O extends TSchema ? UnionToTuple<O> extends [infer X extends TSchema, infer Y extends TSchema] ? TUnion<[X, Y]> : O : never);
|
|
9
9
|
declare function ExtendsResolve<L extends TSchema, R extends TSchema, T extends TSchema, U extends TSchema>(left: L, right: R, trueType: T, falseType: U): ExtendsResolve<L, R, T, U>;
|
|
10
10
|
export type TExtends<L extends TSchema, R extends TSchema, T extends TSchema, F extends TSchema> = ExtendsResolve<L, R, T, F>;
|
|
11
|
-
export declare function Extends<L extends TMappedResult, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions):
|
|
12
|
-
export declare function Extends<L extends TMappedKey, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions):
|
|
11
|
+
export declare function Extends<L extends TMappedResult, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsMappedResultFromResult<L, R, T, F>;
|
|
12
|
+
export declare function Extends<L extends TMappedKey, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtendsMappedResult<L, R, T, F>;
|
|
13
13
|
export declare function Extends<L extends TSchema, R extends TSchema, T extends TSchema, F extends TSchema>(L: L, R: R, T: T, F: F, options?: SchemaOptions): TExtends<L, R, T, F>;
|
|
14
14
|
export {};
|
|
@@ -2,8 +2,8 @@ import { TMappedKey as IsMappedKeyType, TMappedResult as IsMappedResultType } fr
|
|
|
2
2
|
import { Union } from '../union/index.mjs';
|
|
3
3
|
import { ExtendsCheck, ExtendsResult } from './extends-check.mjs';
|
|
4
4
|
import { CloneType } from '../clone/type.mjs';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ExtendsMappedResult } from './extends-mapped-result.mjs';
|
|
6
|
+
import { ExtendsMappedResultFromResult } from './extends-mapped-result-from-result.mjs';
|
|
7
7
|
function ExtendsResolve(left, right, trueType, falseType) {
|
|
8
8
|
const R = ExtendsCheck(left, right);
|
|
9
9
|
return (R === ExtendsResult.Union ? Union([trueType, falseType]) :
|
|
@@ -11,7 +11,7 @@ function ExtendsResolve(left, right, trueType, falseType) {
|
|
|
11
11
|
falseType);
|
|
12
12
|
}
|
|
13
13
|
export function Extends(L, R, T, F, options = {}) {
|
|
14
|
-
return (IsMappedResultType(L) ? CloneType(
|
|
15
|
-
IsMappedKeyType(L) ? CloneType(
|
|
14
|
+
return (IsMappedResultType(L) ? CloneType(ExtendsMappedResultFromResult(L, R, T, F), options) :
|
|
15
|
+
IsMappedKeyType(L) ? CloneType(ExtendsMappedResult(L, R, T, F), options) :
|
|
16
16
|
CloneType(ExtendsResolve(L, R, T, F), options));
|
|
17
17
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { type TSchema } from '../schema/index.mjs';
|
|
2
2
|
import { type TProperties } from '../object/index.mjs';
|
|
3
|
-
import {
|
|
3
|
+
import { type TIndexResult } from './indexed-result.mjs';
|
|
4
4
|
import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
|
|
5
5
|
import { Evaluate } from '../helpers/index.mjs';
|
|
6
6
|
type MappedIndexPropertyKey<T extends TSchema, K extends PropertyKey> = {
|
|
7
|
-
[_ in K]:
|
|
7
|
+
[_ in K]: TIndexResult<T, [K]>;
|
|
8
8
|
};
|
|
9
9
|
declare function MappedIndexPropertyKey<T extends TSchema, K extends PropertyKey>(T: T, K: K): MappedIndexPropertyKey<T, K>;
|
|
10
10
|
type MappedIndexPropertyKeys<T extends TSchema, K extends PropertyKey[]> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? MappedIndexPropertyKey<T, L> & MappedIndexPropertyKeys<T, R> : {});
|
|
11
11
|
declare function MappedIndexPropertyKeys<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): MappedIndexPropertyKeys<T, K>;
|
|
12
12
|
type MappedIndexProperties<T extends TSchema, K extends TMappedKey> = Evaluate<MappedIndexPropertyKeys<T, K['keys']>>;
|
|
13
13
|
declare function MappedIndexProperties<T extends TSchema, K extends TMappedKey>(T: T, K: K): MappedIndexProperties<T, K>;
|
|
14
|
-
export type
|
|
15
|
-
export declare function
|
|
14
|
+
export type TIndexMappedResult<T extends TSchema, K extends TMappedKey, P extends TProperties = MappedIndexProperties<T, K>> = (TMappedResult<P>);
|
|
15
|
+
export declare function IndexMappedResult<T extends TSchema, K extends TMappedKey, P extends TProperties = MappedIndexProperties<T, K>>(T: T, K: K): TMappedResult<P>;
|
|
16
16
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IndexResult } from './indexed-result.mjs';
|
|
2
2
|
import { MappedResult } from '../mapped/index.mjs';
|
|
3
3
|
function MappedIndexPropertyKey(T, K) {
|
|
4
|
-
return { [K]:
|
|
4
|
+
return { [K]: IndexResult(T, [K]) };
|
|
5
5
|
}
|
|
6
6
|
function MappedIndexPropertyKeys(T, K) {
|
|
7
7
|
const [L, ...R] = K;
|
|
@@ -12,7 +12,7 @@ function MappedIndexPropertyKeys(T, K) {
|
|
|
12
12
|
function MappedIndexProperties(T, K) {
|
|
13
13
|
return MappedIndexPropertyKeys(T, K.keys);
|
|
14
14
|
}
|
|
15
|
-
export function
|
|
15
|
+
export function IndexMappedResult(T, K) {
|
|
16
16
|
const P = MappedIndexProperties(T, K);
|
|
17
17
|
return MappedResult(P);
|
|
18
18
|
}
|
|
@@ -6,11 +6,11 @@ import { type TSchema } from '../schema/index.mjs';
|
|
|
6
6
|
import { type TUnion } from '../union/index.mjs';
|
|
7
7
|
type FromTemplateLiteral<T extends TTemplateLiteral, F = IsTemplateLiteralFinite<T>> = (F extends true ? TemplateLiteralGenerate<T> extends infer R extends string[] ? R : [] : []);
|
|
8
8
|
declare function FromTemplateLiteral<T extends TTemplateLiteral>(T: T): FromTemplateLiteral<T>;
|
|
9
|
-
type FromUnion<T extends TSchema[]> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [...
|
|
9
|
+
type FromUnion<T extends TSchema[]> = (T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [...TIndexPropertyKeys<L>, ...FromUnion<R>] : []);
|
|
10
10
|
declare function FromUnion<T extends TSchema[]>(T: T): FromUnion<T>;
|
|
11
11
|
type FromLiteral<T extends TLiteralValue> = (T extends PropertyKey ? [`${T}`] : []);
|
|
12
12
|
declare function FromLiteral<T extends TLiteralValue>(T: T): FromLiteral<T>;
|
|
13
|
-
export type
|
|
13
|
+
export type TIndexPropertyKeys<T extends TSchema> = (T extends TTemplateLiteral ? FromTemplateLiteral<T> : T extends TUnion<infer S> ? FromUnion<S> : T extends TLiteral<infer S> ? FromLiteral<S> : T extends TNumber ? ['[number]'] : T extends TInteger ? ['[number]'] : [
|
|
14
14
|
]);
|
|
15
|
-
export declare function
|
|
15
|
+
export declare function IndexPropertyKeys<T extends TSchema>(T: T): TIndexPropertyKeys<T>;
|
|
16
16
|
export {};
|
|
@@ -13,13 +13,13 @@ function FromTemplateLiteral(T) {
|
|
|
13
13
|
function FromUnion(T) {
|
|
14
14
|
const [L, ...R] = T;
|
|
15
15
|
return (T.length > 0
|
|
16
|
-
? [...
|
|
16
|
+
? [...IndexPropertyKeys(L), ...FromUnion(R)]
|
|
17
17
|
: []);
|
|
18
18
|
}
|
|
19
19
|
function FromLiteral(T) {
|
|
20
20
|
return ([T.toString()]);
|
|
21
21
|
}
|
|
22
|
-
export function
|
|
22
|
+
export function IndexPropertyKeys(T) {
|
|
23
23
|
return [...new Set((IsTemplateLiteralType(T) ? FromTemplateLiteral(T) :
|
|
24
24
|
IsUnionType(T) ? FromUnion(T.anyOf) :
|
|
25
25
|
IsLiteralType(T) ? FromLiteral(T.const) :
|
|
@@ -28,6 +28,6 @@ type FromKey<T extends TSchema, K extends PropertyKey> = (T extends TRecursive<i
|
|
|
28
28
|
declare function FromKey<T extends TSchema, K extends PropertyKey>(T: T, K: K): FromKey<T, K>;
|
|
29
29
|
type FromKeys<T extends TSchema, K extends PropertyKey[]> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? [FromKey<T, L>, ...FromKeys<T, R>] : []);
|
|
30
30
|
declare function FromKeys<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): FromKeys<T, K>;
|
|
31
|
-
export type
|
|
32
|
-
export declare function
|
|
31
|
+
export type TIndexResult<T extends TSchema, K extends PropertyKey[]> = (UnionResolve<FromKeys<T, K>>);
|
|
32
|
+
export declare function IndexResult<T extends TSchema, K extends PropertyKey[]>(T: T, K: [...K]): TIndexResult<T, K>;
|
|
33
33
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { type
|
|
2
|
+
import { type TIndexResult } from './indexed-result.mjs';
|
|
3
|
+
import { type TIndexPropertyKeys } from './indexed-property-keys.mjs';
|
|
4
|
+
import { type TIndexMappedResult } from './indexed-mapped-result.mjs';
|
|
5
5
|
import { TMappedKey } from '../mapped/index.mjs';
|
|
6
|
-
export type TIndex<T extends TSchema, K extends PropertyKey[]> =
|
|
7
|
-
export declare function Index<T extends TSchema, K extends TMappedKey>(T: T, K: K):
|
|
8
|
-
export declare function Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] =
|
|
6
|
+
export type TIndex<T extends TSchema, K extends PropertyKey[]> = TIndexResult<T, K>;
|
|
7
|
+
export declare function Index<T extends TSchema, K extends TMappedKey>(T: T, K: K): TIndexMappedResult<T, K>;
|
|
8
|
+
export declare function Index<T extends TSchema, K extends TSchema, I extends PropertyKey[] = TIndexPropertyKeys<K>>(T: T, K: K, options?: SchemaOptions): TIndex<T, I>;
|
|
9
9
|
export declare function Index<T extends TSchema, K extends PropertyKey[]>(T: T, K: readonly [...K], options?: SchemaOptions): TIndex<T, K>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TSchema as IsSchemaType, TMappedKey as IsMappedKey } from '../guard/type.mjs';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { IndexResult } from './indexed-result.mjs';
|
|
3
|
+
import { IndexPropertyKeys } from './indexed-property-keys.mjs';
|
|
4
|
+
import { IndexMappedResult } from './indexed-mapped-result.mjs';
|
|
5
5
|
import { CloneType } from '../clone/type.mjs';
|
|
6
6
|
export function Index(T, K, options = {}) {
|
|
7
|
-
return (IsMappedKey(K) ? CloneType(
|
|
8
|
-
IsSchemaType(K) ? CloneType(
|
|
9
|
-
CloneType(
|
|
7
|
+
return (IsMappedKey(K) ? CloneType(IndexMappedResult(T, K), options) :
|
|
8
|
+
IsSchemaType(K) ? CloneType(IndexResult(T, IndexPropertyKeys(K)), options) :
|
|
9
|
+
CloneType(IndexResult(T, K), options));
|
|
10
10
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { TIntrinsic } from './intrinsic.mjs';
|
|
3
|
+
export type TCapitalize<T extends TSchema> = TIntrinsic<T, 'Capitalize'>;
|
|
4
|
+
export declare function Capitalize<T extends TSchema>(T: T, options?: SchemaOptions): TCapitalize<T>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TProperties } from '../object/index.mjs';
|
|
2
|
+
import { type TMappedResult, type TMappedKey } from '../mapped/index.mjs';
|
|
3
|
+
import { type TIntrinsic, type IntrinsicMode } from './intrinsic.mjs';
|
|
4
|
+
import { TLiteral, TLiteralValue } from '../literal/index.mjs';
|
|
5
|
+
type MappedIntrinsicPropertyKey<K extends PropertyKey, M extends IntrinsicMode, P extends TLiteralValue = K extends TLiteralValue ? K : never> = {
|
|
6
|
+
[_ in K]: TIntrinsic<TLiteral<P>, M>;
|
|
7
|
+
};
|
|
8
|
+
declare function MappedIntrinsicPropertyKey<K extends PropertyKey, M extends IntrinsicMode>(K: K, M: M): MappedIntrinsicPropertyKey<K, M>;
|
|
9
|
+
type MappedIntrinsicPropertyKeys<K extends PropertyKey[], M extends IntrinsicMode> = (K extends [infer L extends PropertyKey, ...infer R extends PropertyKey[]] ? MappedIntrinsicPropertyKey<L, M> & MappedIntrinsicPropertyKeys<R, M> : {});
|
|
10
|
+
declare function MappedIntrinsicPropertyKeys<K extends PropertyKey[], M extends IntrinsicMode>(K: [...K], M: M): MappedIntrinsicPropertyKeys<K, M>;
|
|
11
|
+
type MappedIntrinsicProperties<K extends TMappedKey, M extends IntrinsicMode> = (MappedIntrinsicPropertyKeys<K['keys'], M>);
|
|
12
|
+
declare function MappedIntrinsicProperties<K extends TMappedKey, M extends IntrinsicMode>(T: K, M: M): MappedIntrinsicProperties<K, M>;
|
|
13
|
+
export type TIntrinsicMappedResult<K extends TMappedKey, M extends IntrinsicMode, P extends TProperties = MappedIntrinsicProperties<K, M>> = (TMappedResult<P>);
|
|
14
|
+
export declare function IntrinsicMappedResult<K extends TMappedKey, M extends IntrinsicMode, P extends TProperties = MappedIntrinsicProperties<K, M>>(T: K, M: M): TMappedResult<P>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { MappedResult } from '../mapped/index.mjs';
|
|
2
|
+
import { Intrinsic } from './intrinsic.mjs';
|
|
3
|
+
import { Literal } from '../literal/index.mjs';
|
|
4
|
+
function MappedIntrinsicPropertyKey(K, M) {
|
|
5
|
+
return {
|
|
6
|
+
[K]: Intrinsic(Literal(K), M)
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function MappedIntrinsicPropertyKeys(K, M) {
|
|
10
|
+
const [L, ...R] = K;
|
|
11
|
+
return (K.length > 0
|
|
12
|
+
? { ...MappedIntrinsicPropertyKey(L, M), ...MappedIntrinsicPropertyKeys(R, M) }
|
|
13
|
+
: {});
|
|
14
|
+
}
|
|
15
|
+
function MappedIntrinsicProperties(T, M) {
|
|
16
|
+
return MappedIntrinsicPropertyKeys(T['keys'], M);
|
|
17
|
+
}
|
|
18
|
+
export function IntrinsicMappedResult(T, M) {
|
|
19
|
+
const P = MappedIntrinsicProperties(T, M);
|
|
20
|
+
return MappedResult(P);
|
|
21
|
+
}
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
import type { TSchema
|
|
1
|
+
import type { TSchema } from '../schema/index.mjs';
|
|
2
2
|
import { type TTemplateLiteral, type TTemplateLiteralKind } from '../template-literal/index.mjs';
|
|
3
|
+
import { type TIntrinsicMappedResult } from './intrinsic-mapped-result.mjs';
|
|
3
4
|
import { type TLiteral, type TLiteralValue } from '../literal/index.mjs';
|
|
4
5
|
import { type TUnion } from '../union/index.mjs';
|
|
5
|
-
|
|
6
|
-
type
|
|
6
|
+
import { type TMappedKey } from '../mapped/index.mjs';
|
|
7
|
+
export type IntrinsicMode = 'Uppercase' | 'Lowercase' | 'Capitalize' | 'Uncapitalize';
|
|
8
|
+
type FromTemplateLiteral<T extends TTemplateLiteralKind[], M extends IntrinsicMode> = M extends IntrinsicMode ? T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? [TIntrinsic<L, M>, ...FromTemplateLiteral<R, M>] : T : T;
|
|
7
9
|
declare function FromTemplateLiteral<T extends TTemplateLiteralKind[], M extends IntrinsicMode>(schema: TTemplateLiteral, mode: IntrinsicMode): FromTemplateLiteral<T, M>;
|
|
8
10
|
type FromLiteralValue<T, M extends IntrinsicMode> = (T extends string ? M extends 'Uncapitalize' ? Uncapitalize<T> : M extends 'Capitalize' ? Capitalize<T> : M extends 'Uppercase' ? Uppercase<T> : M extends 'Lowercase' ? Lowercase<T> : string : T);
|
|
9
11
|
declare function FromLiteralValue(value: TLiteralValue, mode: IntrinsicMode): string;
|
|
10
|
-
type FromRest<T extends TSchema[], M extends IntrinsicMode> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [
|
|
12
|
+
type FromRest<T extends TSchema[], M extends IntrinsicMode> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? [TIntrinsic<L, M>, ...FromRest<R, M>] : [];
|
|
11
13
|
declare function FromRest<T extends TSchema[], M extends IntrinsicMode>(T: [...T], mode: M): FromRest<T, M>;
|
|
12
|
-
export type
|
|
13
|
-
export declare function
|
|
14
|
-
export
|
|
15
|
-
export declare function Uncapitalize<T extends TSchema>(T: T, options?: SchemaOptions): TUncapitalize<T>;
|
|
16
|
-
export type TUppercase<T extends TSchema> = IntrinsicResolve<T, 'Uppercase'>;
|
|
17
|
-
export declare function Uppercase<T extends TSchema>(T: T, options?: SchemaOptions): TUppercase<T>;
|
|
18
|
-
export type TLowercase<T extends TSchema> = IntrinsicResolve<T, 'Lowercase'>;
|
|
19
|
-
export declare function Lowercase<T extends TSchema>(T: T, options?: SchemaOptions): TLowercase<T>;
|
|
20
|
-
export type TCapitalize<T extends TSchema> = IntrinsicResolve<T, 'Capitalize'>;
|
|
21
|
-
export declare function Capitalize<T extends TSchema>(T: T, options?: SchemaOptions): TCapitalize<T>;
|
|
14
|
+
export type TIntrinsic<T extends TSchema, M extends IntrinsicMode> = T extends TMappedKey ? TIntrinsicMappedResult<T, M> : T extends TTemplateLiteral<infer S> ? TTemplateLiteral<FromTemplateLiteral<S, M>> : T extends TUnion<infer S> ? TUnion<FromRest<S, M>> : T extends TLiteral<infer S> ? TLiteral<FromLiteralValue<S, M>> : T;
|
|
15
|
+
export declare function Intrinsic<T extends TMappedKey, M extends IntrinsicMode>(schema: T, mode: M): TIntrinsicMappedResult<T, M>;
|
|
16
|
+
export declare function Intrinsic<T extends TSchema, M extends IntrinsicMode>(schema: T, mode: M): TIntrinsic<T, M>;
|
|
22
17
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TemplateLiteral, TemplateLiteralParseExact, IsTemplateLiteralFinite, TemplateLiteralGenerate } from '../template-literal/index.mjs';
|
|
2
|
+
import { IntrinsicMappedResult } from './intrinsic-mapped-result.mjs';
|
|
2
3
|
import { Literal } from '../literal/index.mjs';
|
|
3
4
|
import { Union } from '../union/index.mjs';
|
|
4
|
-
import { TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType, TLiteral as IsLiteralType } from '../guard/type.mjs';
|
|
5
|
-
import { CloneType } from '../clone/type.mjs';
|
|
5
|
+
import { TMappedKey as IsMappedKeyType, TTemplateLiteral as IsTemplateLiteralType, TUnion as IsUnionType, TLiteral as IsLiteralType } from '../guard/type.mjs';
|
|
6
6
|
function ApplyUncapitalize(value) {
|
|
7
7
|
const [first, rest] = [value.slice(0, 1), value.slice(1)];
|
|
8
8
|
return [first.toLowerCase(), rest].join('');
|
|
@@ -37,23 +37,12 @@ function FromLiteralValue(value, mode) {
|
|
|
37
37
|
}
|
|
38
38
|
function FromRest(T, mode) {
|
|
39
39
|
const [L, ...R] = T;
|
|
40
|
-
return (T.length > 0 ? [
|
|
41
|
-
}
|
|
42
|
-
export function
|
|
43
|
-
return (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
schema)
|
|
47
|
-
|
|
48
|
-
export function Uncapitalize(T, options = {}) {
|
|
49
|
-
return CloneType(IntrinsicResolve(T, 'Uncapitalize'), options);
|
|
50
|
-
}
|
|
51
|
-
export function Uppercase(T, options = {}) {
|
|
52
|
-
return CloneType(IntrinsicResolve(T, 'Uppercase'), options);
|
|
53
|
-
}
|
|
54
|
-
export function Lowercase(T, options = {}) {
|
|
55
|
-
return CloneType(IntrinsicResolve(T, 'Lowercase'), options);
|
|
56
|
-
}
|
|
57
|
-
export function Capitalize(T, options = {}) {
|
|
58
|
-
return CloneType(IntrinsicResolve(T, 'Capitalize'), options);
|
|
40
|
+
return (T.length > 0 ? [Intrinsic(L, mode), ...FromRest(R, mode)] : []);
|
|
41
|
+
}
|
|
42
|
+
export function Intrinsic(schema, mode) {
|
|
43
|
+
return (IsMappedKeyType(schema) ? IntrinsicMappedResult(schema, mode) :
|
|
44
|
+
IsTemplateLiteralType(schema) ? FromTemplateLiteral(schema, mode) :
|
|
45
|
+
IsUnionType(schema) ? Union(FromRest(schema.anyOf, mode)) :
|
|
46
|
+
IsLiteralType(schema) ? Literal(FromLiteralValue(schema.const, mode)) :
|
|
47
|
+
schema);
|
|
59
48
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { TIntrinsic } from './intrinsic.mjs';
|
|
3
|
+
export type TLowercase<T extends TSchema> = TIntrinsic<T, 'Lowercase'>;
|
|
4
|
+
export declare function Lowercase<T extends TSchema>(T: T, options?: SchemaOptions): TLowercase<T>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { TIntrinsic } from './intrinsic.mjs';
|
|
3
|
+
export type TUncapitalize<T extends TSchema> = TIntrinsic<T, 'Uncapitalize'>;
|
|
4
|
+
export declare function Uncapitalize<T extends TSchema>(T: T, options?: SchemaOptions): TUncapitalize<T>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { TSchema, SchemaOptions } from '../schema/index.mjs';
|
|
2
|
+
import { TIntrinsic } from './intrinsic.mjs';
|
|
3
|
+
export type TUppercase<T extends TSchema> = TIntrinsic<T, 'Uppercase'>;
|
|
4
|
+
export declare function Uppercase<T extends TSchema>(T: T, options?: SchemaOptions): TUppercase<T>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TSchema } from '../schema/index.mjs';
|
|
2
|
+
import { Kind } from '../symbols/index.mjs';
|
|
3
|
+
export interface TMappedKey<T extends PropertyKey[] = PropertyKey[]> extends TSchema {
|
|
4
|
+
[Kind]: 'MappedKey';
|
|
5
|
+
static: T[number];
|
|
6
|
+
keys: T;
|
|
7
|
+
}
|
|
8
|
+
export declare function MappedKey<T extends PropertyKey[]>(T: [...T]): TMappedKey<T>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TSchema } from '../schema/index.mjs';
|
|
2
|
+
import type { TProperties } from '../object/index.mjs';
|
|
3
|
+
import { Kind } from '../symbols/index.mjs';
|
|
4
|
+
export interface TMappedResult<T extends TProperties = TProperties> extends TSchema {
|
|
5
|
+
[Kind]: 'MappedResult';
|
|
6
|
+
properties: T;
|
|
7
|
+
static: unknown;
|
|
8
|
+
}
|
|
9
|
+
export declare function MappedResult<T extends TProperties>(properties: T): TMappedResult<T>;
|