import { ProtocolState } from '@midnightntwrk/wallet-sdk-abstractions'; import { Chunk, Equivalence } from 'effect'; import { type Observable, type OperatorFunction } from 'rxjs'; /** * Utility function that takes state values from an RxJS observable until it completes or errors. * * @param observable The RxJS observable from which state values should be read. * @param onErrCallback An optional callback to invoke if an error is encountered reading a state value. * @returns A `Promise` that resolves with an array of state values that were received before encountering any error. * @internal */ export declare const toProtocolStateArray: (observable: Observable>, onErrCallback?: (err: unknown) => void) => Promise[]>; export declare const reduceToChunk: () => OperatorFunction>; /** * Checks whether `received` is an ordered subsequence of `expected` — every received element appears in `expected` in * the same relative order, though elements of `expected` may be skipped. * * This matches the runtime's latest-value state stream contract: a subscriber always converges on the latest state, but * may skip intermediate states when it lags behind the producer. Received states must therefore never be reordered, * fabricated, or repeated out of order — but any prefix of intermediate states may be missing. * * @internal */ export declare const isOrderedSubsequenceOf: (received: readonly T[], expected: readonly T[], equals: Equivalence.Equivalence) => boolean; /** * Equality of {@link ProtocolState.ProtocolState} values over primitive states, for use with * {@link isOrderedSubsequenceOf}. * * @internal */ export declare const protocolStateEquals: Equivalence.Equivalence>; export declare const isRange: (values: Chunk.Chunk) => boolean;