mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
adding Stream class with static factory methods
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
// <reference file="streamjs.d.ts" />
|
||||
|
||||
var numStream = Stream.make(10, 20);
|
||||
numStream = Stream.make([10, 20]);
|
||||
numStream = Stream.range(1, 5);
|
||||
numStream = Stream.rangeClosed(1, 5);
|
||||
|
||||
Stream.generate(function() {
|
||||
return 1;
|
||||
});
|
||||
Stream.generate(() => 1);
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for streamjs 1.4.0
|
||||
// Project: http://streamjs.org/
|
||||
// Definitions by: Bence Eros <https://github.com/erosb>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare class Stream<T> {
|
||||
static make<T> (...elems: T[]): Stream<T>;
|
||||
static make<T>(elems: T[]): Stream<T>;
|
||||
static range<T>(startInclusive: number, endExclusive: number): Stream<T>;
|
||||
static rangeClosed<T>(startInclusive: number, endInclusive: number): Stream<T>;
|
||||
static generate<T>(supplier: () => T): Stream<T>;
|
||||
}
|
||||
Reference in New Issue
Block a user