Urara-Blog/node_modules/.pnpm-store/v3/files/6f/0f8d0f214ccde9b27f82cb2596a3b62f303bae221f2a4e7d5907257bb4b35c69ade22fbeddbe1796962992c94afa62ac2ff2b59ec1041313f2d46ba699fa9f
2022-08-14 01:14:53 +08:00

38 lines
1.2 KiB
Text

import { TemplateNode, Ast, ParserOptions, Fragment, Style, Script } from '../interfaces';
interface LastAutoClosedTag {
tag: string;
reason: string;
depth: number;
}
export declare class Parser {
readonly template: string;
readonly filename?: string;
readonly customElement: boolean;
index: number;
stack: TemplateNode[];
html: Fragment;
css: Style[];
js: Script[];
meta_tags: {};
last_auto_closed_tag?: LastAutoClosedTag;
constructor(template: string, options: ParserOptions);
current(): TemplateNode;
acorn_error(err: any): void;
error({ code, message }: {
code: string;
message: string;
}, index?: number): void;
eat(str: string, required?: boolean, error?: {
code: string;
message: string;
}): boolean;
match(str: string): boolean;
match_regex(pattern: RegExp): string;
allow_whitespace(): void;
read(pattern: RegExp): string;
read_identifier(allow_reserved?: boolean): string;
read_until(pattern: RegExp, error_message?: Parameters<Parser['error']>[0]): string;
require_whitespace(): void;
}
export default function parse(template: string, options?: ParserOptions): Ast;
export {};