typebox 1.0.69 → 1.0.70
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.
|
@@ -49,5 +49,7 @@ type TKeywordsIntersected<Schemas extends unknown[], Result extends unknown = un
|
|
|
49
49
|
type TKeywordsEvaluated<Schema extends unknown, Result extends unknown = Schema extends object ? {
|
|
50
50
|
[Key in keyof Schema]: Schema[Key];
|
|
51
51
|
} : Schema> = Result;
|
|
52
|
-
export type
|
|
52
|
+
export type XStaticObject<Stack extends string[], Root extends XSchema, Schema extends XSchema, Keywords extends unknown[] = TFromKeywords<Stack, Root, Schema>, Intersected extends unknown = TKeywordsIntersected<Keywords>, Evaluated extends unknown = TKeywordsEvaluated<Intersected>> = Evaluated;
|
|
53
|
+
export type XStaticBoolean<Schema extends boolean, Result extends unknown = Schema extends false ? never : unknown> = Result;
|
|
54
|
+
export type XStaticSchema<Stack extends string[], Root extends XSchema, Schema extends XSchema, Result extends unknown = Schema extends boolean ? XStaticBoolean<Schema> : XStaticObject<Stack, Root, Schema>> = Result;
|
|
53
55
|
export {};
|
|
@@ -6,7 +6,9 @@ import { type TNumber } from './number.mjs';
|
|
|
6
6
|
import { type TString } from './string.mjs';
|
|
7
7
|
import { type TDeferred } from './deferred.mjs';
|
|
8
8
|
import { type TInstantiate } from '../engine/instantiate.mjs';
|
|
9
|
-
|
|
9
|
+
import { type TTemplateLiteralStatic } from '../engine/template-literal/index.mjs';
|
|
10
|
+
type StaticPropertyKey<Key extends string, Result extends PropertyKey = (Key extends TStringKey ? string : Key extends TIntegerKey ? number : Key extends TNumberKey ? number : Key extends `^${string}$` ? TTemplateLiteralStatic<Key> : string)> = Result;
|
|
11
|
+
export type StaticRecord<Stack extends string[], Direction extends StaticDirection, Context extends TProperties, This extends TProperties, Key extends string, Value extends TSchema, StaticKey extends PropertyKey = StaticPropertyKey<Key>, StaticValue extends unknown = StaticType<Stack, Direction, Context, This, Value>> = Record<StaticKey, StaticValue>;
|
|
10
12
|
export type TStringKey = typeof StringKey;
|
|
11
13
|
export type TIntegerKey = typeof IntegerKey;
|
|
12
14
|
export type TNumberKey = typeof NumberKey;
|
|
@@ -42,3 +44,4 @@ export type TRecordValue<Type extends TRecord, Result extends TSchema = Type['pa
|
|
|
42
44
|
export declare function RecordValue<Type extends TRecord>(type: Type): TRecordValue<Type>;
|
|
43
45
|
export declare function IsRecord(value: unknown): value is TRecord;
|
|
44
46
|
export declare function RecordOptions(type: TRecord): TObjectOptions;
|
|
47
|
+
export {};
|