@sinclair/typebox 0.26.0-dev.2 → 0.26.0-dev.4
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/compiler/compiler.d.ts +33 -33
- package/compiler/compiler.js +536 -536
- package/compiler/index.d.ts +2 -2
- package/compiler/index.js +47 -47
- package/errors/errors.d.ts +84 -84
- package/errors/errors.js +570 -570
- package/errors/index.d.ts +1 -1
- package/errors/index.js +44 -44
- package/package.json +2 -2
- package/readme.md +1 -7
- package/system/index.d.ts +1 -1
- package/system/index.js +44 -44
- package/system/system.d.ts +20 -20
- package/system/system.js +69 -69
- package/typebox.d.ts +656 -649
- package/typebox.js +1889 -1883
- package/value/cast.d.ts +26 -26
- package/value/cast.js +348 -348
- package/value/check.d.ts +8 -8
- package/value/check.js +450 -450
- package/value/clone.d.ts +3 -3
- package/value/clone.js +71 -71
- package/value/convert.d.ts +13 -13
- package/value/convert.js +345 -345
- package/value/create.d.ts +18 -18
- package/value/create.js +430 -430
- package/value/delta.d.ts +43 -43
- package/value/delta.js +204 -204
- package/value/equal.d.ts +3 -3
- package/value/equal.js +80 -80
- package/value/hash.d.ts +8 -8
- package/value/hash.js +208 -208
- package/value/index.d.ts +5 -5
- package/value/index.js +56 -56
- package/value/is.d.ts +11 -11
- package/value/is.js +53 -53
- package/value/pointer.d.ts +24 -24
- package/value/pointer.js +142 -142
- package/value/value.d.ts +26 -26
- package/value/value.js +93 -93
package/compiler/compiler.d.ts
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import * as Types from '../typebox';
|
|
2
|
-
import { ValueErrorIterator } from '../errors/index';
|
|
3
|
-
export type CheckFunction = (value: unknown) => boolean;
|
|
4
|
-
export declare class TypeCheck<T extends Types.TSchema> {
|
|
5
|
-
private readonly schema;
|
|
6
|
-
private readonly checkFunc;
|
|
7
|
-
private readonly code;
|
|
8
|
-
constructor(schema: T, checkFunc: CheckFunction, code: string);
|
|
9
|
-
/** Returns the generated assertion code used to validate this type. */
|
|
10
|
-
Code(): string;
|
|
11
|
-
/** Returns an iterator for each error in this value. */
|
|
12
|
-
Errors(value: unknown): ValueErrorIterator;
|
|
13
|
-
/** Returns true if the value matches the compiled type. */
|
|
14
|
-
Check(value: unknown): value is Types.Static<T>;
|
|
15
|
-
}
|
|
16
|
-
export declare namespace MemberExpression {
|
|
17
|
-
function Encode(object: string, key: string): string;
|
|
18
|
-
}
|
|
19
|
-
export declare class TypeCompilerUnknownTypeError extends Error {
|
|
20
|
-
readonly schema: Types.TSchema;
|
|
21
|
-
constructor(schema: Types.TSchema);
|
|
22
|
-
}
|
|
23
|
-
export declare class TypeCompilerPreflightCheckError extends Error {
|
|
24
|
-
readonly schema: Types.TSchema;
|
|
25
|
-
constructor(schema: Types.TSchema);
|
|
26
|
-
}
|
|
27
|
-
/** Compiles Types for Runtime Type Checking */
|
|
28
|
-
export declare namespace TypeCompiler {
|
|
29
|
-
/** Returns the generated assertion code used to validate this type. */
|
|
30
|
-
function Code<T extends Types.TSchema>(schema: T): string;
|
|
31
|
-
/** Compiles the given type for runtime type checking. This compiler only accepts known TypeBox types non-inclusive of unsafe types. */
|
|
32
|
-
function Compile<T extends Types.TSchema>(schema: T): TypeCheck<T>;
|
|
33
|
-
}
|
|
1
|
+
import * as Types from '../typebox';
|
|
2
|
+
import { ValueErrorIterator } from '../errors/index';
|
|
3
|
+
export type CheckFunction = (value: unknown) => boolean;
|
|
4
|
+
export declare class TypeCheck<T extends Types.TSchema> {
|
|
5
|
+
private readonly schema;
|
|
6
|
+
private readonly checkFunc;
|
|
7
|
+
private readonly code;
|
|
8
|
+
constructor(schema: T, checkFunc: CheckFunction, code: string);
|
|
9
|
+
/** Returns the generated assertion code used to validate this type. */
|
|
10
|
+
Code(): string;
|
|
11
|
+
/** Returns an iterator for each error in this value. */
|
|
12
|
+
Errors(value: unknown): ValueErrorIterator;
|
|
13
|
+
/** Returns true if the value matches the compiled type. */
|
|
14
|
+
Check(value: unknown): value is Types.Static<T>;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace MemberExpression {
|
|
17
|
+
function Encode(object: string, key: string): string;
|
|
18
|
+
}
|
|
19
|
+
export declare class TypeCompilerUnknownTypeError extends Error {
|
|
20
|
+
readonly schema: Types.TSchema;
|
|
21
|
+
constructor(schema: Types.TSchema);
|
|
22
|
+
}
|
|
23
|
+
export declare class TypeCompilerPreflightCheckError extends Error {
|
|
24
|
+
readonly schema: Types.TSchema;
|
|
25
|
+
constructor(schema: Types.TSchema);
|
|
26
|
+
}
|
|
27
|
+
/** Compiles Types for Runtime Type Checking */
|
|
28
|
+
export declare namespace TypeCompiler {
|
|
29
|
+
/** Returns the generated assertion code used to validate this type. */
|
|
30
|
+
function Code<T extends Types.TSchema>(schema: T): string;
|
|
31
|
+
/** Compiles the given type for runtime type checking. This compiler only accepts known TypeBox types non-inclusive of unsafe types. */
|
|
32
|
+
function Compile<T extends Types.TSchema>(schema: T): TypeCheck<T>;
|
|
33
|
+
}
|