@sinclair/typebox 0.32.17 → 0.32.18
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TUnsafe } from '../type/unsafe/index.mjs';
|
|
1
2
|
import { TypeBoxError } from '../type/error/index.mjs';
|
|
2
3
|
export declare class TypeSystemDuplicateTypeKind extends TypeBoxError {
|
|
3
4
|
constructor(kind: string);
|
|
@@ -5,10 +6,11 @@ export declare class TypeSystemDuplicateTypeKind extends TypeBoxError {
|
|
|
5
6
|
export declare class TypeSystemDuplicateFormat extends TypeBoxError {
|
|
6
7
|
constructor(kind: string);
|
|
7
8
|
}
|
|
9
|
+
export type TypeFactoryFunction<Type, Options = Record<PropertyKey, unknown>> = (options?: Partial<Options>) => TUnsafe<Type>;
|
|
8
10
|
/** Creates user defined types and formats and provides overrides for value checking behaviours */
|
|
9
11
|
export declare namespace TypeSystem {
|
|
10
12
|
/** Creates a new type */
|
|
11
|
-
function Type<Type, Options = Record<PropertyKey, unknown>>(kind: string, check: (options: Options, value: unknown) => boolean):
|
|
13
|
+
function Type<Type, Options = Record<PropertyKey, unknown>>(kind: string, check: (options: Options, value: unknown) => boolean): TypeFactoryFunction<Type, Options>;
|
|
12
14
|
/** Creates a new string format */
|
|
13
15
|
function Format<F extends string>(format: F, check: (value: string) => boolean): F;
|
|
14
16
|
}
|
|
@@ -15,9 +15,6 @@ export class TypeSystemDuplicateFormat extends TypeBoxError {
|
|
|
15
15
|
super(`Duplicate string format '${kind}' detected`);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
// ------------------------------------------------------------------
|
|
19
|
-
// TypeSystem
|
|
20
|
-
// ------------------------------------------------------------------
|
|
21
18
|
/** Creates user defined types and formats and provides overrides for value checking behaviours */
|
|
22
19
|
export var TypeSystem;
|
|
23
20
|
(function (TypeSystem) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type TUnsafe } from '../type/unsafe/index';
|
|
1
2
|
import { TypeBoxError } from '../type/error/index';
|
|
2
3
|
export declare class TypeSystemDuplicateTypeKind extends TypeBoxError {
|
|
3
4
|
constructor(kind: string);
|
|
@@ -5,10 +6,11 @@ export declare class TypeSystemDuplicateTypeKind extends TypeBoxError {
|
|
|
5
6
|
export declare class TypeSystemDuplicateFormat extends TypeBoxError {
|
|
6
7
|
constructor(kind: string);
|
|
7
8
|
}
|
|
9
|
+
export type TypeFactoryFunction<Type, Options = Record<PropertyKey, unknown>> = (options?: Partial<Options>) => TUnsafe<Type>;
|
|
8
10
|
/** Creates user defined types and formats and provides overrides for value checking behaviours */
|
|
9
11
|
export declare namespace TypeSystem {
|
|
10
12
|
/** Creates a new type */
|
|
11
|
-
function Type<Type, Options = Record<PropertyKey, unknown>>(kind: string, check: (options: Options, value: unknown) => boolean):
|
|
13
|
+
function Type<Type, Options = Record<PropertyKey, unknown>>(kind: string, check: (options: Options, value: unknown) => boolean): TypeFactoryFunction<Type, Options>;
|
|
12
14
|
/** Creates a new string format */
|
|
13
15
|
function Format<F extends string>(format: F, check: (value: string) => boolean): F;
|
|
14
16
|
}
|
|
@@ -21,9 +21,6 @@ class TypeSystemDuplicateFormat extends index_4.TypeBoxError {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.TypeSystemDuplicateFormat = TypeSystemDuplicateFormat;
|
|
24
|
-
// ------------------------------------------------------------------
|
|
25
|
-
// TypeSystem
|
|
26
|
-
// ------------------------------------------------------------------
|
|
27
24
|
/** Creates user defined types and formats and provides overrides for value checking behaviours */
|
|
28
25
|
var TypeSystem;
|
|
29
26
|
(function (TypeSystem) {
|