type Updater = (current: T) => T; type StateArg = T | Updater; interface Setter { (state: State, val: StateArg): void; (command: Command, ...args: Args): T; } type Getter = (readable: Signal) => T; interface GetterOptions { signal: AbortSignal; } type Read = (get: Getter, options: GetterOptions) => T; type Write = (visitor: { get: Getter; set: Setter; }, ...args: Args) => T; type Watch = Read; interface State { id: number; init: T; debugLabel?: string; toString: () => string; } interface Computed { id: number; read: Read; debugLabel?: string; toString: () => string; } interface Command { id: number; write: Write; debugLabel?: string; toString: () => string; } type Signal = State | Computed; interface Options { debugLabel?: string; } declare function state(init: T, options?: Options): State; declare function computed(read: Read, options?: Options): Computed; declare function command(write: Write, options?: Options): Command; interface Store { get: Getter; set: Setter; watch: Watcher; } interface WatchOptions { signal?: AbortSignal; debugLabel?: string; } type Watcher = (watch: Watch, options?: WatchOptions) => void; type SetArgs = [StateArg] | CommandArgs; declare function createStore(): Store; export { type Command, type Computed, type Getter, type Read, type SetArgs, type Setter, type State, type StateArg, type Store, type Updater, type Watch as Watcher, type Write, command, computed, createStore, state }; //# sourceMappingURL=index.d.ts.map