This commit is contained in:
eewing
2026-02-17 14:10:16 -06:00
parent 2bca5834c5
commit cf73cd3b4c
11246 changed files with 1690552 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import type { Getter } from "../../internal/types.js";
export type WatchOptions = {
/**
* If `true`, the effect doesn't run until one of the `sources` changes.
*
* @default false
*/
lazy?: boolean;
};
export declare function watch<T extends Array<unknown>>(sources: {
[K in keyof T]: Getter<T[K]>;
}, effect: (values: T, previousValues: {
[K in keyof T]: T[K] | undefined;
}) => void | VoidFunction, options?: WatchOptions): void;
export declare function watch<T>(source: Getter<T>, effect: (value: T, previousValue: T | undefined) => void | VoidFunction, options?: WatchOptions): void;
export declare namespace watch {
var pre: typeof watchPre;
}
declare function watchPre<T extends Array<unknown>>(sources: {
[K in keyof T]: Getter<T[K]>;
}, effect: (values: T, previousValues: {
[K in keyof T]: T[K] | undefined;
}) => void | VoidFunction, options?: WatchOptions): void;
declare function watchPre<T>(source: Getter<T>, effect: (value: T, previousValue: T | undefined) => void | VoidFunction, options?: WatchOptions): void;
export declare function watchOnce<T extends Array<unknown>>(sources: {
[K in keyof T]: Getter<T[K]>;
}, effect: (values: T, previousValues: T) => void | VoidFunction): void;
export declare function watchOnce<T>(source: Getter<T>, effect: (value: T, previousValue: T) => void | VoidFunction): void;
export declare namespace watchOnce {
var pre: typeof watchOncePre;
}
declare function watchOncePre<T extends Array<unknown>>(sources: {
[K in keyof T]: Getter<T[K]>;
}, effect: (values: T, previousValues: T) => void | VoidFunction): void;
declare function watchOncePre<T>(source: Getter<T>, effect: (value: T, previousValue: T) => void | VoidFunction): void;
export {};