/** * Config resolver — collapses the optional, string-based remote-config payload * into the fully-typed `ResolvedSelectorConfig` that strategies, orchestrator, * and fallback consume at runtime. * * Responsibilities: * * 1. Apply defaults for every field. The defaults (enabled = false, * attribute = `data-amp-track-id`, built-in pattern packs) match the * design doc's "v1 defaults" table. * * 2. Compile regex strings into `RegExp[]`. Bad regexes are skipped by the * underlying `compile` helpers; when a logger is provided it surfaces a * warning for each invalid pattern so customers can diagnose why their * override isn't taking effect. * * 3. Treat customer-provided pattern lists as a **full replacement** of the * defaults — not a merge. This matches the design doc: "The customer * sees the defaults in the remote-config UI and may add or remove * patterns as needed." If a customer provides `autogeneratedIdPatterns: * []`, that's their explicit request to disable autogen filtering. * * 4. Clamp `maxAncestorWalkDepth` into a sane range. Negative / zero values * are coerced to `undefined` (treat as "no limit") rather than throwing — * remote config should never crash the engine. * * See the design doc: * packages/plugin-autocapture-browser/element-selector-strategy-v1-no-classes.md */ import { ElementSelectorLogger, ElementSelectorRemoteConfig, ResolvedSelectorConfig } from '../types'; /** * Built-in defaults applied when a field is absent from the remote payload. * Exported so consumers (and tests) can introspect the baseline without * round-tripping through `resolveSelectorConfig({})`. */ export declare const DEFAULT_RESOLVED_CONFIG: Readonly; /** * Resolve a (possibly partial, possibly absent) remote-config payload into a * fully-typed runtime config. Always returns a fresh object; never mutates the * input. * * Field-by-field semantics: * * - `enabled`: defaults to false (the engine ships dormant). Any boolean in * the payload — including `false` — wins. * - `explicitTrackingAttribute`: defaults to `data-amp-track-id`. Empty * strings are rejected (they'd make the strategy match every element); * fall back to the default in that case. * - `autogeneratedIdPatterns` / `unstableClassPatterns`: present → compile * the strings (skipping invalid regexes), use the compiled list as-is. * Absent → use the defaults. * - `maxAncestorWalkDepth`: positive finite integer → use as-is. Anything * else (zero, negative, NaN, Infinity) → `undefined` (no limit). */ export declare function resolveSelectorConfig(remote?: ElementSelectorRemoteConfig, logger?: ElementSelectorLogger): ResolvedSelectorConfig; //# sourceMappingURL=resolve-config.d.ts.map