(asts: readonly [SchemaAST.AST, ...Array<SchemaAST.AST>]): MultiDocumentConverts one or more Schema ASTs into a MultiDocument.
When to use
Use when you have multiple Schema ASTs and need one schema representation
MultiDocument with shared references.
Details
All schemas share a single references map.
export const const fromASTs: (
asts: readonly [
SchemaAST.AST,
...Array<SchemaAST.AST>
]
) => MultiDocument
Converts one or more Schema ASTs into a
MultiDocument
.
When to use
Use when you have multiple Schema ASTs and need one schema representation
MultiDocument with shared references.
Details
All schemas share a single references map.
fromASTs: (asts: readonly [
SchemaAST.AST,
...Array<SchemaAST.AST>
]
(parameter) asts: {
0: SchemaAST.AST;
length: number;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
concat: { (...items: Array<ConcatArray<SchemaAST.AST>>): Array<SchemaAST.AST>; (...items: Array<SchemaAST.AST | ConcatArray<SchemaAST.AST>>): Array<SchemaAST.AST> };
join: (separator?: string) => string;
slice: (start?: number, end?: number) => Array<SchemaAST.AST>;
indexOf: (searchElement: SchemaAST.AST, fromIndex?: number) => number;
lastIndexOf: (searchElement: SchemaAST.AST, fromIndex?: number) => number;
every: { (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => value is S, thisArg?: any): this is readonly S[]; (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => unknown…;
some: (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => void, thisArg?: any) => void;
map: (callbackfn: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => value is S, thisArg?: any): Array<S>; (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => unknown, thisArg?: …;
reduce: { (callbackfn: (previousValue: SchemaAST.AST, currentValue: SchemaAST.AST, currentIndex: number, array: ReadonlyArray<SchemaAST.AST>) => SchemaAST.AST): SchemaAST.AST; (callbackfn: (previousValue: SchemaAST.AST, currentValue: SchemaAST.AST…;
reduceRight: { (callbackfn: (previousValue: SchemaAST.AST, currentValue: SchemaAST.AST, currentIndex: number, array: ReadonlyArray<SchemaAST.AST>) => SchemaAST.AST): SchemaAST.AST; (callbackfn: (previousValue: SchemaAST.AST, currentValue: SchemaAST.AST…;
find: { (predicate: (value: SchemaAST.AST, index: number, obj: ReadonlyArray<SchemaAST.AST>) => value is S, thisArg?: any): S | undefined; (predicate: (value: SchemaAST.AST, index: number, obj: ReadonlyArray<SchemaAST.AST>) => unknown, thisArg?:…;
findIndex: (predicate: (value: SchemaAST.AST, index: number, obj: ReadonlyArray<SchemaAST.AST>) => unknown, thisArg?: any) => number;
entries: () => ArrayIterator<[number, SchemaAST.AST]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<SchemaAST.AST>;
includes: (searchElement: SchemaAST.AST, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: SchemaAST.AST, index: number, array: Array<SchemaAST.AST>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => SchemaAST.AST | undefined;
findLast: { (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => value is S, thisArg?: any): S | undefined; (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => unknown, thisA…;
findLastIndex: (predicate: (value: SchemaAST.AST, index: number, array: ReadonlyArray<SchemaAST.AST>) => unknown, thisArg?: any) => number;
toReversed: () => Array<SchemaAST.AST>;
toSorted: (compareFn?: ((a: SchemaAST.AST, b: SchemaAST.AST) => number) | undefined) => Array<SchemaAST.AST>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<SchemaAST.AST>): Array<SchemaAST.AST>; (start: number, deleteCount?: number): Array<SchemaAST.AST> };
with: (index: number, value: SchemaAST.AST) => Array<SchemaAST.AST>;
}
asts: readonly [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, ...interface Array<T>Array<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>]) => type MultiDocument = {
readonly representations: readonly [
Representation,
...Array<Representation>
]
readonly references: References
}
One or more
Representation
s sharing a common
References
map.
When to use
Use when you use
fromASTs
to create this from multiple Schema ASTs,
toCodeDocument
to generate TypeScript code, and
toJsonSchemaMultiDocument
to convert to JSON Schema.
MultiDocument =
import InternalRepresentationInternalRepresentation.function fromASTs(
asts: readonly [
SchemaAST.AST,
...Array<SchemaAST.AST>
]
): SchemaRepresentation.MultiDocument
fromASTs