UNPKG

htmljs-parser

Version:

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

23 lines (22 loc) 1.34 kB
import { CODE, type Parser } from "../internal"; import { type Location, type Position } from "./constants"; export declare function isWhitespaceCode(code: number): boolean; export declare function isIndentCode(code: number): code is CODE.SPACE | CODE.TAB; /** * 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): code is CODE.CLOSE_ANGLE_BRACKET; export declare function matchesCloseParen(code: number): code is CODE.CLOSE_PAREN; export declare function matchesCloseCurlyBrace(code: number): code is CODE.CLOSE_CURLY_BRACE; export declare function matchesPipe(code: number): code is CODE.PIPE;