/** Supported attribute value kinds declared in an {@link AttributeSchema}. */ export type AttrType = 'boolean' | 'string' | 'numeric'; /** * Caller-defined attribute vocabulary; the library validates and coerces against it but ships no * platform presets. */ export interface AttributeSchema { /** Map of canonical attribute names to their type and optional aliases */ attributes: Record; /** * Boolean coercion rules applied during normalization. * Defaults to `literal` when omitted. */ booleanFormat?: 'zero-one' | 'true-false' | 'literal'; } /** A normalized CSS attribute or pseudo-class entry in the {@link ParsedSelector} IR */ export interface ParsedAttribute { /** Canonical attribute name (lowercased per schema) */ name: string; /** CSS attribute comparison operator, when present */ operator?: '=' | '*=' | '^=' | '$=' | '~='; /** Coerced or raw string value */ value?: string; /** `true` when a boolean attribute was specified without an explicit value */ implicit?: boolean; } /** A normalized CSS rule node in the {@link ParsedSelector} IR */ export interface ParsedRule { /** How this rule connects to its parent when nested */ combinator?: 'descendant' | 'child'; /** Raw CSS tag name (may be `*`) */ tag?: string; /** Raw CSS class tokens */ classes: readonly string[]; /** Raw `#id` value */ id?: string; /** Normalized attribute selectors */ attributes: readonly ParsedAttribute[]; /** Normalized pseudo-class selectors */ pseudos: readonly ParsedAttribute[]; /** Nested descendant or child rule */ nested?: ParsedRule; } /** * Stable public intermediate representation — CSS structure, not native locator syntax. * * Only the first comma-separated rule from the input selector is represented. */ export interface ParsedSelector { /** Root rule of the parsed selector */ rule: ParsedRule; } /** Result of CSS → native transformation, including the target locator strategy */ export interface NativeLocator { /** Locator strategy name (e.g. `-ios class chain`, `-android uiautomator`) */ strategy: string; /** Native selector string for the chosen strategy */ selector: string; } /** * Driver-implemented emitter that converts {@link ParsedSelector} IR to a native selector string * for a fixed strategy. */ export interface StrategyEmitter { /** Locator strategy name this emitter produces */ readonly strategy: string; /** * @param parsed - Normalized CSS selector IR * @param ctx - Optional driver-specific context (e.g. Android `appPackage`) * @returns Native selector string for this emitter's strategy */ emit(parsed: ParsedSelector, ctx?: TContext): string; } /** Registry key identifying which emitter to use */ export type StrategyKey>> = keyof TEmitters & string; /** * Driver-implemented callback that picks which emitter registry key to use for a parsed selector. */ export type StrategyResolver>, TContext = unknown> = (parsed: ParsedSelector, css: string, ctx?: TContext) => StrategyKey; /** Function returned by {@link createCssTransformer} */ export type CssTransformer = (css: string, ctx?: TContext) => NativeLocator; /** Configuration for {@link createCssTransformer} */ export interface CssTransformerConfig>, TContext = unknown> { /** Attribute vocabulary passed to normalization */ schema: AttributeSchema; /** Named registry of strategy emitters */ emitters: TEmitters; /** Strategy routing callback */ resolveStrategy: StrategyResolver; } //# sourceMappingURL=types.d.ts.map