import { type Readable } from 'svelte/store'; type Stores = Readable | [Readable, ...Array>] | Array>; type StoresValues = T extends Readable ? U : { [K in keyof T]: T[K] extends Readable ? U : never; }; type MaybePromise = T | Promise; type CleanupFn = () => MaybePromise; type CallbackFn = (values: T) => MaybePromise; /** * @deprecated Use `observe`/`observe.pre` from `@threlte/core` instead for mixed store and runes usage, * or $effect/$effect.pre when working entirely with runes. * * Watch a single store or multiple stores and call a callback when they change to trigger side effects. * The callback can return a cleanup function that will be called when the stores change again or when the component is destroyed. * * ```ts * const store = writable(0) * * watch(store, (value) => { * console.log(value) // 0 * }) * ``` * * You can also watch multiple stores: * * ```ts * const store1 = writable(0) * const store2 = writable(1) * * watch([store1, store2], ([value1, value2]) => { * console.log(value1, value2) // 0 1 * }) * ``` * * The callback can return a cleanup function that will be called when the stores change again or when the component is destroyed. * * ```ts * const store = writable(0) * * watch(store, (value) => { * console.log(value) // 0 * return () => { * console.log('cleanup') * } * }) * ``` * * @param stores * @param callback * */ export declare const watch: (stores: S, callback: CallbackFn>) => void; export {};