import { Source, Sink, START, DATA, END, Callbag } from 'callbag'; export declare type ChangeTraceLeaf = { from: T | undefined; to: T | undefined; }; export declare type ChangeTraceNode = { subs: (T extends Array ? { [index: number]: ChangeTrace; } : Partial<{ [K in keyof T]: ChangeTrace; }>) | {}; }; export declare type ChangeTrace = ChangeTraceLeaf | ChangeTraceNode; export interface Change { value: T | undefined; trace?: ChangeTrace | undefined; } export declare function isLeaf(c: ChangeTrace | undefined): c is ChangeTraceLeaf | undefined; export declare type Downstream = Source>; export declare type Upstream = Sink>; export declare type MsgType = START | DATA | END; export declare type StateMsgType = MsgType | typeof _Latest | typeof _Downstream | typeof _Upstream; export declare type StateLike = Callbag & { get(): T | undefined; set(t: T): void; clear(): void; sub(key: K): SubState; downstream(): Downstream; upstream(): Upstream; }; export declare type SubState = StateLike; export declare type State = Callbag & { get(): T; set(t: T): void; clear(): void; sub(key: K): SubState; downstream(): Downstream; upstream(): Upstream; }; export declare function isState(cb: Source): cb is State; export declare const _Start = 0; export declare const _Data = 1; export declare const _End = 2; export declare const _Latest = 100; export declare const _Downstream = 101; export declare const _Upstream = 102;