1 | export declare type UpdateFn<S> = (state: S) => S;
|
2 | export declare type Subscriber<S> = (state: S) => void;
|
3 | export declare type Cb<S> = (newV: S, oldV: S, source?: unknown) => void;
|
4 | export declare type Unsubscribe = () => void;
|
5 | export interface ITangleContext<S> {
|
6 | stateOf(key: KeyOf<S>): S[KeyOf<S>];
|
7 | subscribe(key: KeyOf<S>, cb: Cb<S[KeyOf<S>]>): Unsubscribe;
|
8 | |
9 |
|
10 |
|
11 |
|
12 |
|
13 | update<C = unknown>(key: KeyOf<S>, newV: S[KeyOf<S>], caller?: C): void;
|
14 | }
|
15 | export declare type KeyOf<S> = keyof S;
|