/*! * Copyright (c) 2026 Interop Alliance. All rights reserved. */ /** * The shared "memoize an in-flight promise, but only cache a success" helper. * Several lazily-resolved singletons across the client -- a handle's codec, a * backend-feature probe, a lazily-unwrapped epoch key -- want the same three * properties: concurrent callers share one round-trip, a rejection is not * cached (so the next call retries rather than replaying a stale failure), and * a reset drops whatever is held. Written once here so the three cannot drift * apart, which they had. */ /** * A memo of one lazily-resolved value. Holds the in-flight promise so * concurrent callers share a single resolution, drops it on rejection so a * transient failure does not permanently poison the memo, and exposes * {@link Memo.reset} for when the underlying answer is known to have changed. */ export declare class Memo { #private; /** * @param resolve {function} resolves a fresh value; re-invoked after a * rejection or a `reset()`, else called at most once */ constructor(resolve: () => Promise); /** * Whether a resolution is already held -- in flight or settled. Lets a caller * tell, synchronously and before calling {@link Memo.get}, whether its own * call is the one that starts the resolution. * * @returns {boolean} */ get started(): boolean; /** * Returns the memoized value, resolving it on first use. * * @returns {Promise} */ get(): Promise; /** * Drops any memoized value so the next `get()` re-resolves. * * @returns {void} */ reset(): void; } //# sourceMappingURL=memo.d.ts.map