import { MotiPressableContext } from './context'; import type { MotiPressableInteractionProp } from './types'; type Factory = (containers: MotiPressableContext['containers']) => ReturnType; /** * `useMotiPressables` lets you access the interaction state of *all* parent `MotiPressable` components. * * This offers more complex use-cases over `useMotiPressable`, which only lets you access the interaction state of a single parent `MotiPressable` at a time. * * Say you have a parent pressable, with a list of items: * * ```tsx * * {items.map(({ id }) => ( * * * * )} * * ``` * * Then, in your component, you can access each unique `MotiPressable`'s interaction state: * * ```tsx * const Item = ({ id }) => { * const state = useMotiPressables((containers) => { * 'worklet' * * const list = containers.list.value * const item = containers.['item-' + id].value * * // when hovering a list, * // fade out all items except the one actually hovered * * let opacity = 1 * if (item.hovered || item.pressed) { * opacity = 1 * } else if (list.hovered) { * opacity = 0.7 * } * * return { * opacity, * } * }) * * return * } * ``` * * Example shown [here](https://twitter.com/FernandoTheRojo/status/1430717474778066944) * * */ export declare function useMotiPressables( /** * Function that receives the interaction state from all parent containers and returns a style object/ * @worklet */ factory: Factory, deps?: readonly any[]): { __state: Readonly>>; }; export {}; //# sourceMappingURL=use-pressables.d.ts.map