import type { CoID, RawCoValue } from "../coValue.js";
import type { AvailableCoValueCore } from "../coValueCore/coValueCore.js";
import type { RawCoID } from "../ids.js";
import type { JsonObject } from "../jsonValue.js";
import type { RawGroup } from "./group.js";
import { CoValueFrontier } from "../knownState.js";
export type BinaryStreamInfo = {
mimeType: string;
fileName?: string;
totalSizeBytes?: number;
};
export type BinaryStreamStart = {
type: "start";
} & BinaryStreamInfo;
export type BinaryStreamChunk = {
type: "chunk";
chunk: `binary_U${string}`;
};
export type BinaryStreamEnd = {
type: "end";
};
export type BinaryCoStreamMeta = JsonObject & {
type: "binary";
};
export type BinaryStreamItem = BinaryStreamStart | BinaryStreamChunk | BinaryStreamEnd;
export declare class RawBinaryCoStreamView implements RawCoValue {
id: CoID;
type: "costream";
core: AvailableCoValueCore;
knownTransactions: Record;
totalValidTransactions: number;
version: number;
private chunks;
private start;
private ended;
/** @internal */
atFrontierFilter?: CoValueFrontier;
private resetInternalState;
constructor(core: AvailableCoValueCore, options?: {
atFrontierFilter?: CoValueFrontier;
});
rebuildFromCore(): void;
get headerMeta(): Meta;
get group(): RawGroup;
/** Not yet implemented */
atTime(_time: number): this;
atFrontier(frontier: CoValueFrontier): this;
isTimeTravelEntity(): boolean;
processNewTransactions(): void;
isBinaryStreamEnded(): boolean;
getBinaryStreamInfo(): BinaryStreamInfo | undefined;
getBinaryChunks(allowUnfinished?: boolean): (BinaryStreamInfo & {
chunks: Uint8Array[];
finished: boolean;
}) | undefined;
toJSON(): {};
subscribe(listener: (coStream: this) => void): () => void;
}
export declare class RawBinaryCoStream extends RawBinaryCoStreamView implements RawCoValue {
atFrontier(frontier: CoValueFrontier): this;
/** @internal */
push(item: BinaryStreamItem, privacy?: "private" | "trusting", updateView?: boolean): void;
startBinaryStream(settings: BinaryStreamInfo, privacy?: "private" | "trusting"): void;
pushBinaryStreamChunk(chunk: Uint8Array, privacy?: "private" | "trusting"): void;
endBinaryStream(privacy?: "private" | "trusting"): void;
}
//# sourceMappingURL=binaryCoStream.d.ts.map