import { AsyncState, PromiseState } from './types'; /** * Chain a callback on AsyncState or PromiseState, similar to Promise.then(). * * Note: Named `chain` instead of `then` to avoid making `async` look like a * PromiseLike (objects with a `then` method are treated as thenables). * * - Success/Fulfilled: calls fn with data via promiseTry (ensures async) * - Pending with source promise: chains .then(fn) on the promise * - Stale mode: uses stale data if available (even in idle/pending/error) * - Otherwise: rejects with AsyncNotReadyError or the state's error * * @example * // Chain on success state * async.chain(userState, user => user.name); * * // Chain on pending state (waits for resolution) * async.chain(loadingState, data => transform(data)); * * // Chain on stale mode (uses cached data) * async.chain(staleState, data => data); // Returns even if pending */ export declare function chain(state: AsyncState | PromiseState, fn: (data: T) => R): Promise; //# sourceMappingURL=then.d.ts.map