UNPKG

cm-tarnation

Version:

An alternative parser for CodeMirror 6

19 lines (18 loc) 849 B
import { NodeProp, NodeType } from "@lezer/common"; import type * as DF from "./definition"; export declare const NodeTypeProp: NodeProp<Node>; /** Effectively a light wrapper around a CodeMirror `NodeType`. */ export declare class Node { /** The unique ID for this node. */ id: number; /** The name of this node, which may be different to what it emits in the AST. */ name: string; /** The `NodeType` used by CodeMirror. */ type: NodeType; /** The name of an autocomplete handler for this node, if any. */ autocomplete?: string; /** @param id - The ID to assign to this node. */ constructor(id: number, { type, emit, tag, openedBy, closedBy, group, nest, fold, indent, autocomplete }: DF.Node); /** Special `Node` used for when a rule doesn't emit anything. */ static None: Node; }