@rimbu/stream
Version:
Efficient structure representing a sequence of elements, with powerful operations for TypeScript
26 lines (23 loc) • 606 B
text/typescript
import type { Stream } from '@rimbu/stream';
/**
* An object that can create a Stream of elements of type `T`.
* @typeparam T - the element type
*/
export interface Streamable<T> {
/**
* Returns a `Stream` containing the elements in this collection.
*/
stream(): Stream<T>;
}
export namespace Streamable {
/**
* An object that can create a non-empty Stream of elements of type `T`.
* @typeparam T - the element type
*/
export interface NonEmpty<T> {
/**
* Returns a non-empty `Stream` of the elements in this collection.
*/
stream(): Stream.NonEmpty<T>;
}
}