summaryrefslogtreecommitdiff
path: root/node_modules/yaml/dist/compose/composer.d.ts
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-11-28 17:14:38 +0100
committerMinteck <contact@minteck.org>2022-11-28 17:14:38 +0100
commit18efd30a263ec0d79a26a82cbd8c90c9f81056b7 (patch)
treeaea01bf3506dda706719fc68eb37b77ed9ef3fe8 /node_modules/yaml/dist/compose/composer.d.ts
downloadautoreport-mane.tar.gz
autoreport-mane.tar.bz2
autoreport-mane.zip
Open sourceHEADmane
Diffstat (limited to 'node_modules/yaml/dist/compose/composer.d.ts')
-rw-r--r--node_modules/yaml/dist/compose/composer.d.ts62
1 files changed, 62 insertions, 0 deletions
diff --git a/node_modules/yaml/dist/compose/composer.d.ts b/node_modules/yaml/dist/compose/composer.d.ts
new file mode 100644
index 0000000..9db2477
--- /dev/null
+++ b/node_modules/yaml/dist/compose/composer.d.ts
@@ -0,0 +1,62 @@
+import { Directives } from '../doc/directives.js';
+import { Document } from '../doc/Document.js';
+import { ErrorCode, YAMLParseError, YAMLWarning } from '../errors.js';
+import { Range } from '../nodes/Node.js';
+import type { DocumentOptions, ParseOptions, SchemaOptions } from '../options.js';
+import type { Token } from '../parse/cst.js';
+declare type ErrorSource = number | [number, number] | Range | {
+ offset: number;
+ source?: string;
+};
+export declare type ComposeErrorHandler = (source: ErrorSource, code: ErrorCode, message: string, warning?: boolean) => void;
+/**
+ * Compose a stream of CST nodes into a stream of YAML Documents.
+ *
+ * ```ts
+ * import { Composer, Parser } from 'yaml'
+ *
+ * const src: string = ...
+ * const tokens = new Parser().parse(src)
+ * const docs = new Composer().compose(tokens)
+ * ```
+ */
+export declare class Composer {
+ 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 into documents.
+ *
+ * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
+ * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
+ */
+ compose(tokens: Iterable<Token>, forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<import("../nodes/Node.js").ParsedNode>, void, unknown>;
+ /** Advance the composer by one CST token. */
+ next(token: Token): Generator<Document.Parsed<import("../nodes/Node.js").ParsedNode>, void, unknown>;
+ /**
+ * Call at end of input to yield any remaining document.
+ *
+ * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
+ * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
+ */
+ end(forceDoc?: boolean, endOffset?: number): Generator<Document.Parsed<import("../nodes/Node.js").ParsedNode>, void, unknown>;
+}
+export {};