1 | import type { Document } from './Document.js';
|
2 | export declare class Directives {
|
3 | static defaultYaml: Directives['yaml'];
|
4 | static defaultTags: Directives['tags'];
|
5 | yaml: {
|
6 | version: '1.1' | '1.2' | 'next';
|
7 | explicit?: boolean;
|
8 | };
|
9 | tags: Record<string, string>;
|
10 | |
11 |
|
12 |
|
13 |
|
14 | docStart: true | null;
|
15 |
|
16 | docEnd: boolean;
|
17 | |
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | private atNextDocument?;
|
24 | constructor(yaml?: Directives['yaml'], tags?: Directives['tags']);
|
25 | clone(): Directives;
|
26 | /**
|
27 | * During parsing, get a Directives instance for the current document and
|
28 | * update the stream state according to the current version's spec.
|
29 | */
|
30 | atDocument(): Directives;
|
31 | /**
|
32 | * @param onError - May be called even if the action was successful
|
33 | * @returns `true` on success
|
34 | */
|
35 | add(line: string, onError: (offset: number, message: string, warning?: boolean) => void): boolean;
|
36 | /**
|
37 | * Resolves a tag, matching handles to those defined in %TAG directives.
|
38 | *
|
39 | * @returns Resolved tag, which may also be the non-specific tag `'!'` or a
|
40 | * `'!local'` tag, or `null` if unresolvable.
|
41 | */
|
42 | tagName(source: string, onError: (message: string) => void): string | null;
|
43 | /**
|
44 | * Given a fully resolved tag, returns its printable string form,
|
45 | * taking into account current tag prefixes and defaults.
|
46 | */
|
47 | tagString(tag: string): string;
|
48 | toString(doc?: Document): string;
|
49 | }
|