angular-estree-parser
Version:
A parser that converts Angular source code into an ESTree-compatible form
19 lines (18 loc) • 781 B
TypeScript
import type { LocationInformation, NGNode, RawNGSpan } from './types.js';
export declare class Source {
text: string;
constructor(text: string);
getCharacterIndex(pattern: RegExp | string, index: number): number;
getCharacterLastIndex(pattern: RegExp | string, index: number): number;
transformSpan(span: RawNGSpan, { stripSpaces, hasParentParens }?: {
stripSpaces?: boolean | undefined;
hasParentParens?: boolean | undefined;
}): LocationInformation;
createNode<T extends NGNode>(properties: Partial<T> & {
type: T['type'];
} & RawNGSpan, { stripSpaces, hasParentParens }?: {
stripSpaces?: boolean | undefined;
hasParentParens?: boolean | undefined;
}): T & LocationInformation;
}
export default Source;