import type { PureEvent, PureEventFun, PureEventListenOptions, PureEventOff } from "@gaubee/util";
import { SharedFlow } from "./shared_flow.js";
export type StateFlowListenOptions = PureEventListenOptions & {
    /** 监听的时候，是否立即执行 */
    immediate?: boolean;
};
/**
 * 带状态机的 SharedFlow
 */
export declare class StateFlow<T> extends SharedFlow<T> {
    #private;
    constructor(initialValue: T, by?: PureEvent<T>);
    get value(): T;
    set value(value: T);
    /**
     * 附加监听
     * 同 watch
     * @deprecated 使用 watch
     */
    on(cb: PureEventFun<T>, options?: StateFlowListenOptions): PureEventOff;
    /**
     * 附加监听
     * 可以自定义唯一索引 key，如果重复，会移除之前的监听
     */
    watch(cb: PureEventFun<T>, options?: StateFlowListenOptions): PureEventOff;
    watchImmediate(cb: PureEventFun<T>, options?: PureEventListenOptions): PureEventOff;
    emit(value: T): Promise<void>;
}
export declare const stateFlow: <T>(initialValue: T, by?: any) => StateFlow<T>;
//# sourceMappingURL=state_flow.d.ts.map