import { type IStream } from '../../stream/index.js'; export declare enum PromiseStatus { DONE = 0, PENDING = 1, ERROR = 2 } export type PromiseStateDone = { status: PromiseStatus.DONE; value: T; }; export type PromiseStatePending = { status: PromiseStatus.PENDING; }; export type PromiseStateError = { status: PromiseStatus.ERROR; error: unknown; }; export type PromiseState = PromiseStateDone | PromiseStatePending | PromiseStateError; /** * Lift a stream of promises into a stream of `{ status, value | error }` * snapshots. Latest-wins: if a new promise arrives before the previous one * settles, the older promise's eventual resolution is silently dropped. * * source: -p-q| * p resolves: -----a (stale; identity check drops) * q resolves: --------b * promiseState: -P------D| * where P = { status: PENDING } * D = { status: DONE, value: 'b' } */ export declare const promiseState: (source: IStream>) => IStream>;