UNPKG

1.16 kBTypeScriptView Raw
1import type { SharedValue } from '../commonTypes';
2import type { DependencyList } from './commonTypes';
3export interface DerivedValue<Value = unknown> extends Readonly<Omit<SharedValue<Value>, 'set'>> {
4 /**
5 * @deprecated Derived values are readonly, don't use this method. It's here
6 * only to prevent breaking changes in TypeScript types. It will be removed
7 * in the future.
8 */
9 set: SharedValue<Value>['set'];
10}
11/**
12 * Lets you create new shared values based on existing ones while keeping them
13 * reactive.
14 *
15 * @param updater - A function called whenever at least one of the shared values
16 * or state used in the function body changes.
17 * @param dependencies - An optional array of dependencies. Only relevant when
18 * using Reanimated without the Babel plugin on the Web.
19 * @returns A new readonly shared value based on a value returned from the
20 * updater function
21 * @see https://docs.swmansion.com/react-native-reanimated/docs/core/useDerivedValue
22 */
23export declare function useDerivedValue<Value>(updater: () => Value, dependencies?: DependencyList): DerivedValue<Value>;
24//# sourceMappingURL=useDerivedValue.d.ts.map
\No newline at end of file