(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.
Source effect/SchemaRepresentation.ts:16572 lines
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 SchemaAST.AST = /*unresolved*/ anyAST, ...interface Array<T>Array<import SchemaASTSchemaAST.type SchemaAST.AST = /*unresolved*/ anyAST>]) => 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