@sinclair/typebox 0.24.45 → 0.24.47
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 +8 -4
package/package.json
CHANGED
package/typebox.d.ts
CHANGED
|
@@ -195,7 +195,9 @@ export interface TOmit<T extends TObject, Properties extends ObjectPropertyKeys<
|
|
|
195
195
|
}
|
|
196
196
|
export interface TPartial<T extends TObject> extends TObject {
|
|
197
197
|
static: Partial<Static<T, this['params']>>;
|
|
198
|
-
properties:
|
|
198
|
+
properties: {
|
|
199
|
+
[K in keyof T['properties']]: T['properties'][K] extends TReadonlyOptional<infer U> ? TReadonlyOptional<U> : T['properties'][K] extends TReadonly<infer U> ? TReadonlyOptional<U> : T['properties'][K] extends TOptional<infer U> ? TOptional<U> : TOptional<T['properties'][K]>;
|
|
200
|
+
};
|
|
199
201
|
}
|
|
200
202
|
export declare type TPick<T extends TObject, Properties extends ObjectPropertyKeys<T>[]> = TObject<{
|
|
201
203
|
[K in Properties[number]]: T['properties'][K];
|
|
@@ -232,7 +234,9 @@ export interface TRef<T extends TSchema = TSchema> extends TSchema {
|
|
|
232
234
|
}
|
|
233
235
|
export interface TRequired<T extends TObject | TRef<TObject>> extends TObject {
|
|
234
236
|
static: Required<Static<T, this['params']>>;
|
|
235
|
-
properties:
|
|
237
|
+
properties: {
|
|
238
|
+
[K in keyof T['properties']]: T['properties'][K] extends TReadonlyOptional<infer U> ? TReadonly<U> : T['properties'][K] extends TReadonly<infer U> ? TReadonly<U> : T['properties'][K] extends TOptional<infer U> ? U : T['properties'][K];
|
|
239
|
+
};
|
|
236
240
|
}
|
|
237
241
|
export declare type StringFormatOption = 'date-time' | 'time' | 'date' | 'email' | 'idn-email' | 'hostname' | 'idn-hostname' | 'ipv4' | 'ipv6' | 'uri' | 'uri-reference' | 'iri' | 'uuid' | 'iri-reference' | 'uri-template' | 'json-pointer' | 'relative-json-pointer' | 'regex';
|
|
238
242
|
export interface StringOptions<Format extends string> extends SchemaOptions {
|
|
@@ -349,7 +353,7 @@ export declare class TypeBuilder {
|
|
|
349
353
|
/** Creates a new object whose properties are omitted from the given object */
|
|
350
354
|
Omit<T extends TObject, K extends TUnion<TLiteral<string>[]>>(schema: T, keys: K, options?: ObjectOptions): TOmit<T, UnionStringLiteralToTuple<K>>;
|
|
351
355
|
/** Creates a new object whose properties are omitted from the given object */
|
|
352
|
-
Omit<T extends TObject, K extends ObjectPropertyKeys<T>[]>(schema: T, keys: [...K], options?: ObjectOptions): TOmit<T, K>;
|
|
356
|
+
Omit<T extends TObject, K extends ObjectPropertyKeys<T>[]>(schema: T, keys: readonly [...K], options?: ObjectOptions): TOmit<T, K>;
|
|
353
357
|
/** Creates a tuple type from this functions parameters */
|
|
354
358
|
Parameters<T extends TFunction<any[], any>>(schema: T, options?: SchemaOptions): TParameters<T>;
|
|
355
359
|
/** Creates an object type whose properties are all optional */
|
|
@@ -357,7 +361,7 @@ export declare class TypeBuilder {
|
|
|
357
361
|
/** Creates a object whose properties are picked from the given object */
|
|
358
362
|
Pick<T extends TObject, K extends TUnion<TLiteral<string>[]>>(schema: T, keys: K, options?: ObjectOptions): TPick<T, UnionStringLiteralToTuple<K>>;
|
|
359
363
|
/** Creates a object whose properties are picked from the given object */
|
|
360
|
-
Pick<T extends TObject, K extends ObjectPropertyKeys<T>[]>(schema: T, keys: [...K], options?: ObjectOptions): TPick<T, K>;
|
|
364
|
+
Pick<T extends TObject, K extends ObjectPropertyKeys<T>[]>(schema: T, keys: readonly [...K], options?: ObjectOptions): TPick<T, K>;
|
|
361
365
|
/** Creates a promise type. This type cannot be represented in schema. */
|
|
362
366
|
Promise<T extends TSchema>(item: T, options?: SchemaOptions): TPromise<T>;
|
|
363
367
|
/** Creates an object whose properties are derived from the given string literal union. */
|