/** * MT-side mapper registry for `useAnimatedStyle`. * * Maps a `SharedValue`'s current scalar to a partial style object that the * binding flush passes to `setStyleProperties` on the bound element. Keyed by * a string name (`'translateX'`, `'scale'`, ...) so the SWC worklet transform * can capture the selection trivially: a string is a primitive `_c` value * with no special lifting required (unlike arbitrary functions, which can't * be captured into a worklet's closure). * * Custom mappers can be registered via `registerMapper(name, fn)` from MT * code (e.g. a `'main thread'`-marked module body in a user app). BG-side * `useAnimatedStyle` validates the name only against the type union; a * lookup mismatch on MT is a silent no-op at flush time. * * Param shapes are mapper-specific. The `MapperParams` type in * `@sigx/lynx-runtime-internal` is the single source of truth — both * BG-side `useAnimatedStyle` and the MT runtime import it from there. * * Range mapping: `translateX` / `translateY` / `scale` / `opacity` accept * either their linear `factor`/`offset` shape or a `RangeParams` shape * (`{ inputRange, outputRange, extrapolate? }`). The mapper picks the branch * by looking for `inputRange` on the params. */ import type { AnimatedStyleMapper } from '@sigx/lynx-runtime-internal'; export type { MapperParams, BuiltinMapperName, AnimatedStyleMapper, RangeParams, } from '@sigx/lynx-runtime-internal'; /** * Look up a registered mapper by name. Returns `undefined` if the name * isn't registered — the binding flush treats that as a no-op. */ export declare function lookupMapper(name: string): AnimatedStyleMapper | undefined; /** * Register a custom MT-side mapper. Idempotent on (name, fn) — last * registration wins for the same name. Intended for `'main thread'`-marked * user modules that ship project-specific styling math. */ export declare function registerMapper(name: string, mapper: AnimatedStyleMapper): void; export declare function resetMappers(): void;