@sinclair/typebox 0.25.22 → 0.25.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.
- package/package.json +1 -1
- package/typebox.d.ts +5 -10
package/package.json
CHANGED
package/typebox.d.ts
CHANGED
|
@@ -172,17 +172,12 @@ export type OptionalPropertyKeys<T extends TProperties> = {
|
|
|
172
172
|
[K in keyof T]: T[K] extends TOptional<TSchema> ? K : never;
|
|
173
173
|
}[keyof T];
|
|
174
174
|
export type RequiredPropertyKeys<T extends TProperties> = keyof Omit<T, ReadonlyOptionalPropertyKeys<T> | ReadonlyPropertyKeys<T> | OptionalPropertyKeys<T>>;
|
|
175
|
-
export type
|
|
176
|
-
|
|
177
|
-
} & {
|
|
178
|
-
readonly [K in ReadonlyPropertyKeys<T>]: Static<T[K], P>;
|
|
179
|
-
} & {
|
|
180
|
-
[K in OptionalPropertyKeys<T>]?: Static<T[K], P>;
|
|
181
|
-
} & {
|
|
182
|
-
[K in RequiredPropertyKeys<T>]: Static<T[K], P>;
|
|
183
|
-
} extends infer R ? {
|
|
184
|
-
[K in keyof R]: R[K];
|
|
175
|
+
export type PropertiesReducer<T extends TProperties, R extends Record<keyof any, unknown>> = (Readonly<Partial<Pick<R, ReadonlyOptionalPropertyKeys<T>>>> & Readonly<Pick<R, ReadonlyPropertyKeys<T>>> & Partial<Pick<R, OptionalPropertyKeys<T>>> & Required<Pick<R, RequiredPropertyKeys<T>>>) extends infer O ? {
|
|
176
|
+
[K in keyof O]: O[K];
|
|
185
177
|
} : never;
|
|
178
|
+
export type PropertiesReduce<T extends TProperties, P extends unknown[]> = PropertiesReducer<T, {
|
|
179
|
+
[K in keyof T]: Static<T[K], P>;
|
|
180
|
+
}>;
|
|
186
181
|
export type TRecordProperties<K extends TUnion<TLiteral[]>, T extends TSchema> = Static<K> extends string ? {
|
|
187
182
|
[X in Static<K>]: T;
|
|
188
183
|
} : never;
|