1 | import { Trie } from "@wry/trie";
|
2 | export { bindContext, noContext, nonReactive, setTimeout, asyncFromGen, } from "./context.js";
|
3 | export { dep, OptimisticDependencyFunction } from "./dep.js";
|
4 | export declare function defaultMakeCacheKey(...args: any[]): object;
|
5 | export { Trie as KeyTrie };
|
6 | export type OptimisticWrapperFunction<TArgs extends any[], TResult, TKeyArgs extends any[] = TArgs, TCacheKey = any> = ((...args: TArgs) => TResult) & {
|
7 | readonly size: number;
|
8 | options: OptimisticWrapOptions<TArgs, TKeyArgs, TCacheKey>;
|
9 | dirty: (...args: TKeyArgs) => void;
|
10 | dirtyKey: (key: TCacheKey) => void;
|
11 | peek: (...args: TKeyArgs) => TResult | undefined;
|
12 | peekKey: (key: TCacheKey) => TResult | undefined;
|
13 | forget: (...args: TKeyArgs) => boolean;
|
14 | forgetKey: (key: TCacheKey) => boolean;
|
15 | getKey: (...args: TArgs) => TCacheKey;
|
16 | makeCacheKey: (...args: TKeyArgs) => TCacheKey;
|
17 | };
|
18 | export type OptimisticWrapOptions<TArgs extends any[], TKeyArgs extends any[] = TArgs, TCacheKey = any> = {
|
19 | max?: number;
|
20 | keyArgs?: (...args: TArgs) => TKeyArgs;
|
21 | makeCacheKey?: (...args: TKeyArgs) => TCacheKey;
|
22 | subscribe?: (...args: TArgs) => void | (() => any);
|
23 | };
|
24 | export declare function wrap<TArgs extends any[], TResult, TKeyArgs extends any[] = TArgs, TCacheKey = any>(originalFunction: (...args: TArgs) => TResult, { max, makeCacheKey, keyArgs, subscribe, }?: OptimisticWrapOptions<TArgs, TKeyArgs>): OptimisticWrapperFunction<TArgs, TResult, TKeyArgs, TCacheKey>;
|
25 |
|
\ | No newline at end of file |