UNPKG

689 BTypeScriptView Raw
1import { AnyEntry } from "./entry.js";
2import { OptimisticWrapOptions } from "./index.js";
3import { Unsubscribable } from "./helpers.js";
4type EntryMethodName = keyof typeof EntryMethods;
5declare const EntryMethods: {
6 setDirty: boolean;
7 dispose: boolean;
8 forget: boolean;
9};
10export type OptimisticDependencyFunction<TKey> = ((key: TKey) => void) & {
11 dirty: (key: TKey, entryMethodName?: EntryMethodName) => void;
12};
13export type Dep<TKey> = Set<AnyEntry> & {
14 subscribe: OptimisticWrapOptions<[TKey]>["subscribe"];
15} & Unsubscribable;
16export declare function dep<TKey>(options?: {
17 subscribe: Dep<TKey>["subscribe"];
18}): OptimisticDependencyFunction<TKey>;
19export {};