//#region src/matchers/animated.d.ts /** * Reanimated-compatible matchers: `toHaveAnimatedStyle` and `toHaveAnimatedProps`. * * react-native-reanimated ships these matchers via its Jest setup * (`setUpTests()`), so they are unavailable under Vitest by default — calling * `expect(node).toHaveAnimatedStyle(...)` throws `Invalid Chai property`. * * vitest-native's reanimated preset resolves animated hooks synchronously: * `useAnimatedStyle(updater)` returns `updater()` and the result is passed * through as the element's `style` prop (and `animatedProps` is passed through * verbatim). These matchers therefore read straight from the rendered element's * props, flattening style arrays the same way React Native does. */ interface MatcherContext { isNot: boolean; equals: (a: unknown, b: unknown) => boolean; utils: { matcherHint: (name: string, received?: string, expected?: string, options?: unknown) => string; printExpected: (value: unknown) => string; printReceived: (value: unknown) => string; diff?: (a: unknown, b: unknown) => string | null; }; } interface MatcherResult { pass: boolean; message: () => string; } interface AnimatedStyleConfig { /** When true, every key of the current style must match `expectedStyle` exactly. */ shouldMatchAllProps?: boolean; } declare function toHaveAnimatedStyle(this: MatcherContext, received: unknown, expectedStyle: Record, config?: AnimatedStyleConfig): MatcherResult; declare function toHaveAnimatedProps(this: MatcherContext, received: unknown, expectedProps: Record): MatcherResult; /** All reanimated-compatible matchers, keyed by name for `expect.extend`. */ declare const animatedMatchers: { toHaveAnimatedStyle: typeof toHaveAnimatedStyle; toHaveAnimatedProps: typeof toHaveAnimatedProps; }; declare module "vitest" { interface Assertion { toHaveAnimatedStyle(style: Record, config?: AnimatedStyleConfig): T; toHaveAnimatedProps(props: Record): T; } interface AsymmetricMatchersContaining { toHaveAnimatedStyle(style: Record, config?: AnimatedStyleConfig): unknown; toHaveAnimatedProps(props: Record): unknown; } } //#endregion export { AnimatedStyleConfig, animatedMatchers, toHaveAnimatedProps, toHaveAnimatedStyle };