UNPKG

1.41 kBTypeScriptView Raw
1import { IterableX } from './iterablex';
2/**
3 * Converts an existing string into an iterable of characters.
4 *
5 * @export
6 * @param {string} source The string to convert to an iterable.
7 * @returns {IterableX<string>} An terable stream of characters from the source.
8 */
9export declare function as(source: string): IterableX<string>;
10/**
11 * Converts the iterable like input into an iterable.
12 *
13 * @export
14 * @template T The tyep of elements in the source iterable.
15 * @param {Iterable<T>} source The iterable to convert to an iterable.
16 * @returns {IterableX<T>} An iterable stream of the source sequence.
17 */
18export declare function as<T>(source: Iterable<T>): IterableX<T>;
19/**
20 * Converts an array-like object to an iterable.
21 *
22 * @export
23 * @template T The type of elements in the source array-like sequence.
24 * @param {ArrayLike<T>} source The array-like sequence to convert to an iterable.
25 * @returns {IterableX<T>} The iterable containing the elements from the array-like sequence.
26 */
27export declare function as<T>(source: ArrayLike<T>): IterableX<T>;
28/**
29 * Converts the object into a singleton in an iterable sequence.
30 *
31 * @export
32 * @template T The type of element to turn into an iterable sequence.
33 * @param {T} source The item to turn into an iterable sequence.
34 * @returns {IterableX<T>} An iterable sequence from the source object.
35 */
36export declare function as<T>(source: T): IterableX<T>;