import type { BoundedAsyncStream } from '../backend-contract/streams.js'; import type { CleanupRecord } from './cleanup.js'; import type { PortableBoundedAsyncStream } from '../manager/consumer-handles.js'; export type PublicStreamOverflowPolicy = 'latest' | 'drop-oldest' | 'drop-newest' | 'error'; export type PublicStreamTerminalReason = 'closed' | 'overflow' | 'source-failed' | 'owner-released' | 'connection-lost' | 'service-changed' | 'operation-aborted' | 'operation-timed-out'; export interface PublicStreamLimits { readonly itemCapacity: number; readonly byteCapacity: number; readonly reservedControlCapacity: number; } export interface PublicStreamOverflowNotice { readonly kind: 'overflow'; readonly policy: PublicStreamOverflowPolicy; readonly droppedItems: number; readonly droppedBytes: number; readonly replacedItems: number; } export interface PublicStreamTerminalNotice { readonly kind: 'terminal'; readonly reason: PublicStreamTerminalReason; readonly droppedItems: number; readonly droppedBytes: number; readonly replacedItems: number; readonly error?: import('./cleanup.js').NormalizedBleError | null; } export interface PublicStreamValue { readonly kind: 'value'; readonly value: Value; } export type PublicStreamItem = PublicStreamValue | PublicStreamOverflowNotice | PublicStreamTerminalNotice; export interface PublicBoundedAsyncStreamIterator extends AsyncIterator, undefined, undefined> { readonly return: () => Promise, undefined>>; [Symbol.asyncIterator](): PublicBoundedAsyncStreamIterator; } export interface PublicBoundedAsyncStream extends AsyncIterable, undefined, undefined> { readonly limits: PublicStreamLimits; readonly overflowPolicy: PublicStreamOverflowPolicy; [Symbol.asyncIterator](): PublicBoundedAsyncStreamIterator; close(): Promise; } type PublicStreamSource = BoundedAsyncStream | PortableBoundedAsyncStream; /** Projects backend stream controls and values into the host-neutral public contract. */ export declare function mapPublicBoundedAsyncStream(source: PublicStreamSource, mapValue: (value: InternalValue) => PublicValue): PublicBoundedAsyncStream; export {}; //# sourceMappingURL=streams.d.ts.map