markuplint-angular-parser
Version:
Angular parser for markuplint.
24 lines (23 loc) • 862 B
TypeScript
import { type State, type Node } from '@markuplint/html-parser';
import type { MLASTNode, MLASTNodeTreeItem, MLASTParentNode, MLASTToken } from '@markuplint/ml-ast';
import { Parser } from '@markuplint/parser-utils';
export interface BaseVisitorContext {
parentNode: MLASTParentNode | null;
text: string;
}
export interface VisitorContext<T extends MLASTToken = MLASTNode> extends BaseVisitorContext {
nodeList: T[];
namespace?: string;
}
export interface NodeMapperOptions<T extends boolean = boolean> extends BaseVisitorContext {
simpleToken?: T;
}
export declare class AngularParser extends Parser<Node, State> {
parse(text: string): {
raw: string;
nodeList: readonly MLASTNodeTreeItem[];
isFragment: boolean;
unknownParseError?: string | undefined;
};
}
export declare const parser: AngularParser;