/** * The low-level parsing behind `tabStopsIn`: balanced-bracket and value scanning, * a tag's attribute value, the binding/import RESOLVER (name → its home file and * definition, expanded across hops), and the two per-tag predicates — * `tagDeclaresTab` (is this a tab stop?) and `taiClassesOf` (which `tai-*` classes * does it wear?). */ /** * The text from `start` to the character closing the bracket it opens, quotes * respected so a brace inside a string neither opens nor closes anything. */ export declare function balancedFrom(source: string, start: number, open: string, close: string): string; export declare function readAssignmentValue(source: string, start: number): string; /** * The index of the `>` closing an opening tag whose attribute run starts at * `from`, quotes and brace depth tracked so a `>` inside a `className` expression * (`{x > 0 ? a : b}`) is not mistaken for it. */ export declare function scanToTagClose(source: string, from: number): number; /** One opening JSX tag: its element name and everything between that and the `>`. */ export interface OpeningTag { readonly name: string; readonly attributes: string; } /** * The value written for `attribute`, unquoted or unbraced; `undefined` when the * tag does not write it at all, which is the difference between "no `tabIndex`" * and "`tabIndex={-1}`". */ export declare function attributeValue(attributes: string, attribute: string): string | undefined; /** Resolves a referenced name to the file it is bound in and its definition text. */ export interface TabStopResolver { /** Where a name is bound: the file itself, or the file it is imported from. */ homeOf(file: string, name: string): string | undefined; /** The definition text of `name` bound in `home`, if any. */ definitionOf(home: string, name: string): string | undefined; /** * `text` with the definition of every name it references appended, to `depth` * hops — a class reaches its element through as many as three (the tag names a * helper, the helper names a table, the table holds the literal). */ expand(text: string, file: string, depth: number, seen: Set): string; } /** A resolver over pre-scanned per-file binding and import maps. */ export declare function createTabStopResolver(bindings: ReadonlyMap>, imports: ReadonlyMap>): TabStopResolver; /** * Whether the tag is a keyboard tab stop: a natively focusable element, an element * with a non-negative `tabIndex`, or one spreading a props object that declares one. */ export declare function tagDeclaresTab(tag: OpeningTag, file: string, resolver: TabStopResolver): boolean; /** The `tai-*` classes the tag wears, expanded through its bindings to `depth` 3. */ export declare function taiClassesOf(tag: OpeningTag, file: string, resolver: TabStopResolver): string[]; //# sourceMappingURL=tab-stop-parse.d.ts.map