/** * Extraction Utilities * * Pure functions for extracting CSS selectors, string literals, URLs, and numbers * from input strings. These are language-independent and used by all tokenizers. */ /** * Extract a CSS selector from the input string starting at pos. * CSS selectors are universal across languages. * * Supported formats: * - #id * - .class * - [attribute] * - [attribute=value] * - @attribute (shorthand) * - *property (CSS property shorthand) * - Complex selectors with combinators (limited) * * Method call handling: * - #dialog.showModal() → stops after #dialog (method call, not compound selector) * - #box.active → compound selector (no parens) * * NOTE: intentionally diverges from the semantic package's copy * (packages/semantic/src/tokenizers/extractors/css-selector.ts), which also * consumes pseudo-class/pseudo-element segments (#x:hover, .a:not(.b)). This * legacy version is only used by BaseTokenizer.trySelector (no semantic call * sites) and stays as-is. */ export declare function extractCssSelector(input: string, startPos: number): string | null; /** * Check if a single quote at pos is a possessive marker ('s). * Returns true if this looks like possessive, not a string start. * * Examples: * - #element's *opacity → possessive (returns true) * - 'hello' → string (returns false) * - it's value → possessive (returns true) */ export declare function isPossessiveMarker(input: string, pos: number): boolean; /** * Extract a string literal from the input starting at pos. * Handles both ASCII quotes and Unicode quotes. * * Note: Single quotes that look like possessive markers ('s) are skipped. */ export declare function extractStringLiteral(input: string, startPos: number): string | null; /** * Check if the input at position starts a URL. * Detects: /path, ./path, ../path, //domain.com, http://, https:// */ export declare function isUrlStart(input: string, pos: number): boolean; /** * Extract a URL from the input starting at pos. * Handles paths, query strings, and fragments. * * Fragment (#) handling: * - /page#section → includes fragment as part of URL * - #id alone → not a URL (CSS selector) */ export declare function extractUrl(input: string, startPos: number): string | null; /** * Extract a number from the input starting at pos. * Handles integers and decimals. */ export declare function extractNumber(input: string, startPos: number): string | null; //# sourceMappingURL=extractors.d.ts.map