it-stream-types
Advanced tools
Comparing version 1.0.5 to 2.0.0
@@ -7,3 +7,3 @@ /** | ||
export interface Transform<A, B = A> { | ||
(source: Source<A>): Source<B>; | ||
(source: A): B; | ||
} | ||
@@ -15,7 +15,13 @@ /** | ||
*/ | ||
export interface Sink<T, R = Promise<void>> { | ||
(source: Source<T>): R; | ||
export interface Sink<Source, R = Promise<void>> { | ||
(source: Source): R; | ||
} | ||
/** | ||
* A "source" is something that can be consumed. It is an iterable object. | ||
* | ||
* This type is a union of both sync and async sources - it is useful to keep | ||
* code concise but declared types should prefer to specify whether they | ||
* accept sync or async sources since treating a synchronous source as an | ||
* asynchronous one can lead to performance degradation due to artificially | ||
* induced asynchronous behaviour. | ||
*/ | ||
@@ -28,6 +34,6 @@ export type Source<T> = AsyncIterable<T> | Iterable<T>; | ||
*/ | ||
export interface Duplex<TSource, TSink = TSource, RSink = Promise<void>> { | ||
source: Source<TSource>; | ||
export interface Duplex<TSource = unknown, TSink = TSource, RSink = Promise<void>> { | ||
source: TSource; | ||
sink: Sink<TSink, RSink>; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "it-stream-types", | ||
"version": "1.0.5", | ||
"version": "2.0.0", | ||
"description": "Typescript types for AsyncIterable sink/source/duplex streams", | ||
@@ -125,2 +125,3 @@ "author": "Alex Potsides <alex@achingbrain.net>", | ||
"scripts": { | ||
"clean": "aegir clean", | ||
"lint": "aegir lint", | ||
@@ -133,4 +134,4 @@ "dep-check": "aegir dep-check", | ||
"devDependencies": { | ||
"aegir": "^37.7.8" | ||
"aegir": "^38.1.8" | ||
} | ||
} |
@@ -7,3 +7,3 @@ /** | ||
export interface Transform<A, B = A> { | ||
(source: Source<A>): Source<B> | ||
(source: A): B | ||
} | ||
@@ -16,4 +16,4 @@ | ||
*/ | ||
export interface Sink<T, R = Promise<void>> { | ||
(source: Source<T>): R | ||
export interface Sink<Source, R = Promise<void>> { | ||
(source: Source): R | ||
} | ||
@@ -23,2 +23,8 @@ | ||
* A "source" is something that can be consumed. It is an iterable object. | ||
* | ||
* This type is a union of both sync and async sources - it is useful to keep | ||
* code concise but declared types should prefer to specify whether they | ||
* accept sync or async sources since treating a synchronous source as an | ||
* asynchronous one can lead to performance degradation due to artificially | ||
* induced asynchronous behaviour. | ||
*/ | ||
@@ -32,5 +38,5 @@ export type Source<T> = AsyncIterable<T> | Iterable<T> | ||
*/ | ||
export interface Duplex<TSource, TSink = TSource, RSink = Promise<void>> { | ||
source: Source<TSource> | ||
export interface Duplex<TSource = unknown, TSink = TSource, RSink = Promise<void>> { | ||
source: TSource | ||
sink: Sink<TSink, RSink> | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9077
80