1 | import { Directives } from '../doc/directives';
|
2 | import { Document } from '../doc/Document';
|
3 | import type { ErrorCode } from '../errors';
|
4 | import { YAMLParseError, YAMLWarning } from '../errors';
|
5 | import type { ParsedNode, Range } from '../nodes/Node';
|
6 | import type { DocumentOptions, ParseOptions, SchemaOptions } from '../options';
|
7 | import type { Token } from '../parse/cst';
|
8 | type ErrorSource = number | [number, number] | Range | {
|
9 | offset: number;
|
10 | source?: string;
|
11 | };
|
12 | export type ComposeErrorHandler = (source: ErrorSource, code: ErrorCode, message: string, warning?: boolean) => void;
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 | export declare class Composer<Contents extends ParsedNode = ParsedNode, Strict extends boolean = true> {
|
25 | private directives;
|
26 | private doc;
|
27 | private options;
|
28 | private atDirectives;
|
29 | private prelude;
|
30 | private errors;
|
31 | private warnings;
|
32 | constructor(options?: ParseOptions & DocumentOptions & SchemaOptions);
|
33 | private onError;
|
34 | private decorate;
|
35 | /**
|
36 | * Current stream status information.
|
37 | *
|
38 | * Mostly useful at the end of input for an empty stream.
|
39 | */
|
40 | streamInfo(): {
|
41 | comment: string;
|
42 | directives: Directives;
|
43 | errors: YAMLParseError[];
|
44 | warnings: YAMLWarning[];
|
45 | };
|
46 | |
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 | compose(tokens: Iterable<Token>, forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
|
53 |
|
54 | next(token: Token): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
|
55 | |
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 | end(forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
|
62 | }
|
63 | export {};
|