UNPKG

1.25 kBTypeScriptView Raw
1import type { Directives } from '../doc/directives.js';
2import type { ParsedNode } from '../nodes/Node.js';
3import type { ParseOptions } from '../options.js';
4import type { SourceToken, Token } from '../parse/cst.js';
5import type { Schema } from '../schema/Schema.js';
6import type { ComposeErrorHandler } from './composer.js';
7export interface ComposeContext {
8 atKey: boolean;
9 atRoot: boolean;
10 directives: Directives;
11 options: Readonly<Required<Omit<ParseOptions, 'lineCounter'>>>;
12 schema: Readonly<Schema>;
13}
14interface Props {
15 spaceBefore: boolean;
16 comment: string;
17 anchor: SourceToken | null;
18 tag: SourceToken | null;
19 newlineAfterProp: SourceToken | null;
20 end: number;
21}
22declare const CN: {
23 composeNode: typeof composeNode;
24 composeEmptyNode: typeof composeEmptyNode;
25};
26export type ComposeNode = typeof CN;
27export declare function composeNode(ctx: ComposeContext, token: Token, props: Props, onError: ComposeErrorHandler): ParsedNode;
28export declare function composeEmptyNode(ctx: ComposeContext, offset: number, before: Token[] | undefined, pos: number | null, { spaceBefore, comment, anchor, tag, end }: Props, onError: ComposeErrorHandler): import("../index.js").Scalar.Parsed;
29export {};