UNPKG

htmljs-parser

Version:

An HTML parser recognizes content and string placeholders and allows JavaScript expressions as attribute values

22 lines (21 loc) 1.18 kB
import { type Parser } from "../internal"; import { type Location, type Position } from "./constants"; export declare function isWhitespaceCode(code: number): boolean; /** * Given a source code line offsets, a start offset and an end offset, returns a Location object with line & character information for the start and end offsets. */ export declare function getLocation(lines: number[], startOffset: number, endOffset: number): Location; /** * Given a source code line offsets and an offset, returns a Position object with line & character information. */ export declare function getPosition(lines: number[], offset: number): Position; /** * Scan through some source code and generate an array of offsets for each newline. * Useful for generating line/column information for source code. */ export declare function getLines(src: string): number[]; export declare function htmlEOF(this: Parser): void; export declare function matchesCloseAngleBracket(code: number): boolean; export declare function matchesCloseParen(code: number): boolean; export declare function matchesCloseCurlyBrace(code: number): boolean; export declare function matchesPipe(code: number): boolean;