import type { ParseNode } from '../parser/ParseNode.mts'; import { type Character } from './all.mts'; export type RegExpMatchingSource = (readonly string[]) & { readonly raw: string; }; /** https://tc39.es/ecma262/#pattern-matchstate */ declare class MatchState { readonly input: RegExpMatchingSource; readonly endIndex: number; readonly captures: readonly (Range | undefined)[]; constructor(input: RegExpMatchingSource, endIndex: number, captures: readonly (undefined | Range)[]); static createRegExpMatchingSource(input: readonly string[], raw: string): RegExpMatchingSource; } export { MatchState as RegExpState }; type MatcherResult = MatchState | 'failure'; export type RegExpMatcher = (input: RegExpMatchingSource, index: number) => MatcherResult; /** https://tc39.es/ecma262/#sec-regexp-records */ export interface RegExpRecord { readonly IgnoreCase: boolean; readonly Multiline: boolean; readonly DotAll: boolean; readonly Unicode: boolean; readonly UnicodeSets: boolean; readonly CapturingGroupsCount: number; } interface Range { readonly startIndex: number; readonly endIndex: number; } /** https://tc39.es/ecma262/#sec-compilepattern */ export declare function CompilePattern(pattern: ParseNode.RegExp.Pattern, rer: RegExpRecord): RegExpMatcher; /** https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch */ export declare function Canonicalize(rer: RegExpRecord, ch: Character): Character; export declare function CountLeftCapturingParensWithin(node: ParseNode.RegExp.Term_Atom | ParseNode.RegExp.Pattern): number; export declare function IsCharacterClass(node: ParseNode.RegExp.ClassAtom): boolean; //# sourceMappingURL=RegExp.d.mts.map