anyThe Annotations namespace groups all annotation interfaces used to attach
metadata to schemas. Annotations control documentation, validation messages,
JSON Schema generation, equivalence, arbitrary generation, and more.
Details
Use resolveAnnotations to read the annotations attached to a schema at runtime.
export declare namespace Annotations {
/**
* This interface is used to define the annotations that can be attached to a
* schema. You can extend this interface to define your own annotations.
*
* **Details**
*
* Note that both a missing key or `undefined` is used to indicate that the
* annotation is not present.
*
* This means that can remove any annotation by setting it to `undefined`.
*
* **Example** (Defining your own annotations)
*
* ```ts
* import { Schema } from "effect"
*
* // Extend the Annotations interface with a custom `version` annotation
* declare module "effect/Schema" {
* namespace Annotations {
* interface Annotations {
* readonly version?:
* | readonly [major: number, minor: number, patch: number]
* | undefined
* }
* }
* }
*
* // The `version` annotation is now recognized by the TypeScript compiler
* const schema = Schema.String.annotate({ version: [1, 2, 0] })
*
* // const version: readonly [major: number, minor: number, patch: number] | undefined
* const version = Schema.resolveAnnotations(schema)?.["version"]
*
* if (version) {
* // Access individual parts of the version
* console.log(version[1])
* // Output: 2
* }
* ```
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.AnnotationsThis interface is used to define the annotations that can be attached to a
schema. You can extend this interface to define your own annotations.
Details
Note that both a missing key or undefined is used to indicate that the
annotation is not present.
This means that can remove any annotation by setting it to undefined.
Example (Defining your own annotations)
import { Schema } from "effect"
// Extend the Annotations interface with a custom `version` annotation
declare module "effect/Schema" {
namespace Annotations {
interface Annotations {
readonly version?:
| readonly [major: number, minor: number, patch: number]
| undefined
}
}
}
// The `version` annotation is now recognized by the TypeScript compiler
const schema = Schema.String.annotate({ version: [1, 2, 0] })
// const version: readonly [major: number, minor: number, patch: number] | undefined
const version = Schema.resolveAnnotations(schema)?.["version"]
if (version) {
// Access individual parts of the version
console.log(version[1])
// Output: 2
}
Annotations {
readonly [x: stringx: string]: unknown
}
/**
* Annotations shared by all schema nodes. These map to common JSON Schema /
* OpenAPI fields: `title`, `description`, `format`, etc.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.AugmentAnnotations shared by all schema nodes. These map to common JSON Schema /
OpenAPI fields: title, description, format, etc.
Augment extends interface Annotations.AnnotationsThis interface is used to define the annotations that can be attached to a
schema. You can extend this interface to define your own annotations.
Details
Note that both a missing key or undefined is used to indicate that the
annotation is not present.
This means that can remove any annotation by setting it to undefined.
Example (Defining your own annotations)
import { Schema } from "effect"
// Extend the Annotations interface with a custom `version` annotation
declare module "effect/Schema" {
namespace Annotations {
interface Annotations {
readonly version?:
| readonly [major: number, minor: number, patch: number]
| undefined
}
}
}
// The `version` annotation is now recognized by the TypeScript compiler
const schema = Schema.String.annotate({ version: [1, 2, 0] })
// const version: readonly [major: number, minor: number, patch: number] | undefined
const version = Schema.resolveAnnotations(schema)?.["version"]
if (version) {
// Access individual parts of the version
console.log(version[1])
// Output: 2
}
Annotations {
/**
* Human-readable description of what a value is expected to satisfy.
*
* **Details**
*
* For filter and refinement failures, the default formatter uses
* `message` first, then `expected`, and finally falls back to `<filter>`.
*
* Use this to name a failed filter in the default message:
* `Expected <expected>, got <actual>`.
*/
readonly Annotations.Augment.expected?: string | undefinedHuman-readable description of what a value is expected to satisfy.
Details
For filter and refinement failures, the default formatter uses
message first, then expected, and finally falls back to <filter>.
Use this to name a failed filter in the default message:
Expected <expected>, got <actual>.
expected?: string | undefined
readonly Annotations.Augment.title?: string | undefinedtitle?: string | undefined
readonly Annotations.Augment.description?: string | undefineddescription?: string | undefined
readonly Annotations.Augment.documentation?: string | undefineddocumentation?: string | undefined
readonly Annotations.Augment.readOnly?: boolean | undefinedreadOnly?: boolean | undefined
readonly Annotations.Augment.writeOnly?: boolean | undefinedwriteOnly?: boolean | undefined
readonly Annotations.Augment.format?: string | undefinedformat?: string | undefined
readonly Annotations.Augment.contentEncoding?: string | undefinedcontentEncoding?: string | undefined
readonly Annotations.Augment.contentMediaType?: string | undefinedcontentMediaType?: string | undefined
}
/**
* Extends {@link Augment} with type-parametric `default` and `examples` fields.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.Documentation<T>Extends
Augment
with type-parametric default and examples fields.
Documentation<function (type parameter) T in Documentation<T>T> extends interface Annotations.AugmentAnnotations shared by all schema nodes. These map to common JSON Schema /
OpenAPI fields: title, description, format, etc.
Augment {
readonly Annotations.Documentation<T>.default?: T | undefineddefault?: function (type parameter) T in Documentation<T>T | undefined
readonly Annotations.Documentation<T>.examples?: readonly T[] | undefinedexamples?: interface ReadonlyArray<T>ReadonlyArray<function (type parameter) T in Documentation<T>T> | undefined
}
/**
* Annotations for struct property schemas. Extends {@link Documentation}
* with an optional `messageMissingKey` to override the error message when
* the property key is absent during decoding.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.Key<T>Annotations for struct property schemas. Extends
Documentation
with an optional messageMissingKey to override the error message when
the property key is absent during decoding.
Key<function (type parameter) T in Key<T>T> extends interface Annotations.Documentation<T>Extends
Augment
with type-parametric default and examples fields.
Documentation<function (type parameter) T in Key<T>T> {
/**
* The message to use when a key is missing.
*/
readonly Annotations.Key<T>.messageMissingKey?: string | undefinedThe message to use when a key is missing.
messageMissingKey?: string | undefined
}
/**
* Base annotations shared by all composite schema nodes. Extends
* {@link Documentation} with error messages, branding, parse options, and
* arbitrary generation hooks. {@link Declaration} and other annotation
* interfaces build on top of this.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>Base annotations shared by all composite schema nodes. Extends
Documentation
with error messages, branding, parse options, and
arbitrary generation hooks.
Declaration
and other annotation
interfaces build on top of this.
Bottom<function (type parameter) T in Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>T, function (type parameter) TypeParameters in Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint>> extends interface Annotations.Documentation<T>Extends
Augment
with type-parametric default and examples fields.
Documentation<function (type parameter) T in Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>T> {
/**
* Complete message to use when this schema node reports an issue.
*
* **Details**
*
* This replaces the default message for matching issue types instead of
* only changing the expected label. For a filter or refinement failure,
* annotate the filter with `message` to replace the whole filter failure
* message, or `expected` to keep the default
* `Expected <expected>, got <actual>` shape.
*/
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.message?: string | undefinedComplete message to use when this schema node reports an issue.
Details
This replaces the default message for matching issue types instead of
only changing the expected label. For a filter or refinement failure,
annotate the filter with message to replace the whole filter failure
message, or expected to keep the default
Expected <expected>, got <actual> shape.
message?: string | undefined
/**
* The message to use when a key is unexpected.
*/
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.messageUnexpectedKey?: string | undefinedThe message to use when a key is unexpected.
messageUnexpectedKey?: string | undefined
/**
* Stable identifier for this schema node.
*
* **Details**
*
* Identifiers are used by schema tooling, including JSON Schema
* generation, to name references. The default formatter also uses
* `identifier` as the expected label for type-level failures, such as
* `Expected UserId, got null`.
*
* `identifier` does not name a failed filter or refinement. If the base
* type matches and a filter fails, put `expected` or `message` on the
* filter/refinement instead.
*/
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.identifier?: string | undefinedStable identifier for this schema node.
Details
Identifiers are used by schema tooling, including JSON Schema
generation, to name references. The default formatter also uses
identifier as the expected label for type-level failures, such as
Expected UserId, got null.
identifier does not name a failed filter or refinement. If the base
type matches and a filter fails, put expected or message on the
filter/refinement instead.
identifier?: string | undefined
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.parseOptions?: SchemaAST.ParseOptions | undefinedparseOptions?: import SchemaASTSchemaAST.ParseOptions | undefined
/**
* Optional metadata used to identify or extend the filter with custom data.
*/
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.meta?: Meta | undefinedOptional metadata used to identify or extend the filter with custom data.
meta?: type Annotations.Meta = {
readonly _tag: "isStringFinite";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringBigInt";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringSymbol";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isMinLength";
readonly minLength: number;
} | {
readonly _tag: "isMaxLength";
readonly maxLength: number;
} | {
readonly _tag: "isLengthBetween";
readonly minimum: number;
readonly maximum: number;
} | {
readonly _tag: "isPattern";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isTrimmed";
readonly regExp: globalThis.RegExp;
} | ... 38 more ... | {
...;
}
Union of built-in and user-augmented schema filter metadata payloads.
Meta | undefined
/**
* Accumulated brands when multiple brands are added with `Schema.brand`.
*/
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.brands?: readonly string[] | undefinedAccumulated brands when multiple brands are added with Schema.brand.
brands?: interface ReadonlyArray<T>ReadonlyArray<string> | undefined
readonly Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>.toArbitrary?: ToArbitrary.Declaration<T, TypeParameters> | undefinedtoArbitrary?:
| namespace Annotations.ToArbitraryTypes used by arbitrary-derivation annotations to configure toArbitrary
hooks, filter hints, candidate sources, diagnostics, and merged generation
constraints.
ToArbitrary.interface Annotations.ToArbitrary.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema arbitrary annotations.
Details
Type parameters expose normal and terminal generators. A declaration with
no type parameters can return a bare arbitrary; a generic declaration
must return terminal explicitly when it has a finite branch depending on
parameters.
Declaration<function (type parameter) T in Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>T, function (type parameter) TypeParameters in Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters>
| undefined
}
/**
* Helpers for projecting declaration type-parameter schemas into decoded or
* encoded codec arrays used by annotation hooks.
*
* @since 4.0.0
*/
export namespace namespace Annotations.TypeParametersHelpers for projecting declaration type-parameter schemas into decoded or
encoded codec arrays used by annotation hooks.
TypeParameters {
/**
* Maps declaration type-parameter schemas to codecs for their decoded `Type`
* values.
*
* @category utility types
* @since 4.0.0
*/
export type type Annotations.TypeParameters.Type<TypeParameters extends ReadonlyArray<Constraint>> = { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Type"], TypeParameters[K]["Type"], never, never>; }Maps declaration type-parameter schemas to codecs for their decoded Type
values.
Type<function (type parameter) TypeParameters in type Annotations.TypeParameters.Type<TypeParameters extends ReadonlyArray<Constraint>>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint>> = {
readonly [function (type parameter) KK in keyof function (type parameter) TypeParameters in type Annotations.TypeParameters.Type<TypeParameters extends ReadonlyArray<Constraint>>TypeParameters]: interface Codec<out T, out E = T, out RD = never, out RE = never>Namespace of type-level helpers for
Codec
.
A schema that tracks the decoded type T, the encoded type E, and the
Effect services required during decoding (RD) and encoding (RE).
Details
Use Codec<T, E, RD, RE> when you need to preserve full type information
about a schema — both what it decodes to and what it serializes from/to.
Most concrete schemas produced by this module implement Codec.
For APIs that only need one direction, prefer the narrower views:
Decoder
<T, RD> — decode-only
Encoder
<E, RE> — encode-only
Schema
<T> — type-only (no encoded representation)
Example (Accepting a codec that decodes to number from string)
import { Schema } from "effect"
declare function serialize<T>(codec: Schema.Codec<T, string>): string
serialize(Schema.NumberFromString) // ok — decodes number, encoded as string
Codec<function (type parameter) TypeParameters in type Annotations.TypeParameters.Type<TypeParameters extends ReadonlyArray<Constraint>>TypeParameters[function (type parameter) KK]["Type"]>
}
/**
* Maps declaration type-parameter schemas to codecs for their `Encoded` values.
*
* @category utility types
* @since 4.0.0
*/
export type type Annotations.TypeParameters.Encoded<TypeParameters extends ReadonlyArray<Constraint>> = { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Encoded"], TypeParameters[K]["Encoded"], never, never>; }Maps declaration type-parameter schemas to codecs for their Encoded values.
Encoded<function (type parameter) TypeParameters in type Annotations.TypeParameters.Encoded<TypeParameters extends ReadonlyArray<Constraint>>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint>> = {
readonly [function (type parameter) KK in keyof function (type parameter) TypeParameters in type Annotations.TypeParameters.Encoded<TypeParameters extends ReadonlyArray<Constraint>>TypeParameters]: interface Codec<out T, out E = T, out RD = never, out RE = never>Namespace of type-level helpers for
Codec
.
A schema that tracks the decoded type T, the encoded type E, and the
Effect services required during decoding (RD) and encoding (RE).
Details
Use Codec<T, E, RD, RE> when you need to preserve full type information
about a schema — both what it decodes to and what it serializes from/to.
Most concrete schemas produced by this module implement Codec.
For APIs that only need one direction, prefer the narrower views:
Decoder
<T, RD> — decode-only
Encoder
<E, RE> — encode-only
Schema
<T> — type-only (no encoded representation)
Example (Accepting a codec that decodes to number from string)
import { Schema } from "effect"
declare function serialize<T>(codec: Schema.Codec<T, string>): string
serialize(Schema.NumberFromString) // ok — decodes number, encoded as string
Codec<function (type parameter) TypeParameters in type Annotations.TypeParameters.Encoded<TypeParameters extends ReadonlyArray<Constraint>>TypeParameters[function (type parameter) KK]["Encoded"]>
}
}
/**
* Full annotation set for `Declaration` schema nodes — used when defining
* custom, opaque schema types via `Schema.declare`. Extends {@link Bottom}
* with optional codec, arbitrary, equivalence, and formatter hooks so that
* derived capabilities (JSON encoding, property testing, etc.) can be
* provided for the custom type.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>Full annotation set for Declaration schema nodes — used when defining
custom, opaque schema types via Schema.declare. Extends
Bottom
with optional codec, arbitrary, equivalence, and formatter hooks so that
derived capabilities (JSON encoding, property testing, etc.) can be
provided for the custom type.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint> = readonly []>
extends interface Annotations.Bottom<T, TypeParameters extends ReadonlyArray<Constraint>>Base annotations shared by all composite schema nodes. Extends
Documentation
with error messages, branding, parse options, and
arbitrary generation hooks.
Declaration
and other annotation
interfaces build on top of this.
Bottom<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters>
{
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.toCodec?: ((typeParameters: TypeParameters.Encoded<TypeParameters>) => SchemaAST.Link) | undefinedtoCodec?:
| ((typeParameters: TypeParameters.Encoded<TypeParameters>(parameter) typeParameters: {
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<Codec<unknown, unknown, never, never>>>): Array<Codec<unknown, unknown, never, never>>; (...items: Array<Codec<unknown, unknown, never, never> | ConcatArray<Codec<unknown, unknown, never, never>>>): Array<Cod…;
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<Codec<unknown, unknown, never, never>>;
indexOf: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => number;
lastIndexOf: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => number;
every: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Codec<unknown, unknown, never…;
some: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: Codec<unknown, unknown, never, never>, in…;
reduce: { (callbackfn: (previousValue: Codec<unknown, unknown, never, never>, currentValue: Codec<unknown, unknown, never, never>, currentIndex: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => Codec<unknown, unknown, never,…;
reduceRight: { (callbackfn: (previousValue: Codec<unknown, unknown, never, never>, currentValue: Codec<unknown, unknown, never, never>, currentIndex: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => Codec<unknown, unknown, never,…;
find: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, obj: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Codec<unknown, unknown, never, never>,…;
findIndex: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, obj: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, Codec<unknown, unknown, never, never>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<Codec<unknown, unknown, never, never>>;
includes: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: Codec<unknown, unknown, never, never>, index: number, array: Array<Codec<unknown, unknown, never, never>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => Codec<unknown, unknown, never, never> | undefined;
findLast: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Codec<unknown, unknown, never, never…;
findLastIndex: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<Codec<unknown, unknown, never, never>>;
toSorted: (compareFn?: ((a: Codec<unknown, unknown, never, never>, b: Codec<unknown, unknown, never, never>) => number) | undefined) => Array<Codec<unknown, unknown, never, never>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<Codec<unknown, unknown, never, never>>): Array<Codec<unknown, unknown, never, never>>; (start: number, deleteCount?: number): Array<Codec<unknown, unknown, never, never>> };
with: (index: number, value: Codec<unknown, unknown, never, never>) => Array<Codec<unknown, unknown, never, never>>;
}
typeParameters: namespace Annotations.TypeParametersHelpers for projecting declaration type-parameter schemas into decoded or
encoded codec arrays used by annotation hooks.
TypeParameters.type Annotations.TypeParameters.Encoded<TypeParameters extends ReadonlyArray<Constraint>> = { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Encoded"], TypeParameters[K]["Encoded"], never, never>; }Maps declaration type-parameter schemas to codecs for their Encoded values.
Encoded<function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters>) => import SchemaASTSchemaAST.class Linkclass Link {
to: AST;
transformation: SchemaTransformation.Transformation<any, any, any, any> | SchemaTransformation.Middleware<any, any, any, any, any, any>;
}
Represents a single step in an
Encoding
chain.
Details
A link pairs a target
AST
with a Transformation or Middleware
that converts values between the current node and the target.
to — the AST node on the other side of this transformation step.
transformation — the bidirectional conversion logic (decode/encode).
Links are composed into a non-empty array (
Encoding
) attached to
AST nodes that have a different encoded representation.
Link)
| undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.toCodecJson?: ((typeParameters: TypeParameters.Encoded<TypeParameters>) => SchemaAST.Link) | undefinedtoCodecJson?:
| ((typeParameters: TypeParameters.Encoded<TypeParameters>(parameter) typeParameters: {
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<Codec<unknown, unknown, never, never>>>): Array<Codec<unknown, unknown, never, never>>; (...items: Array<Codec<unknown, unknown, never, never> | ConcatArray<Codec<unknown, unknown, never, never>>>): Array<Cod…;
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<Codec<unknown, unknown, never, never>>;
indexOf: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => number;
lastIndexOf: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => number;
every: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Codec<unknown, unknown, never…;
some: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: Codec<unknown, unknown, never, never>, in…;
reduce: { (callbackfn: (previousValue: Codec<unknown, unknown, never, never>, currentValue: Codec<unknown, unknown, never, never>, currentIndex: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => Codec<unknown, unknown, never,…;
reduceRight: { (callbackfn: (previousValue: Codec<unknown, unknown, never, never>, currentValue: Codec<unknown, unknown, never, never>, currentIndex: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => Codec<unknown, unknown, never,…;
find: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, obj: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Codec<unknown, unknown, never, never>,…;
findIndex: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, obj: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, Codec<unknown, unknown, never, never>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<Codec<unknown, unknown, never, never>>;
includes: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: Codec<unknown, unknown, never, never>, index: number, array: Array<Codec<unknown, unknown, never, never>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => Codec<unknown, unknown, never, never> | undefined;
findLast: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Codec<unknown, unknown, never, never…;
findLastIndex: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<Codec<unknown, unknown, never, never>>;
toSorted: (compareFn?: ((a: Codec<unknown, unknown, never, never>, b: Codec<unknown, unknown, never, never>) => number) | undefined) => Array<Codec<unknown, unknown, never, never>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<Codec<unknown, unknown, never, never>>): Array<Codec<unknown, unknown, never, never>>; (start: number, deleteCount?: number): Array<Codec<unknown, unknown, never, never>> };
with: (index: number, value: Codec<unknown, unknown, never, never>) => Array<Codec<unknown, unknown, never, never>>;
}
typeParameters: namespace Annotations.TypeParametersHelpers for projecting declaration type-parameter schemas into decoded or
encoded codec arrays used by annotation hooks.
TypeParameters.type Annotations.TypeParameters.Encoded<TypeParameters extends ReadonlyArray<Constraint>> = { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Encoded"], TypeParameters[K]["Encoded"], never, never>; }Maps declaration type-parameter schemas to codecs for their Encoded values.
Encoded<function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters>) => import SchemaASTSchemaAST.class Linkclass Link {
to: AST;
transformation: SchemaTransformation.Transformation<any, any, any, any> | SchemaTransformation.Middleware<any, any, any, any, any, any>;
}
Represents a single step in an
Encoding
chain.
Details
A link pairs a target
AST
with a Transformation or Middleware
that converts values between the current node and the target.
to — the AST node on the other side of this transformation step.
transformation — the bidirectional conversion logic (decode/encode).
Links are composed into a non-empty array (
Encoding
) attached to
AST nodes that have a different encoded representation.
Link)
| undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.toCodecIso?: ((typeParameters: TypeParameters.Type<TypeParameters>) => SchemaAST.Link) | undefinedtoCodecIso?:
| ((typeParameters: TypeParameters.Type<TypeParameters>(parameter) typeParameters: {
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<Codec<unknown, unknown, never, never>>>): Array<Codec<unknown, unknown, never, never>>; (...items: Array<Codec<unknown, unknown, never, never> | ConcatArray<Codec<unknown, unknown, never, never>>>): Array<Cod…;
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<Codec<unknown, unknown, never, never>>;
indexOf: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => number;
lastIndexOf: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => number;
every: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: Codec<unknown, unknown, never…;
some: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => void, thisArg?: any) => void;
map: (callbackfn: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): Array<S>; (predicate: (value: Codec<unknown, unknown, never, never>, in…;
reduce: { (callbackfn: (previousValue: Codec<unknown, unknown, never, never>, currentValue: Codec<unknown, unknown, never, never>, currentIndex: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => Codec<unknown, unknown, never,…;
reduceRight: { (callbackfn: (previousValue: Codec<unknown, unknown, never, never>, currentValue: Codec<unknown, unknown, never, never>, currentIndex: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => Codec<unknown, unknown, never,…;
find: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, obj: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Codec<unknown, unknown, never, never>,…;
findIndex: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, obj: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, Codec<unknown, unknown, never, never>]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<Codec<unknown, unknown, never, never>>;
includes: (searchElement: Codec<unknown, unknown, never, never>, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: Codec<unknown, unknown, never, never>, index: number, array: Array<Codec<unknown, unknown, never, never>>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => Codec<unknown, unknown, never, never> | undefined;
findLast: { (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Codec<unknown, unknown, never, never…;
findLastIndex: (predicate: (value: Codec<unknown, unknown, never, never>, index: number, array: ReadonlyArray<Codec<unknown, unknown, never, never>>) => unknown, thisArg?: any) => number;
toReversed: () => Array<Codec<unknown, unknown, never, never>>;
toSorted: (compareFn?: ((a: Codec<unknown, unknown, never, never>, b: Codec<unknown, unknown, never, never>) => number) | undefined) => Array<Codec<unknown, unknown, never, never>>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<Codec<unknown, unknown, never, never>>): Array<Codec<unknown, unknown, never, never>>; (start: number, deleteCount?: number): Array<Codec<unknown, unknown, never, never>> };
with: (index: number, value: Codec<unknown, unknown, never, never>) => Array<Codec<unknown, unknown, never, never>>;
}
typeParameters: namespace Annotations.TypeParametersHelpers for projecting declaration type-parameter schemas into decoded or
encoded codec arrays used by annotation hooks.
TypeParameters.type Annotations.TypeParameters.Type<TypeParameters extends ReadonlyArray<Constraint>> = { readonly [K in keyof TypeParameters]: Codec<TypeParameters[K]["Type"], TypeParameters[K]["Type"], never, never>; }Maps declaration type-parameter schemas to codecs for their decoded Type
values.
Type<function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters>) => import SchemaASTSchemaAST.class Linkclass Link {
to: AST;
transformation: SchemaTransformation.Transformation<any, any, any, any> | SchemaTransformation.Middleware<any, any, any, any, any, any>;
}
Represents a single step in an
Encoding
chain.
Details
A link pairs a target
AST
with a Transformation or Middleware
that converts values between the current node and the target.
to — the AST node on the other side of this transformation step.
transformation — the bidirectional conversion logic (decode/encode).
Links are composed into a non-empty array (
Encoding
) attached to
AST nodes that have a different encoded representation.
Link)
| undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.toArbitrary?: ToArbitrary.Declaration<T, TypeParameters> | undefinedtoArbitrary?: namespace Annotations.ToArbitraryTypes used by arbitrary-derivation annotations to configure toArbitrary
hooks, filter hints, candidate sources, diagnostics, and merged generation
constraints.
ToArbitrary.interface Annotations.ToArbitrary.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema arbitrary annotations.
Details
Type parameters expose normal and terminal generators. A declaration with
no type parameters can return a bare arbitrary; a generic declaration
must return terminal explicitly when it has a finite branch depending on
parameters.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters> | undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.toEquivalence?: ToEquivalence.Declaration<T, TypeParameters> | undefinedtoEquivalence?: namespace Annotations.ToEquivalenceTypes used by equivalence annotations to customize equivalence derivation for
declaration schemas.
ToEquivalence.interface Annotations.ToEquivalence.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema equivalence annotations.
Details
Given equivalences for any type parameters, returns an Equivalence for T.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters> | undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.toFormatter?: ToFormatter.Declaration<T, TypeParameters> | undefinedtoFormatter?: namespace Annotations.ToFormatterTypes used by formatter annotations to customize formatter derivation for
declaration schemas.
ToFormatter.interface Annotations.ToFormatter.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema formatter annotations.
Details
Given formatters for any type parameters, returns a formatter for T.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>TypeParameters> | undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.typeConstructor?: {
readonly [key: string]: unknown;
readonly _tag: string;
} | undefined
typeConstructor?: {
readonly _tag: string_tag: string
readonly [key: stringkey: string]: unknown
} | undefined
readonly Annotations.Declaration<T, TypeParameters extends ReadonlyArray<Constraint> = readonly []>.generation?: {
readonly runtime: string;
readonly Type: string;
readonly Encoded?: string | undefined;
readonly importDeclaration?: string | undefined;
} | undefined
generation?: {
readonly runtime: stringruntime: string
readonly type Type: stringType: string
readonly Encoded?: string | undefinedEncoded?: string | undefined
readonly importDeclaration?: string | undefinedimportDeclaration?: string | undefined
} | undefined
/**
* Used to collect sentinels from a Declaration SchemaAST.
*
* @internal
*/
readonly "~sentinels"?: interface ReadonlyArray<T>ReadonlyArray<import SchemaASTSchemaAST.type Sentinel = {
readonly key: PropertyKey
readonly literal:
| SchemaAST.LiteralValue
| symbol
}
Sentinel> | undefined
}
/**
* Annotations for filter schema nodes (created via `Schema.filter`). Extends
* {@link Augment} with an optional error message, identifier, and metadata.
* Filters are intentionally non-parametric to keep them covariant.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.FilterAnnotations for filter schema nodes (created via Schema.filter). Extends
Augment
with an optional error message, identifier, and metadata.
Filters are intentionally non-parametric to keep them covariant.
Filter extends interface Annotations.AugmentAnnotations shared by all schema nodes. These map to common JSON Schema /
OpenAPI fields: title, description, format, etc.
Augment {
/**
* Complete message to use when this filter or refinement fails.
*
* **Details**
*
* The default formatter checks filter annotations in this order:
* `message`, then `expected`, then `<filter>`.
*/
readonly Annotations.Filter.message?: string | undefinedComplete message to use when this filter or refinement fails.
Details
The default formatter checks filter annotations in this order:
message, then expected, then <filter>.
message?: string | undefined
/**
* Stable identifier for the schema after this filter is attached.
*
* **Details**
*
* This can affect schema tooling such as JSON Schema generation and
* type-level failures before the filter runs, but it does not name the
* failed filter itself. For filter failure messages, use `expected` or
* `message`.
*/
readonly Annotations.Filter.identifier?: string | undefinedStable identifier for the schema after this filter is attached.
Details
This can affect schema tooling such as JSON Schema generation and
type-level failures before the filter runs, but it does not name the
failed filter itself. For filter failure messages, use expected or
message.
identifier?: string | undefined
/**
* Optional metadata used to identify or extend the filter with custom data.
*/
readonly Annotations.Filter.meta?: Meta | undefinedOptional metadata used to identify or extend the filter with custom data.
meta?: type Annotations.Meta = {
readonly _tag: "isStringFinite";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringBigInt";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringSymbol";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isMinLength";
readonly minLength: number;
} | {
readonly _tag: "isMaxLength";
readonly maxLength: number;
} | {
readonly _tag: "isLengthBetween";
readonly minimum: number;
readonly maximum: number;
} | {
readonly _tag: "isPattern";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isTrimmed";
readonly regExp: globalThis.RegExp;
} | ... 38 more ... | {
...;
}
Union of built-in and user-augmented schema filter metadata payloads.
Meta | undefined
/**
* Optional hints used by arbitrary derivation for this filter.
*
* **Details**
*
* The same annotation can be attached to a single filter or a
* `FilterGroup`. Group hints apply to the same schema node while child
* filters are still collected and checked normally.
*/
readonly Annotations.Filter.arbitrary?: ToArbitrary.Filter | undefinedOptional hints used by arbitrary derivation for this filter.
Details
The same annotation can be attached to a single filter or a
FilterGroup. Group hints apply to the same schema node while child
filters are still collected and checked normally.
arbitrary?:
| namespace Annotations.ToArbitraryTypes used by arbitrary-derivation annotations to configure toArbitrary
hooks, filter hints, candidate sources, diagnostics, and merged generation
constraints.
ToArbitrary.interface Annotations.ToArbitrary.FilterArbitrary-generation hints attached to a filter or filter group.
Details
constraint refines the schema node's base generator. candidate adds a
weighted source before all filters run. If neither hint is provided, the
filter does not guide generation; generated values are still checked by
the filter predicate. With { report: true }, this is reported as
OpaqueFilter.
Filter
| undefined
/**
* Marks the filter as *structural*, meaning it applies to the shape or
* structure of the container (e.g., array length, object keys) rather than
* the contents.
*
* **Details**
*
* Example: `minLength` on an array is a structural filter.
*/
readonly "~structural"?: boolean | undefined
}
/**
* Types used by arbitrary-derivation annotations to configure `toArbitrary`
* hooks, filter hints, candidate sources, diagnostics, and merged generation
* constraints.
*
* @since 4.0.0
*/
export namespace namespace Annotations.ToArbitraryTypes used by arbitrary-derivation annotations to configure toArbitrary
hooks, filter hints, candidate sources, diagnostics, and merged generation
constraints.
ToArbitrary {
/**
* Arbitrary-generation hints attached to a filter or filter group.
*
* **Details**
*
* `constraint` refines the schema node's base generator. `candidate` adds a
* weighted source before all filters run. If neither hint is provided, the
* filter does not guide generation; generated values are still checked by
* the filter predicate. With `{ report: true }`, this is reported as
* `OpaqueFilter`.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.FilterArbitrary-generation hints attached to a filter or filter group.
Details
constraint refines the schema node's base generator. candidate adds a
weighted source before all filters run. If neither hint is provided, the
filter does not guide generation; generated values are still checked by
the filter predicate. With { report: true }, this is reported as
OpaqueFilter.
Filter {
readonly Annotations.ToArbitrary.Filter.constraint?: GenerationConstraint | undefinedconstraint?: interface Annotations.ToArbitrary.GenerationConstraintNode-local arbitrary-generation constraint accumulated from schema checks.
Details
GenerationConstraint is a generation hint for the current schema AST
node, not a self-describing validation contract. Each generator consumes
the fields it understands for the current node and ignores the rest;
final schema filters still validate every generated value.
minLength and maxLength represent node-local cardinality: string
length for strings, array length for arrays, final own-property count for
objects, and final size/cardinality for sets, maps, hash collections, and
chunks. patterns are concatenated and used by string generators.
integer, noNaN, noInfinity, valid, and unique are true when any
contributing filter sets them. Range bounds live in ordered so ordered
values can share the same representation.
GenerationConstraint | undefined
readonly Annotations.ToArbitrary.Filter.candidate?: Candidate | undefinedcandidate?: interface Annotations.ToArbitrary.CandidateAdditional arbitrary source used before final filter checks run.
Details
The base generator keeps weight 1; candidates default to weight 1
and must use a positive integer weight. make receives the merged
constraint for the current node and may return undefined to opt out,
including for recursive terminal branches. Candidate values are still
checked by every schema filter, so invalid candidates affect efficiency but
not validity.
Candidate | undefined
}
/**
* Additional arbitrary source used before final filter checks run.
*
* **Details**
*
* The base generator keeps weight `1`; candidates default to weight `1`
* and must use a positive integer weight. `make` receives the merged
* constraint for the current node and may return `undefined` to opt out,
* including for recursive terminal branches. Candidate values are still
* checked by every schema filter, so invalid candidates affect efficiency but
* not validity.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.CandidateAdditional arbitrary source used before final filter checks run.
Details
The base generator keeps weight 1; candidates default to weight 1
and must use a positive integer weight. make receives the merged
constraint for the current node and may return undefined to opt out,
including for recursive terminal branches. Candidate values are still
checked by every schema filter, so invalid candidates affect efficiency but
not validity.
Candidate {
readonly Annotations.ToArbitrary.Candidate.weight?: number | undefinedweight?: number | undefined
readonly Annotations.ToArbitrary.Candidate.make: (fc: typeof FastCheck, context: Context) => FastCheck.Arbitrary<unknown> | undefinedmake: (
fc: typeof FastCheckfc: typeof import FastCheckFastCheck,
context: Context(parameter) context: {
constraint: ToArbitrary.GenerationConstraint | undefined;
recursion: ToArbitrary.Recursion | undefined;
}
context: interface Annotations.ToArbitrary.ContextContext passed to arbitrary-derivation hooks and candidate factories.
Details
constraint contains the merged constraint for the current schema
node. recursion is present while deriving through a suspended schema;
hooks that build recursive alternatives should pass it to fc.oneof with
the finite branch first.
Context
) => import FastCheckFastCheck.type FastCheck.Arbitrary = /*unresolved*/ anyArbitrary<unknown> | undefined
}
/**
* Ordered constraint accumulated from range checks.
*
* **Details**
*
* Generators consume these constraints only when they recognize `order`,
* such as `Order.Number`, `Order.BigInt`, DateTime, or BigDecimal. Merging
* constraints with different `Order` instances fails fast.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.OrderedConstraint<T>Ordered constraint accumulated from range checks.
Details
Generators consume these constraints only when they recognize order,
such as Order.Number, Order.BigInt, DateTime, or BigDecimal. Merging
constraints with different Order instances fails fast.
OrderedConstraint<function (type parameter) T in OrderedConstraint<T>T> {
readonly Annotations.ToArbitrary.OrderedConstraint<T>.order: Order.Order<T>order: import OrderOrder.type Order.Order = /*unresolved*/ anyOrder<function (type parameter) T in OrderedConstraint<T>T>
readonly Annotations.ToArbitrary.OrderedConstraint<T>.minimum?: T | undefinedminimum?: function (type parameter) T in OrderedConstraint<T>T | undefined
readonly Annotations.ToArbitrary.OrderedConstraint<T>.exclusiveMinimum?: boolean | undefinedexclusiveMinimum?: boolean | undefined
readonly Annotations.ToArbitrary.OrderedConstraint<T>.maximum?: T | undefinedmaximum?: function (type parameter) T in OrderedConstraint<T>T | undefined
readonly Annotations.ToArbitrary.OrderedConstraint<T>.exclusiveMaximum?: boolean | undefinedexclusiveMaximum?: boolean | undefined
}
/**
* Node-local arbitrary-generation constraint accumulated from schema checks.
*
* **Details**
*
* `GenerationConstraint` is a generation hint for the current schema AST
* node, not a self-describing validation contract. Each generator consumes
* the fields it understands for the current node and ignores the rest;
* final schema filters still validate every generated value.
*
* `minLength` and `maxLength` represent node-local cardinality: string
* length for strings, array length for arrays, final own-property count for
* objects, and final size/cardinality for sets, maps, hash collections, and
* chunks. `patterns` are concatenated and used by string generators.
* `integer`, `noNaN`, `noInfinity`, `valid`, and `unique` are true when any
* contributing filter sets them. Range bounds live in `ordered` so ordered
* values can share the same representation.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.GenerationConstraintNode-local arbitrary-generation constraint accumulated from schema checks.
Details
GenerationConstraint is a generation hint for the current schema AST
node, not a self-describing validation contract. Each generator consumes
the fields it understands for the current node and ignores the rest;
final schema filters still validate every generated value.
minLength and maxLength represent node-local cardinality: string
length for strings, array length for arrays, final own-property count for
objects, and final size/cardinality for sets, maps, hash collections, and
chunks. patterns are concatenated and used by string generators.
integer, noNaN, noInfinity, valid, and unique are true when any
contributing filter sets them. Range bounds live in ordered so ordered
values can share the same representation.
GenerationConstraint {
readonly Annotations.ToArbitrary.GenerationConstraint.minLength?: number | undefinedminLength?: number | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.maxLength?: number | undefinedmaxLength?: number | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.patterns?: readonly [string, ...string[]] | undefinedpatterns?: readonly [string, ...interface Array<T>Array<string>]
readonly Annotations.ToArbitrary.GenerationConstraint.integer?: boolean | undefinedinteger?: boolean | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.noInfinity?: boolean | undefinednoInfinity?: boolean | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.noNaN?: boolean | undefinednoNaN?: boolean | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.valid?: boolean | undefinedvalid?: boolean | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.unique?: boolean | undefinedunique?: boolean | undefined
readonly Annotations.ToArbitrary.GenerationConstraint.ordered?: OrderedConstraint<any> | undefinedordered?: interface Annotations.ToArbitrary.OrderedConstraint<T>Ordered constraint accumulated from range checks.
Details
Generators consume these constraints only when they recognize order,
such as Order.Number, Order.BigInt, DateTime, or BigDecimal. Merging
constraints with different Order instances fails fast.
OrderedConstraint<any> | undefined
}
/**
* Recursion budget passed to arbitrary-derivation hooks.
*
* **Details**
*
* Pass this object to `fc.oneof` when combining terminal and recursive
* branches. Put the terminal branch first because fast-check uses only the
* first branch once `maxDepth` is reached for `depthIdentifier`.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.RecursionRecursion budget passed to arbitrary-derivation hooks.
Details
Pass this object to fc.oneof when combining terminal and recursive
branches. Put the terminal branch first because fast-check uses only the
first branch once maxDepth is reached for depthIdentifier.
Recursion {
readonly Annotations.ToArbitrary.Recursion.maxDepth: numbermaxDepth: number
readonly Annotations.ToArbitrary.Recursion.depthIdentifier: anydepthIdentifier: import FastCheckFastCheck.type FastCheck.DepthIdentifier = /*unresolved*/ anyDepthIdentifier | string
}
/**
* Context passed to arbitrary-derivation hooks and candidate factories.
*
* **Details**
*
* `constraint` contains the merged constraint for the current schema
* node. `recursion` is present while deriving through a suspended schema;
* hooks that build recursive alternatives should pass it to `fc.oneof` with
* the finite branch first.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.ContextContext passed to arbitrary-derivation hooks and candidate factories.
Details
constraint contains the merged constraint for the current schema
node. recursion is present while deriving through a suspended schema;
hooks that build recursive alternatives should pass it to fc.oneof with
the finite branch first.
Context {
readonly Annotations.ToArbitrary.Context.constraint?: GenerationConstraint | undefinedconstraint?: namespace Annotations.ToArbitraryTypes used by arbitrary-derivation annotations to configure toArbitrary
hooks, filter hints, candidate sources, diagnostics, and merged generation
constraints.
ToArbitrary.interface Annotations.ToArbitrary.GenerationConstraintNode-local arbitrary-generation constraint accumulated from schema checks.
Details
GenerationConstraint is a generation hint for the current schema AST
node, not a self-describing validation contract. Each generator consumes
the fields it understands for the current node and ignores the rest;
final schema filters still validate every generated value.
minLength and maxLength represent node-local cardinality: string
length for strings, array length for arrays, final own-property count for
objects, and final size/cardinality for sets, maps, hash collections, and
chunks. patterns are concatenated and used by string generators.
integer, noNaN, noInfinity, valid, and unique are true when any
contributing filter sets them. Range bounds live in ordered so ordered
values can share the same representation.
GenerationConstraint | undefined
readonly Annotations.ToArbitrary.Context.recursion?: Recursion | undefinedrecursion?: namespace Annotations.ToArbitraryTypes used by arbitrary-derivation annotations to configure toArbitrary
hooks, filter hints, candidate sources, diagnostics, and merged generation
constraints.
ToArbitrary.interface Annotations.ToArbitrary.RecursionRecursion budget passed to arbitrary-derivation hooks.
Details
Pass this object to fc.oneof when combining terminal and recursive
branches. Put the terminal branch first because fast-check uses only the
first branch once maxDepth is reached for depthIdentifier.
Recursion | undefined
}
/**
* Arbitrary generators derived for a declaration type parameter.
*
* **Details**
*
* `arbitrary` is the normal generator. `terminal` is the finite generator
* used while building recursive terminal branches and is `undefined` when
* no finite path is known. Optional containers can ignore it; non-empty
* containers need it for their terminal branch.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.TypeParameter<T>Arbitrary generators derived for a declaration type parameter.
Details
arbitrary is the normal generator. terminal is the finite generator
used while building recursive terminal branches and is undefined when
no finite path is known. Optional containers can ignore it; non-empty
containers need it for their terminal branch.
TypeParameter<function (type parameter) T in TypeParameter<T>T> {
readonly Annotations.ToArbitrary.TypeParameter<T>.arbitrary: FastCheck.Arbitrary<T>arbitrary: import FastCheckFastCheck.type FastCheck.Arbitrary = /*unresolved*/ anyArbitrary<function (type parameter) T in TypeParameter<T>T>
readonly Annotations.ToArbitrary.TypeParameter<T>.terminal: anyterminal: import FastCheckFastCheck.type FastCheck.Arbitrary = /*unresolved*/ anyArbitrary<function (type parameter) T in TypeParameter<T>T> | undefined
}
/**
* Arbitrary derivation returned by declaration hooks.
*
* **Details**
*
* `arbitrary` is the normal generator. `terminal` is an optional finite
* branch for recursive schemas. If omitted, it defaults to `arbitrary` only
* for declarations without type parameters.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.Derivation<T>Arbitrary derivation returned by declaration hooks.
Details
arbitrary is the normal generator. terminal is an optional finite
branch for recursive schemas. If omitted, it defaults to arbitrary only
for declarations without type parameters.
Derivation<function (type parameter) T in Derivation<T>T> {
readonly Annotations.ToArbitrary.Derivation<T>.arbitrary: FastCheck.Arbitrary<T>arbitrary: import FastCheckFastCheck.type FastCheck.Arbitrary = /*unresolved*/ anyArbitrary<function (type parameter) T in Derivation<T>T>
readonly Annotations.ToArbitrary.Derivation<T>.terminal?: anyterminal?: import FastCheckFastCheck.type FastCheck.Arbitrary = /*unresolved*/ anyArbitrary<function (type parameter) T in Derivation<T>T> | undefined
}
/**
* Output accepted from declaration arbitrary hooks.
*
* **Details**
*
* A bare fast-check arbitrary is shorthand for `{ arbitrary }`, useful for
* atomic declarations such as URLs. Generic declarations that need precise
* recursive behavior should return a {@link Derivation} with `terminal`.
*
* @category models
* @since 4.0.0
*/
export type type Annotations.ToArbitrary.Output<T> = anyOutput accepted from declaration arbitrary hooks.
Details
A bare fast-check arbitrary is shorthand for { arbitrary }, useful for
atomic declarations such as URLs. Generic declarations that need precise
recursive behavior should return a
Derivation
with terminal.
Output<function (type parameter) T in type Annotations.ToArbitrary.Output<T>T> = import FastCheckFastCheck.type FastCheck.Arbitrary = /*unresolved*/ anyArbitrary<function (type parameter) T in type Annotations.ToArbitrary.Output<T>T> | interface Annotations.ToArbitrary.Derivation<T>Arbitrary derivation returned by declaration hooks.
Details
arbitrary is the normal generator. terminal is an optional finite
branch for recursive schemas. If omitted, it defaults to arbitrary only
for declarations without type parameters.
Derivation<function (type parameter) T in type Annotations.ToArbitrary.Output<T>T>
/**
* Hook signature for declaration schema arbitrary annotations.
*
* **Details**
*
* Type parameters expose normal and terminal generators. A declaration with
* no type parameters can return a bare arbitrary; a generic declaration
* must return `terminal` explicitly when it has a finite branch depending on
* parameters.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema arbitrary annotations.
Details
Type parameters expose normal and terminal generators. A declaration with
no type parameters can return a bare arbitrary; a generic declaration
must return terminal explicitly when it has a finite branch depending on
parameters.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint>> {
(
/* Arbitrary derivations for any type parameters of the schema (if present) */
typeParameters: {
readonly [K in keyof TypeParameters]: TypeParameter<
TypeParameters[K]["Type"]
>
}
typeParameters: { readonly [function (type parameter) KK in keyof function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters]: interface Annotations.ToArbitrary.TypeParameter<T>Arbitrary generators derived for a declaration type parameter.
Details
arbitrary is the normal generator. terminal is the finite generator
used while building recursive terminal branches and is undefined when
no finite path is known. Optional containers can ignore it; non-empty
containers need it for their terminal branch.
TypeParameter<function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters[function (type parameter) KK]["Type"]> }
): (fc: typeof FastCheckfc: typeof import FastCheckFastCheck, context: Context(parameter) context: {
constraint: ToArbitrary.GenerationConstraint | undefined;
recursion: ToArbitrary.Recursion | undefined;
}
context: interface Annotations.ToArbitrary.ContextContext passed to arbitrary-derivation hooks and candidate factories.
Details
constraint contains the merged constraint for the current schema
node. recursion is present while deriving through a suspended schema;
hooks that build recursive alternatives should pass it to fc.oneof with
the finite branch first.
Context) => type Annotations.ToArbitrary.Output<T> = anyOutput accepted from declaration arbitrary hooks.
Details
A bare fast-check arbitrary is shorthand for { arbitrary }, useful for
atomic declarations such as URLs. Generic declarations that need precise
recursive behavior should return a
Derivation
with terminal.
Output<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>T>
}
/**
* Wraps a derived value together with arbitrary-derivation diagnostics.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.WithReport<A>Wraps a derived value together with arbitrary-derivation diagnostics.
WithReport<function (type parameter) A in WithReport<A>A> {
readonly Annotations.ToArbitrary.WithReport<A>.value: Avalue: function (type parameter) A in WithReport<A>A
readonly Annotations.ToArbitrary.WithReport<A>.report: Report(property) Annotations.ToArbitrary.WithReport<A>.report: {
warnings: ReadonlyArray<Warning>;
}
report: interface Annotations.ToArbitrary.ReportDiagnostics collected while deriving an arbitrary.
Details
Reports contain warnings only. Unsupported schema nodes, impossible
constraints, invalid candidate weights, and throwing candidate factories
fail immediately.
Report
}
/**
* Diagnostics collected while deriving an arbitrary.
*
* **Details**
*
* Reports contain warnings only. Unsupported schema nodes, impossible
* constraints, invalid candidate weights, and throwing candidate factories
* fail immediately.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.ReportDiagnostics collected while deriving an arbitrary.
Details
Reports contain warnings only. Unsupported schema nodes, impossible
constraints, invalid candidate weights, and throwing candidate factories
fail immediately.
Report {
readonly Annotations.ToArbitrary.Report.warnings: readonly OpaqueFilterWarning[]warnings: interface ReadonlyArray<T>ReadonlyArray<type Annotations.ToArbitrary.Warning = OpaqueFilterWarningNon-fatal arbitrary-derivation warning.
Warning>
}
/**
* Non-fatal arbitrary-derivation warning.
*
* @category models
* @since 4.0.0
*/
export type type Annotations.ToArbitrary.Warning = OpaqueFilterWarningNon-fatal arbitrary-derivation warning.
Warning = interface Annotations.ToArbitrary.OpaqueFilterWarningWarning emitted when a filter is handled only by the final .filter.
Details
The filter is still enforced. The warning means it did not contribute
a constraint or candidate, so generation may rely on fast-check discards.
OpaqueFilterWarning
/**
* Warning emitted when a filter is handled only by the final `.filter`.
*
* **Details**
*
* The filter is still enforced. The warning means it did not contribute
* a constraint or candidate, so generation may rely on fast-check discards.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToArbitrary.OpaqueFilterWarningWarning emitted when a filter is handled only by the final .filter.
Details
The filter is still enforced. The warning means it did not contribute
a constraint or candidate, so generation may rely on fast-check discards.
OpaqueFilterWarning {
readonly Annotations.ToArbitrary.OpaqueFilterWarning._tag: "OpaqueFilter"_tag: "OpaqueFilter"
readonly Annotations.ToArbitrary.OpaqueFilterWarning.path: readonly PropertyKey[]path: interface ReadonlyArray<T>ReadonlyArray<type PropertyKey =
| string
| number
| symbol
PropertyKey>
readonly Annotations.ToArbitrary.OpaqueFilterWarning.description?: string | undefineddescription?: string | undefined
}
}
/**
* Types used by formatter annotations to customize formatter derivation for
* declaration schemas.
*
* @since 4.0.0
*/
export namespace namespace Annotations.ToFormatterTypes used by formatter annotations to customize formatter derivation for
declaration schemas.
ToFormatter {
/**
* Hook signature for declaration schema formatter annotations.
*
* **Details**
*
* Given formatters for any type parameters, returns a formatter for `T`.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToFormatter.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema formatter annotations.
Details
Given formatters for any type parameters, returns a formatter for T.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint>> {
(
/* Formatters for any type parameters of the schema (if present) */
typeParameters: {
readonly [K in keyof TypeParameters]: Formatter<
TypeParameters[K]["Type"]
>
}
typeParameters: { readonly [function (type parameter) KK in keyof function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters]: import FormatterFormatter<function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters[function (type parameter) KK]["Type"]> }
): import FormatterFormatter<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>T>
}
}
/**
* Types used by equivalence annotations to customize equivalence derivation for
* declaration schemas.
*
* @since 4.0.0
*/
export namespace namespace Annotations.ToEquivalenceTypes used by equivalence annotations to customize equivalence derivation for
declaration schemas.
ToEquivalence {
/**
* Hook signature for declaration schema equivalence annotations.
*
* **Details**
*
* Given equivalences for any type parameters, returns an `Equivalence` for `T`.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.ToEquivalence.Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>Hook signature for declaration schema equivalence annotations.
Details
Given equivalences for any type parameters, returns an Equivalence for T.
Declaration<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>T, function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters extends interface ReadonlyArray<T>ReadonlyArray<Constraint>> {
(
/* Equivalences for any type parameters of the schema (if present) */
typeParameters: {
readonly [K in keyof TypeParameters]: Equivalence.Equivalence<
TypeParameters[K]["Type"]
>
}
typeParameters: { readonly [function (type parameter) KK in keyof function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters]: import EquivalenceEquivalence.type Equivalence.Equivalence = /*unresolved*/ anyEquivalence<function (type parameter) TypeParameters in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>TypeParameters[function (type parameter) KK]["Type"]> }
): import EquivalenceEquivalence.type Equivalence.Equivalence = /*unresolved*/ anyEquivalence<function (type parameter) T in Declaration<T, TypeParameters extends ReadonlyArray<Constraint>>T>
}
}
/**
* Annotations that can be attached to schema issues.
*
* **Details**
*
* The optional `message` field overrides the default issue message.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.IssueAnnotations that can be attached to schema issues.
Details
The optional message field overrides the default issue message.
Issue extends interface Annotations.AnnotationsThis interface is used to define the annotations that can be attached to a
schema. You can extend this interface to define your own annotations.
Details
Note that both a missing key or undefined is used to indicate that the
annotation is not present.
This means that can remove any annotation by setting it to undefined.
Example (Defining your own annotations)
import { Schema } from "effect"
// Extend the Annotations interface with a custom `version` annotation
declare module "effect/Schema" {
namespace Annotations {
interface Annotations {
readonly version?:
| readonly [major: number, minor: number, patch: number]
| undefined
}
}
}
// The `version` annotation is now recognized by the TypeScript compiler
const schema = Schema.String.annotate({ version: [1, 2, 0] })
// const version: readonly [major: number, minor: number, patch: number] | undefined
const version = Schema.resolveAnnotations(schema)?.["version"]
if (version) {
// Access individual parts of the version
console.log(version[1])
// Output: 2
}
Annotations {
readonly Annotations.Issue.message?: string | undefinedmessage?: string | undefined
}
/**
* Registry of metadata payloads emitted by built-in schema filters and checks.
*
* **Details**
*
* Do not augment this interface with custom metadata; extend `MetaDefinitions`
* instead.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.BuiltInMetaDefinitionsRegistry of metadata payloads emitted by built-in schema filters and checks.
Details
Do not augment this interface with custom metadata; extend MetaDefinitions
instead.
BuiltInMetaDefinitions {
// String Meta
readonly Annotations.BuiltInMetaDefinitions.isStringFinite: {
readonly _tag: "isStringFinite";
readonly regExp: globalThis.RegExp;
}
isStringFinite: {
readonly _tag: "isStringFinite"_tag: "isStringFinite"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isStringBigInt: {
readonly _tag: "isStringBigInt";
readonly regExp: globalThis.RegExp;
}
isStringBigInt: {
readonly _tag: "isStringBigInt"_tag: "isStringBigInt"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isStringSymbol: {
readonly _tag: "isStringSymbol";
readonly regExp: globalThis.RegExp;
}
isStringSymbol: {
readonly _tag: "isStringSymbol"_tag: "isStringSymbol"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isMinLength: {
readonly _tag: "isMinLength";
readonly minLength: number;
}
isMinLength: {
readonly _tag: "isMinLength"_tag: "isMinLength"
readonly minLength: numberminLength: number
}
readonly Annotations.BuiltInMetaDefinitions.isMaxLength: {
readonly _tag: "isMaxLength";
readonly maxLength: number;
}
isMaxLength: {
readonly _tag: "isMaxLength"_tag: "isMaxLength"
readonly maxLength: numbermaxLength: number
}
readonly Annotations.BuiltInMetaDefinitions.isLengthBetween: {
readonly _tag: "isLengthBetween";
readonly minimum: number;
readonly maximum: number;
}
isLengthBetween: {
readonly _tag: "isLengthBetween"_tag: "isLengthBetween"
readonly minimum: numberminimum: number
readonly maximum: numbermaximum: number
}
readonly Annotations.BuiltInMetaDefinitions.isPattern: {
readonly _tag: "isPattern";
readonly regExp: globalThis.RegExp;
}
isPattern: {
readonly _tag: "isPattern"_tag: "isPattern"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isTrimmed: {
readonly _tag: "isTrimmed";
readonly regExp: globalThis.RegExp;
}
isTrimmed: {
readonly _tag: "isTrimmed"_tag: "isTrimmed"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isUUID: {
readonly _tag: "isUUID";
readonly regExp: globalThis.RegExp;
readonly version: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | undefined;
}
isUUID: {
readonly _tag: "isUUID"_tag: "isUUID"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
readonly version: | 2
| 1
| 3
| 4
| 5
| 6
| 7
| 8
| undefined
version: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | undefined
}
readonly Annotations.BuiltInMetaDefinitions.isGUID: {
readonly _tag: "isGUID";
readonly regExp: globalThis.RegExp;
}
isGUID: {
readonly _tag: "isGUID"_tag: "isGUID"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isULID: {
readonly _tag: "isULID";
readonly regExp: globalThis.RegExp;
}
isULID: {
readonly _tag: "isULID"_tag: "isULID"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isBase64: {
readonly _tag: "isBase64";
readonly regExp: globalThis.RegExp;
}
isBase64: {
readonly _tag: "isBase64"_tag: "isBase64"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isBase64Url: {
readonly _tag: "isBase64Url";
readonly regExp: globalThis.RegExp;
}
isBase64Url: {
readonly _tag: "isBase64Url"_tag: "isBase64Url"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isStartsWith: {
readonly _tag: "isStartsWith";
readonly startsWith: string;
readonly regExp: globalThis.RegExp;
}
isStartsWith: {
readonly _tag: "isStartsWith"_tag: "isStartsWith"
readonly startsWith: stringstartsWith: string
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isEndsWith: {
readonly _tag: "isEndsWith";
readonly endsWith: string;
readonly regExp: globalThis.RegExp;
}
isEndsWith: {
readonly _tag: "isEndsWith"_tag: "isEndsWith"
readonly endsWith: stringendsWith: string
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isIncludes: {
readonly _tag: "isIncludes";
readonly includes: string;
readonly regExp: globalThis.RegExp;
}
isIncludes: {
readonly _tag: "isIncludes"_tag: "isIncludes"
readonly includes: stringincludes: string
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isUppercased: {
readonly _tag: "isUppercased";
readonly regExp: globalThis.RegExp;
}
isUppercased: {
readonly _tag: "isUppercased"_tag: "isUppercased"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isLowercased: {
readonly _tag: "isLowercased";
readonly regExp: globalThis.RegExp;
}
isLowercased: {
readonly _tag: "isLowercased"_tag: "isLowercased"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isCapitalized: {
readonly _tag: "isCapitalized";
readonly regExp: globalThis.RegExp;
}
isCapitalized: {
readonly _tag: "isCapitalized"_tag: "isCapitalized"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
readonly Annotations.BuiltInMetaDefinitions.isUncapitalized: {
readonly _tag: "isUncapitalized";
readonly regExp: globalThis.RegExp;
}
isUncapitalized: {
readonly _tag: "isUncapitalized"_tag: "isUncapitalized"
readonly regExp: globalThis.RegExpregExp: module globalThisglobalThis.RegExp
}
// Number Meta
readonly Annotations.BuiltInMetaDefinitions.isFinite: {
readonly _tag: "isFinite";
}
isFinite: {
readonly _tag: "isFinite"_tag: "isFinite"
}
readonly Annotations.BuiltInMetaDefinitions.isInt: {
readonly _tag: "isInt";
}
isInt: {
readonly _tag: "isInt"_tag: "isInt"
}
readonly Annotations.BuiltInMetaDefinitions.isMultipleOf: {
readonly _tag: "isMultipleOf";
readonly divisor: number;
}
isMultipleOf: {
readonly _tag: "isMultipleOf"_tag: "isMultipleOf"
readonly divisor: numberdivisor: number
}
readonly Annotations.BuiltInMetaDefinitions.isGreaterThan: {
readonly _tag: "isGreaterThan";
readonly exclusiveMinimum: number;
}
isGreaterThan: {
readonly _tag: "isGreaterThan"_tag: "isGreaterThan"
readonly exclusiveMinimum: numberexclusiveMinimum: number
}
readonly Annotations.BuiltInMetaDefinitions.isGreaterThanOrEqualTo: {
readonly _tag: "isGreaterThanOrEqualTo";
readonly minimum: number;
}
isGreaterThanOrEqualTo: {
readonly _tag: "isGreaterThanOrEqualTo"_tag: "isGreaterThanOrEqualTo"
readonly minimum: numberminimum: number
}
readonly Annotations.BuiltInMetaDefinitions.isLessThan: {
readonly _tag: "isLessThan";
readonly exclusiveMaximum: number;
}
isLessThan: {
readonly _tag: "isLessThan"_tag: "isLessThan"
readonly exclusiveMaximum: numberexclusiveMaximum: number
}
readonly Annotations.BuiltInMetaDefinitions.isLessThanOrEqualTo: {
readonly _tag: "isLessThanOrEqualTo";
readonly maximum: number;
}
isLessThanOrEqualTo: {
readonly _tag: "isLessThanOrEqualTo"_tag: "isLessThanOrEqualTo"
readonly maximum: numbermaximum: number
}
readonly Annotations.BuiltInMetaDefinitions.isBetween: {
readonly _tag: "isBetween";
readonly minimum: number;
readonly maximum: number;
readonly exclusiveMinimum?: boolean | undefined;
readonly exclusiveMaximum?: boolean | undefined;
}
isBetween: {
readonly _tag: "isBetween"_tag: "isBetween"
readonly minimum: numberminimum: number
readonly maximum: numbermaximum: number
readonly exclusiveMinimum?: boolean | undefinedexclusiveMinimum?: boolean | undefined
readonly exclusiveMaximum?: boolean | undefinedexclusiveMaximum?: boolean | undefined
}
// BigInt Meta
readonly Annotations.BuiltInMetaDefinitions.isGreaterThanBigInt: {
readonly _tag: "isGreaterThanBigInt";
readonly exclusiveMinimum: bigint;
}
isGreaterThanBigInt: {
readonly _tag: "isGreaterThanBigInt"_tag: "isGreaterThanBigInt"
readonly exclusiveMinimum: bigintexclusiveMinimum: bigint
}
readonly Annotations.BuiltInMetaDefinitions.isGreaterThanOrEqualToBigInt: {
readonly _tag: "isGreaterThanOrEqualToBigInt";
readonly minimum: bigint;
}
isGreaterThanOrEqualToBigInt: {
readonly _tag: "isGreaterThanOrEqualToBigInt"_tag: "isGreaterThanOrEqualToBigInt"
readonly minimum: bigintminimum: bigint
}
readonly Annotations.BuiltInMetaDefinitions.isLessThanBigInt: {
readonly _tag: "isLessThanBigInt";
readonly exclusiveMaximum: bigint;
}
isLessThanBigInt: {
readonly _tag: "isLessThanBigInt"_tag: "isLessThanBigInt"
readonly exclusiveMaximum: bigintexclusiveMaximum: bigint
}
readonly Annotations.BuiltInMetaDefinitions.isLessThanOrEqualToBigInt: {
readonly _tag: "isLessThanOrEqualToBigInt";
readonly maximum: bigint;
}
isLessThanOrEqualToBigInt: {
readonly _tag: "isLessThanOrEqualToBigInt"_tag: "isLessThanOrEqualToBigInt"
readonly maximum: bigintmaximum: bigint
}
readonly Annotations.BuiltInMetaDefinitions.isBetweenBigInt: {
readonly _tag: "isBetweenBigInt";
readonly minimum: bigint;
readonly maximum: bigint;
readonly exclusiveMinimum?: boolean | undefined;
readonly exclusiveMaximum?: boolean | undefined;
}
isBetweenBigInt: {
readonly _tag: "isBetweenBigInt"_tag: "isBetweenBigInt"
readonly minimum: bigintminimum: bigint
readonly maximum: bigintmaximum: bigint
readonly exclusiveMinimum?: boolean | undefinedexclusiveMinimum?: boolean | undefined
readonly exclusiveMaximum?: boolean | undefinedexclusiveMaximum?: boolean | undefined
}
// Date Meta
readonly Annotations.BuiltInMetaDefinitions.isDateValid: {
readonly _tag: "isDateValid";
}
isDateValid: {
readonly _tag: "isDateValid"_tag: "isDateValid"
}
readonly Annotations.BuiltInMetaDefinitions.isGreaterThanDate: {
readonly _tag: "isGreaterThanDate";
readonly exclusiveMinimum: globalThis.Date;
}
isGreaterThanDate: {
readonly _tag: "isGreaterThanDate"_tag: "isGreaterThanDate"
readonly exclusiveMinimum: globalThis.DateexclusiveMinimum: module globalThisglobalThis.Date
}
readonly Annotations.BuiltInMetaDefinitions.isGreaterThanOrEqualToDate: {
readonly _tag: "isGreaterThanOrEqualToDate";
readonly minimum: globalThis.Date;
}
isGreaterThanOrEqualToDate: {
readonly _tag: "isGreaterThanOrEqualToDate"_tag: "isGreaterThanOrEqualToDate"
readonly minimum: globalThis.Dateminimum: module globalThisglobalThis.Date
}
readonly Annotations.BuiltInMetaDefinitions.isLessThanDate: {
readonly _tag: "isLessThanDate";
readonly exclusiveMaximum: globalThis.Date;
}
isLessThanDate: {
readonly _tag: "isLessThanDate"_tag: "isLessThanDate"
readonly exclusiveMaximum: globalThis.DateexclusiveMaximum: module globalThisglobalThis.Date
}
readonly Annotations.BuiltInMetaDefinitions.isLessThanOrEqualToDate: {
readonly _tag: "isLessThanOrEqualToDate";
readonly maximum: globalThis.Date;
}
isLessThanOrEqualToDate: {
readonly _tag: "isLessThanOrEqualToDate"_tag: "isLessThanOrEqualToDate"
readonly maximum: globalThis.Datemaximum: module globalThisglobalThis.Date
}
readonly Annotations.BuiltInMetaDefinitions.isBetweenDate: {
readonly _tag: "isBetweenDate";
readonly minimum: globalThis.Date;
readonly maximum: globalThis.Date;
readonly exclusiveMinimum?: boolean | undefined;
readonly exclusiveMaximum?: boolean | undefined;
}
isBetweenDate: {
readonly _tag: "isBetweenDate"_tag: "isBetweenDate"
readonly minimum: globalThis.Dateminimum: module globalThisglobalThis.Date
readonly maximum: globalThis.Datemaximum: module globalThisglobalThis.Date
readonly exclusiveMinimum?: boolean | undefinedexclusiveMinimum?: boolean | undefined
readonly exclusiveMaximum?: boolean | undefinedexclusiveMaximum?: boolean | undefined
}
// Objects Meta
readonly Annotations.BuiltInMetaDefinitions.isMinProperties: {
readonly _tag: "isMinProperties";
readonly minProperties: number;
}
isMinProperties: {
readonly _tag: "isMinProperties"_tag: "isMinProperties"
readonly minProperties: numberminProperties: number
}
readonly Annotations.BuiltInMetaDefinitions.isMaxProperties: {
readonly _tag: "isMaxProperties";
readonly maxProperties: number;
}
isMaxProperties: {
readonly _tag: "isMaxProperties"_tag: "isMaxProperties"
readonly maxProperties: numbermaxProperties: number
}
readonly Annotations.BuiltInMetaDefinitions.isPropertiesLengthBetween: {
readonly _tag: "isPropertiesLengthBetween";
readonly minimum: number;
readonly maximum: number;
}
isPropertiesLengthBetween: {
readonly _tag: "isPropertiesLengthBetween"_tag: "isPropertiesLengthBetween"
readonly minimum: numberminimum: number
readonly maximum: numbermaximum: number
}
readonly Annotations.BuiltInMetaDefinitions.isPropertyNames: { readonly _tag: "isPropertyNames"; readonly propertyNames: SchemaAST.AST }isPropertyNames: {
readonly _tag: "isPropertyNames"_tag: "isPropertyNames"
readonly propertyNames: SchemaAST.ASTpropertyNames: import SchemaASTSchemaAST.type AST = SchemaAST.Declaration | SchemaAST.Null | SchemaAST.Undefined | SchemaAST.Void | SchemaAST.Never | SchemaAST.Unknown | SchemaAST.Any | SchemaAST.String | SchemaAST.Number | SchemaAST.Boolean | SchemaAST.BigInt | SchemaAST.Symbol | SchemaAST.Literal | SchemaAST.UniqueSymbol | SchemaAST.ObjectKeyword | SchemaAST.Enum | SchemaAST.TemplateLiteral | SchemaAST.Arrays | SchemaAST.Objects | SchemaAST.Union<...> | SchemaAST.SuspendDiscriminated union of all AST node types.
Details
Every Schema has an .ast property of this type. Use the guard functions
(
isString
,
isObjects
, etc.) to narrow to a specific variant,
then access variant-specific fields.
- All variants share the
Base
fields:
annotations, checks,
encoding, context.
- Discriminate on the
_tag field (e.g. "String", "Objects", "Union").
AST
}
// Arrays Meta
readonly Annotations.BuiltInMetaDefinitions.isUnique: {
readonly _tag: "isUnique";
}
isUnique: {
readonly _tag: "isUnique"_tag: "isUnique"
}
// Declaration Meta
readonly Annotations.BuiltInMetaDefinitions.isMinSize: {
readonly _tag: "isMinSize";
readonly minSize: number;
}
isMinSize: {
readonly _tag: "isMinSize"_tag: "isMinSize"
readonly minSize: numberminSize: number
}
readonly Annotations.BuiltInMetaDefinitions.isMaxSize: {
readonly _tag: "isMaxSize";
readonly maxSize: number;
}
isMaxSize: {
readonly _tag: "isMaxSize"_tag: "isMaxSize"
readonly maxSize: numbermaxSize: number
}
readonly Annotations.BuiltInMetaDefinitions.isSizeBetween: {
readonly _tag: "isSizeBetween";
readonly minimum: number;
readonly maximum: number;
}
isSizeBetween: {
readonly _tag: "isSizeBetween"_tag: "isSizeBetween"
readonly minimum: numberminimum: number
readonly maximum: numbermaximum: number
}
}
/**
* Union of all metadata payloads defined by `BuiltInMetaDefinitions`.
*
* @category utility types
* @since 4.0.0
*/
export type type Annotations.BuiltInMeta = {
readonly _tag: "isStringFinite";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringBigInt";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringSymbol";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isMinLength";
readonly minLength: number;
} | {
readonly _tag: "isMaxLength";
readonly maxLength: number;
} | {
readonly _tag: "isLengthBetween";
readonly minimum: number;
readonly maximum: number;
} | {
readonly _tag: "isPattern";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isTrimmed";
readonly regExp: globalThis.RegExp;
} | ... 38 more ... | {
...;
}
Union of all metadata payloads defined by BuiltInMetaDefinitions.
BuiltInMeta = interface Annotations.BuiltInMetaDefinitionsRegistry of metadata payloads emitted by built-in schema filters and checks.
Details
Do not augment this interface with custom metadata; extend MetaDefinitions
instead.
BuiltInMetaDefinitions[keyof interface Annotations.BuiltInMetaDefinitionsRegistry of metadata payloads emitted by built-in schema filters and checks.
Details
Do not augment this interface with custom metadata; extend MetaDefinitions
instead.
BuiltInMetaDefinitions]
/**
* Augmentable registry of schema filter metadata payloads.
*
* **Details**
*
* Extend this interface to add custom values accepted by annotation `meta`
* fields.
*
* @category models
* @since 4.0.0
*/
export interface interface Annotations.MetaDefinitionsAugmentable registry of schema filter metadata payloads.
Details
Extend this interface to add custom values accepted by annotation meta
fields.
MetaDefinitions extends interface Annotations.BuiltInMetaDefinitionsRegistry of metadata payloads emitted by built-in schema filters and checks.
Details
Do not augment this interface with custom metadata; extend MetaDefinitions
instead.
BuiltInMetaDefinitions {}
/**
* Union of built-in and user-augmented schema filter metadata payloads.
*
* @category utility types
* @since 4.0.0
*/
export type type Annotations.Meta = {
readonly _tag: "isStringFinite";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringBigInt";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isStringSymbol";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isMinLength";
readonly minLength: number;
} | {
readonly _tag: "isMaxLength";
readonly maxLength: number;
} | {
readonly _tag: "isLengthBetween";
readonly minimum: number;
readonly maximum: number;
} | {
readonly _tag: "isPattern";
readonly regExp: globalThis.RegExp;
} | {
readonly _tag: "isTrimmed";
readonly regExp: globalThis.RegExp;
} | ... 38 more ... | {
...;
}
Union of built-in and user-augmented schema filter metadata payloads.
Meta = interface Annotations.MetaDefinitionsAugmentable registry of schema filter metadata payloads.
Details
Extend this interface to add custom values accepted by annotation meta
fields.
MetaDefinitions[keyof interface Annotations.MetaDefinitionsAugmentable registry of schema filter metadata payloads.
Details
Extend this interface to add custom values accepted by annotation meta
fields.
MetaDefinitions]
}