@sinclair/typebox 0.24.35 → 0.24.36
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/package.json +1 -1
- package/typebox.d.ts +4 -1
package/package.json
CHANGED
package/typebox.d.ts
CHANGED
|
@@ -103,9 +103,12 @@ export declare type IntersectEvaluate<T extends readonly TSchema[], P extends un
|
|
|
103
103
|
[K in keyof T]: T[K] extends TSchema ? Static<T[K], P> : never;
|
|
104
104
|
};
|
|
105
105
|
export declare type IntersectReduce<I extends unknown, T extends readonly any[]> = T extends [infer A, ...infer B] ? IntersectReduce<I & A, B> : I extends object ? I : {};
|
|
106
|
+
export declare type IntersectProperties<T extends TObject[]> = UnionToIntersect<{
|
|
107
|
+
[I in keyof T]: T[I]['properties'];
|
|
108
|
+
}[number]> extends infer P ? (P extends TProperties ? P : TProperties) : never;
|
|
106
109
|
export interface TIntersect<T extends TObject[] = TObject[]> extends TObject {
|
|
107
110
|
static: IntersectReduce<unknown, IntersectEvaluate<T, this['params']>>;
|
|
108
|
-
properties:
|
|
111
|
+
properties: IntersectProperties<T>;
|
|
109
112
|
}
|
|
110
113
|
export declare type UnionToIntersect<U> = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never;
|
|
111
114
|
export declare type UnionLast<U> = UnionToIntersect<U extends unknown ? (x: U) => 0 : never> extends (x: infer L) => 0 ? L : never;
|