import { AsyncSeq, AsyncSeqConverter } from '../../AsyncSeq'; /** * Converts the current sequence to SharedAsyncSeq and returns it; * in a SharedAsyncSeq, `async iterator` is share until `close` method is called. * * ```typescript * const shared = fromAsAsync([1, 2]).to(shareAsync()); * * for await (const one of shared) { * console.log(one); * break; * } * //console: 1 * * for await (const one of shared) { * console.log(one); * break; * } * //console: 2 * * for await (const one of shared) { * console.log(one); * break; * } * //console: no output * * shared.close(); * * for await (const one of shared) { * console.log(one); * } * //console: 1 * //console: 2 * * ``` * * :::caution * Care should be taken when using with [finalizeAsync](/api/operators/#finalizeasync). See [share](/api/to/#share) for details. * ::: * * * @typeParam T Source element type. * @returns SharedAsyncSeq * @category Async To */ export declare const shareAsync: () => AsyncSeqConverter>; declare class SharedAsyncSeq extends AsyncSeq { #private; [Symbol.asyncIterator](): AsyncIterator; close(): void; } export {};