UNPKG

966 BTypeScriptView Raw
1import { IIterator } from './iter';
2/**
3 * Create an empty iterator.
4 *
5 * @returns A new iterator which yields nothing.
6 *
7 * #### Example
8 * ```typescript
9 * import { empty, toArray } from '@lumino/algorithm';
10 *
11 * let stream = empty<number>();
12 *
13 * toArray(stream); // []
14 * ```
15 */
16export declare function empty<T>(): IIterator<T>;
17/**
18 * An iterator which is always empty.
19 */
20export declare class EmptyIterator<T> implements IIterator<T> {
21 /**
22 * Get an iterator over the object's values.
23 *
24 * @returns An iterator which yields the object's values.
25 */
26 iter(): IIterator<T>;
27 /**
28 * Create an independent clone of the iterator.
29 *
30 * @returns A new independent clone of the iterator.
31 */
32 clone(): IIterator<T>;
33 /**
34 * Get the next value from the iterator.
35 *
36 * @returns The next value from the iterator, or `undefined`.
37 */
38 next(): T | undefined;
39}
40//# sourceMappingURL=empty.d.ts.map
\No newline at end of file