Filter<E>Represents a single validation check attached to an AST node.
Details
run— the validation function. Returnsundefinedon success, or anIssueon failure.annotations— optional filter-level metadata (expected message, meta tags, arbitrary constraint hints).aborted— whentrue, parsing stops immediately after this filter fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a FilterGroup.
export class class Filter<in E>class Filter {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => Filter<E>;
abort: () => Filter<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter<in function (type parameter) E in Filter<in E>E> extends import PipeablePipeable.Class {
readonly Filter<in E>._tag: "Filter"_tag = "Filter"
readonly Filter<in E>.run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefinedrun: (input: in Einput: function (type parameter) E in Filter<in E>E, self: ASTself: type AST =
| Declaration
| Null
| Undefined
| Void
| Never
| Unknown
| Any
| String
| Number
| Boolean
| BigInt
| Symbol
| Literal
| UniqueSymbol
| ObjectKeyword
| Enum
| TemplateLiteral
| Arrays
| Objects
| Union<AST>
| Suspend
Discriminated 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, options: ParseOptions(parameter) options: {
errors: "first" | "all" | undefined;
onExcessProperty: "ignore" | "error" | "preserve" | undefined;
propertyOrder: "none" | "original" | undefined;
disableChecks: boolean | undefined;
concurrency: number | "unbounded" | undefined;
}
options: ParseOptions) => import SchemaIssueSchemaIssue.type Issue =
| SchemaIssue.Leaf
| SchemaIssue.Filter
| SchemaIssue.Encoding
| SchemaIssue.Pointer
| SchemaIssue.Composite
| SchemaIssue.AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue | undefined
readonly Filter<in E>.annotations: anyannotations: import SchemaSchema.declareAnnotations.type Schema.Annotations.Filter = /*unresolved*/ anyFilter | undefined
/**
* Whether the parsing process should be aborted after this check has failed.
*/
readonly Filter<in E>.aborted: booleanWhether the parsing process should be aborted after this check has failed.
aborted: boolean
constructor(
run: (
input: E,
self: AST,
options: ParseOptions
) => SchemaIssue.Issue | undefined
run: (input: in Einput: function (type parameter) E in Filter<in E>E, self: ASTself: type AST =
| Declaration
| Null
| Undefined
| Void
| Never
| Unknown
| Any
| String
| Number
| Boolean
| BigInt
| Symbol
| Literal
| UniqueSymbol
| ObjectKeyword
| Enum
| TemplateLiteral
| Arrays
| Objects
| Union<AST>
| Suspend
Discriminated 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, options: ParseOptions(parameter) options: {
errors: "first" | "all" | undefined;
onExcessProperty: "ignore" | "error" | "preserve" | undefined;
propertyOrder: "none" | "original" | undefined;
disableChecks: boolean | undefined;
concurrency: number | "unbounded" | undefined;
}
options: ParseOptions) => import SchemaIssueSchemaIssue.type Issue =
| SchemaIssue.Leaf
| SchemaIssue.Filter
| SchemaIssue.Encoding
| SchemaIssue.Pointer
| SchemaIssue.Composite
| SchemaIssue.AnyOf
The root discriminated union of all validation error nodes.
When to use
Use when typing the error channel in Effect<A, Issue, R> results from
schema parsing, or when writing custom formatters or issue-tree walkers.
Details
Every node has a _tag field for pattern-matching. The union includes both
terminal
Leaf
types and composite types that wrap inner issues:
Filter
,
Encoding
,
Pointer
,
Composite
,
AnyOf
. All Issue instances have a toString() that delegates to
the default formatter, so String(issue) produces a human-readable message.
Issue | undefined,
annotations: anyannotations: import SchemaSchema.declareAnnotations.type Schema.Annotations.Filter = /*unresolved*/ anyFilter | undefined = var undefinedundefined,
/**
* Whether the parsing process should be aborted after this check has failed.
*/
aborted: booleanWhether the parsing process should be aborted after this check has failed.
aborted: boolean = false
) {
super()
this.Filter<in E>.run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefinedrun = run: (
input: E,
self: AST,
options: ParseOptions
) => SchemaIssue.Issue | undefined
run
this.Filter<in E>.annotations: anyannotations = annotations: anyannotations
this.Filter<in E>.aborted: booleanWhether the parsing process should be aborted after this check has failed.
aborted = aborted: booleanWhether the parsing process should be aborted after this check has failed.
aborted
}
function Filter(annotations: Schema.Annotations.Filter): Filter<E>annotate(annotations: Schema.Annotations.Filter(parameter) annotations: {
message: string | undefined;
identifier: string | undefined;
meta: Meta | undefined;
arbitrary: ToArbitrary.Filter | undefined;
expected: string | undefined;
title: string | undefined;
description: string | undefined;
documentation: string | undefined;
readOnly: boolean | undefined;
writeOnly: boolean | undefined;
format: string | undefined;
contentEncoding: string | undefined;
contentMediaType: string | undefined;
}
annotations: import SchemaSchema.declareAnnotations.type Schema.Annotations.Filter = /*unresolved*/ anyFilter): class Filter<in E>class Filter {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => Filter<E>;
abort: () => Filter<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter<function (type parameter) E in Filter<in E>E> {
return new constructor Filter<E>(run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined, annotations?: Schema.Annotations.Filter | undefined, aborted?: boolean): Filter<E>Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter(this.Filter<in E>.run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefinedrun, { ...this.Filter<in E>.annotations: anyannotations, ...annotations: Schema.Annotations.Filter(parameter) annotations: {
message: string | undefined;
identifier: string | undefined;
meta: Meta | undefined;
arbitrary: ToArbitrary.Filter | undefined;
expected: string | undefined;
title: string | undefined;
description: string | undefined;
documentation: string | undefined;
readOnly: boolean | undefined;
writeOnly: boolean | undefined;
format: string | undefined;
contentEncoding: string | undefined;
contentMediaType: string | undefined;
}
annotations }, this.Filter<in E>.aborted: booleanWhether the parsing process should be aborted after this check has failed.
aborted)
}
function Filter(): Filter<E>abort(): class Filter<in E>class Filter {
_tag: 'Filter';
run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined;
annotations: Schema.Annotations.Filter | undefined;
aborted: boolean;
annotate: (annotations: Schema.Annotations.Filter) => Filter<E>;
abort: () => Filter<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter<function (type parameter) E in Filter<in E>E> {
return new constructor Filter<E>(run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefined, annotations?: Schema.Annotations.Filter | undefined, aborted?: boolean): Filter<E>Represents a single validation check attached to an AST node.
Details
run — the validation function. Returns undefined on success, or an
Issue on failure.
annotations — optional filter-level metadata (expected message, meta
tags, arbitrary constraint hints).
aborted — when true, parsing stops immediately after this filter
fails (no further checks run).
Use .annotate() to add metadata and .abort() to mark as aborting.
Combine with another check via .and() to form a
FilterGroup
.
Filter(this.Filter<in E>.run: (input: E, self: AST, options: ParseOptions) => SchemaIssue.Issue | undefinedrun, this.Filter<in E>.annotations: anyannotations, true)
}
function Filter(other: Check<E>, annotations?: Schema.Annotations.Filter): FilterGroup<E>and(other: Check<E>other: type Check<T> = Filter<T> | FilterGroup<T>Check<function (type parameter) E in Filter<in E>E>, annotations: anyannotations?: import SchemaSchema.declareAnnotations.type Schema.Annotations.Filter = /*unresolved*/ anyFilter): class FilterGroup<in E>class FilterGroup {
_tag: 'FilterGroup';
checks: readonly [Check<E>, ...Array<Check<E>>];
annotations: Schema.Annotations.Filter | undefined;
annotate: (annotations: Schema.Annotations.Filter) => FilterGroup<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
FilterGroup<function (type parameter) E in Filter<in E>E>
function Filter(other: Check<E>, annotations?: Schema.Annotations.Filter): FilterGroup<E>and(other: Check<E>other: type Check<T> = Filter<T> | FilterGroup<T>Check<function (type parameter) E in Filter<in E>E>, annotations: anyannotations?: import SchemaSchema.declareAnnotations.type Schema.Annotations.Filter = /*unresolved*/ anyFilter): class FilterGroup<in E>class FilterGroup {
_tag: 'FilterGroup';
checks: readonly [Check<E>, ...Array<Check<E>>];
annotations: Schema.Annotations.Filter | undefined;
annotate: (annotations: Schema.Annotations.Filter) => FilterGroup<E>;
and: (other: Check<E>, annotations?: Schema.Annotations.Filter) => FilterGroup<E>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
FilterGroup<function (type parameter) E in Filter<in E>E> {
return new constructor FilterGroup<E>(checks: readonly [Check<E>, ...Check<E>[]], annotations?: Schema.Annotations.Filter | undefined): FilterGroup<E>FilterGroup([this, other: Check<E>other], annotations: anyannotations)
}
}