12345678910111213141516 |
- import LinesAndColumns from "lines-and-columns";
- import { Range } from "./transforms/range";
- import { Alias, BlockFolded, BlockLiteral, Comment, Content, Directive, Document, FlowMapping, FlowSequence, Mapping, Plain, Point, Position, QuoteDouble, QuoteSingle, Sequence } from "./types";
- import * as YAML from "./yaml";
- export declare type YamlNode = null | YAML.ast.Alias | YAML.cst.BlankLine | YAML.ast.BlockFolded | YAML.ast.BlockLiteral | YAML.cst.Comment | YAML.cst.Directive | YAML.ast.Document | YAML.ast.FlowMap | YAML.ast.FlowSeq | YAML.ast.Map | YAML.ast.PlainValue | YAML.ast.QuoteDouble | YAML.ast.QuoteSingle | YAML.ast.Scalar | YAML.ast.Seq;
- export declare type YamlToUnist<T extends YamlNode> = T extends null ? null : T extends YAML.ast.Alias ? Alias : T extends YAML.ast.BlockFolded ? BlockFolded : T extends YAML.ast.BlockLiteral ? BlockLiteral : T extends YAML.cst.Comment ? Comment : T extends YAML.cst.Directive ? Directive : T extends YAML.ast.Document ? Document : T extends YAML.ast.FlowMap ? FlowMapping : T extends YAML.ast.FlowSeq ? FlowSequence : T extends YAML.ast.Map ? Mapping : T extends YAML.ast.PlainValue ? Plain : T extends YAML.ast.QuoteDouble ? QuoteDouble : T extends YAML.ast.QuoteSingle ? QuoteSingle : T extends YAML.ast.Seq ? Sequence : never;
- export interface Context {
- text: string;
- locator: LinesAndColumns;
- comments: Comment[];
- transformOffset: (offset: number) => Point;
- transformRange: (range: Range) => Position;
- transformNode: <T extends YamlNode>(node: T) => YamlToUnist<T>;
- transformContent: (node: YAML.ast.Node) => Content;
- }
- export declare function transformNode<T extends YamlNode>(node: T, context: Context): YamlToUnist<T>;
|