(document: Document): MultiDocumentWraps a single Document as a MultiDocument with one representation.
When to use
Use when you need to pass a single schema representation Document where an
API expects a MultiDocument.
export function function toMultiDocument(
document: Document
): MultiDocument
Wraps a single
Document
as a
MultiDocument
with one
representation.
When to use
Use when you need to pass a single schema representation Document where an
API expects a MultiDocument.
toMultiDocument(document: Document(parameter) document: {
representation: Representation;
references: References;
}
document: type Document = {
readonly representation: Representation
readonly references: References
}
A single
Representation
together with its named
References
.
When to use
Use when representing a single Schema AST together with its named references
before reconstructing a runtime Schema, converting to JSON Schema, or
wrapping it as a
MultiDocument
.
Document): 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 {
return {
representations: readonly [
Representation,
...Representation[]
]
(property) representations: {
0: Representation;
length: 1;
toString: () => string;
toLocaleString: { (): string; (locales: string | string[], options?: Intl.NumberFormatOptions & Intl.DateTimeFormatOptions): string };
pop: () => Representation | undefined;
push: (...items: Array<Representation>) => number;
concat: { (...items: Array<ConcatArray<Representation>>): Array<Representation>; (...items: Array<Representation | ConcatArray<Representation>>): Array<Representation> };
join: (separator?: string) => string;
reverse: () => Array<Representation>;
shift: () => Representation | undefined;
slice: (start?: number, end?: number) => Array<Representation>;
sort: (compareFn?: ((a: Representation, b: Representation) => number) | undefined) => [Representation];
splice: { (start: number, deleteCount?: number): Array<Representation>; (start: number, deleteCount: number, ...items: Array<Representation>): Array<Representation> };
unshift: (...items: Array<Representation>) => number;
indexOf: (searchElement: Representation, fromIndex?: number) => number;
lastIndexOf: (searchElement: Representation, fromIndex?: number) => number;
every: { (predicate: (value: Representation, index: number, array: Array<Representation>) => value is S, thisArg?: any): this is S[]; (predicate: (value: Representation, index: number, array: Array<Representation>) => unknown, thisArg?: any): boo…;
some: (predicate: (value: Representation, index: number, array: Array<Representation>) => unknown, thisArg?: any) => boolean;
forEach: (callbackfn: (value: Representation, index: number, array: Array<Representation>) => void, thisArg?: any) => void;
map: (callbackfn: (value: Representation, index: number, array: Array<Representation>) => U, thisArg?: any) => Array<U>;
filter: { (predicate: (value: Representation, index: number, array: Array<Representation>) => value is S, thisArg?: any): Array<S>; (predicate: (value: Representation, index: number, array: Array<Representation>) => unknown, thisArg?: any): Array<…;
reduce: { (callbackfn: (previousValue: Representation, currentValue: Representation, currentIndex: number, array: Array<Representation>) => Representation): Representation; (callbackfn: (previousValue: Representation, currentValue: Representation,…;
reduceRight: { (callbackfn: (previousValue: Representation, currentValue: Representation, currentIndex: number, array: Array<Representation>) => Representation): Representation; (callbackfn: (previousValue: Representation, currentValue: Representation,…;
find: { (predicate: (value: Representation, index: number, obj: Array<Representation>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Representation, index: number, obj: Array<Representation>) => unknown, thisArg?: any): Repre…;
findIndex: (predicate: (value: Representation, index: number, obj: Array<Representation>) => unknown, thisArg?: any) => number;
fill: (value: Representation, start?: number, end?: number) => [Representation];
copyWithin: (target: number, start: number, end?: number) => [Representation];
entries: () => ArrayIterator<[number, Representation]>;
keys: () => ArrayIterator<number>;
values: () => ArrayIterator<Representation>;
includes: (searchElement: Representation, fromIndex?: number) => boolean;
flatMap: (callback: (this: This, value: Representation, index: number, array: Array<Representation>) => U | ReadonlyArray<U>, thisArg?: This | undefined) => Array<U>;
flat: (this: A, depth?: D | undefined) => Array<FlatArray<A, D>>;
at: (index: number) => Representation | undefined;
findLast: { (predicate: (value: Representation, index: number, array: Array<Representation>) => value is S, thisArg?: any): S | undefined; (predicate: (value: Representation, index: number, array: Array<Representation>) => unknown, thisArg?: any): R…;
findLastIndex: (predicate: (value: Representation, index: number, array: Array<Representation>) => unknown, thisArg?: any) => number;
toReversed: () => Array<Representation>;
toSorted: (compareFn?: ((a: Representation, b: Representation) => number) | undefined) => Array<Representation>;
toSpliced: { (start: number, deleteCount: number, ...items: Array<Representation>): Array<Representation>; (start: number, deleteCount?: number): Array<Representation> };
with: (index: number, value: Representation) => Array<Representation>;
}
representations: [document: Document(parameter) document: {
representation: Representation;
references: References;
}
document.representation: Representationrepresentation],
references: Referencesreferences: document: Document(parameter) document: {
representation: Representation;
references: References;
}
document.references: Referencesreferences
}
}