import type { ContextWithState } from '../../../Types';
import type { Transient } from '../../utils/StateUtils';
export declare class DataStreamClosedError extends Error {
    name: string;
    constructor();
}
export declare class DataStreamClearedError extends Error {
    name: string;
    constructor();
}
interface DataStream<T> {
    closed: boolean;
    error: Error | undefined;
    data: T[];
    cleared: Transient<void>;
    [Symbol.asyncIterator]: () => AsyncIterator<T>;
}
export type DataStreamAtom<T> = ReturnType<typeof createDataStreamAtom<T>>;
type ExtendedContext = ContextWithState;
export declare function createDataStreamAtom<T>(context: ExtendedContext): import("../Types").StateAtom<DataStream<T>, {
    push: (d: DataStream<T>, ...v: T[]) => boolean;
    close: (dataStream: DataStream<unknown>) => boolean;
    open: (dataStream: DataStream<unknown>) => boolean;
    clear: (dataStream: DataStream<unknown>) => boolean;
    throw: (dataStream: DataStream<unknown>, error: Error) => boolean;
}>;
export {};
