1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- import { Directives } from '../doc/directives.js';
- import { Document } from '../doc/Document.js';
- import { ErrorCode, YAMLParseError, YAMLWarning } from '../errors.js';
- import type { ParsedNode, Range } from '../nodes/Node.js';
- import type { DocumentOptions, ParseOptions, SchemaOptions } from '../options.js';
- import type { Token } from '../parse/cst.js';
- type ErrorSource = number | [number, number] | Range | {
- offset: number;
- source?: string;
- };
- export type ComposeErrorHandler = (source: ErrorSource, code: ErrorCode, message: string, warning?: boolean) => void;
- export declare class Composer<Contents extends ParsedNode = ParsedNode, Strict extends boolean = true> {
- private directives;
- private doc;
- private options;
- private atDirectives;
- private prelude;
- private errors;
- private warnings;
- constructor(options?: ParseOptions & DocumentOptions & SchemaOptions);
- private onError;
- private decorate;
- /**
- * Current stream status information.
- *
- * Mostly useful at the end of input for an empty stream.
- */
- streamInfo(): {
- comment: string;
- directives: Directives;
- errors: YAMLParseError[];
- warnings: YAMLWarning[];
- };
-
- compose(tokens: Iterable<Token>, forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
-
- next(token: Token): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
-
- end(forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<Contents, Strict>, void, unknown>;
- }
- export {};
|