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