@stardazed/streams
Advanced tools
Comparing version 1.0.7 to 2.0.0
# @stardazed/streams changelog | ||
## 2.0.0 | ||
_2018-10-15_ | ||
* BREAKING: the TypeScript interfaces to the streams and associated types are now parameterized by the incoming/outgoing chunk types. | ||
This is both a breaking change from earlier versions and also from the TS built-in types. | ||
* No functional changes, the code is equal to that of 1.0.7. | ||
## 1.0.7 | ||
@@ -34,3 +40,3 @@ _2018-10-01_ | ||
* Now passes all current web platform tests for streams. | ||
* Fully compliant save for the detached buffers bit, because reality is cold like winter. | ||
* Fully compliant save for the detached buffers bit, because reality is cold like Irithyll. | ||
@@ -37,0 +43,0 @@ ## 1.0.0 |
@@ -21,7 +21,7 @@ /** | ||
export interface WritableStreamDefaultWriter { | ||
export interface WritableStreamDefaultWriter<InputType> { | ||
abort(reason: any): Promise<void>; | ||
close(): Promise<void>; | ||
releaseLock(): void; | ||
write(chunk: any): Promise<void>; | ||
write(chunk: InputType): Promise<void>; | ||
@@ -33,5 +33,5 @@ readonly closed: Promise<void>; | ||
export interface WritableStreamSink { | ||
export interface WritableStreamSink<InputType> { | ||
start?(controller: WritableStreamDefaultController): void | Promise<void>; | ||
write?(chunk: any, controller: WritableStreamDefaultController): void | Promise<void>; | ||
write?(chunk: InputType, controller: WritableStreamDefaultController): void | Promise<void>; | ||
close?(): void | Promise<void>; | ||
@@ -43,6 +43,6 @@ abort?(reason?: any): void; | ||
export declare class WritableStream { | ||
constructor(underlyingSink?: WritableStreamSink, strategy?: StreamStrategy); | ||
export declare class WritableStream<InputType> { | ||
constructor(underlyingSink?: WritableStreamSink<InputType>, strategy?: StreamStrategy); | ||
abort(reason?: any): Promise<void>; | ||
getWriter(): WritableStreamDefaultWriter; | ||
getWriter(): WritableStreamDefaultWriter<InputType>; | ||
@@ -60,8 +60,8 @@ readonly locked: boolean; | ||
export interface ReadableStreamDefaultController extends ReadableStreamController { | ||
enqueue(chunk: any): void; | ||
export interface ReadableStreamDefaultController<OutputType> extends ReadableStreamController { | ||
enqueue(chunk: OutputType): void; | ||
} | ||
export interface ReadableByteStreamController extends ReadableStreamController { | ||
enqueue(chunk: any): void; | ||
enqueue(chunk: ArrayBufferView): void; | ||
readonly byobRequest: ReadableStreamBYOBRequest | undefined; | ||
@@ -82,4 +82,4 @@ } | ||
export interface ReadableStreamDefaultReader extends ReadableStreamReader { | ||
read(): Promise<IteratorResult<any>>; | ||
export interface ReadableStreamDefaultReader<OutputType> extends ReadableStreamReader { | ||
read(): Promise<IteratorResult<OutputType>>; | ||
} | ||
@@ -91,3 +91,3 @@ | ||
interface ReadableStreamSource<Controller extends ReadableStreamController = ReadableStreamDefaultController> { | ||
interface ReadableStreamSource<OutputType, Controller extends ReadableStreamController = ReadableStreamDefaultController<OutputType>> { | ||
start?(controller: Controller): void | Promise<void>; | ||
@@ -106,17 +106,17 @@ pull?(controller: Controller): void | Promise<void>; | ||
export interface StreamTransform { | ||
readable: ReadableStream; | ||
writable: WritableStream; | ||
export interface StreamTransform<InputType, OutputType> { | ||
readable: ReadableStream<OutputType>; | ||
writable: WritableStream<InputType>; | ||
} | ||
export declare class ReadableStream { | ||
constructor(source?: ReadableStreamSource, strategy?: StreamStrategy); | ||
export declare class ReadableStream<OutputType> { | ||
constructor(source?: ReadableStreamSource<OutputType>, strategy?: StreamStrategy); | ||
cancel(reason?: any): Promise<void>; | ||
getReader(): ReadableStreamDefaultReader; | ||
getReader(): ReadableStreamDefaultReader<OutputType>; | ||
getReader(options: { mode: "byob" }): ReadableStreamBYOBReader; | ||
tee(): ReadableStream[]; | ||
tee(): ReadableStream<OutputType>[]; | ||
pipeThrough(transform: StreamTransform, options?: PipeToOptions): ReadableStream; | ||
pipeTo(dest: WritableStream, options?: PipeToOptions): Promise<void>; | ||
pipeThrough<ResultType>(transform: StreamTransform<OutputType, ResultType>, options?: PipeToOptions): ReadableStream<ResultType>; | ||
pipeTo(dest: WritableStream<OutputType>, options?: PipeToOptions): Promise<void>; | ||
@@ -128,4 +128,4 @@ readonly locked: boolean; | ||
export interface TransformStreamDefaultController { | ||
enqueue(chunk: any): void; | ||
export interface TransformStreamDefaultController<OutputType> { | ||
enqueue(chunk: OutputType): void; | ||
error(reason: any): void; | ||
@@ -137,6 +137,6 @@ terminate(): void; | ||
export interface Transformer { | ||
start?(controller: TransformStreamDefaultController): void | Promise<void>; | ||
transform?(chunk: any, controller: TransformStreamDefaultController): void | Promise<void>; | ||
flush?(controller: TransformStreamDefaultController): void | Promise<void>; | ||
export interface Transformer<InputType, OutputType> { | ||
start?(controller: TransformStreamDefaultController<OutputType>): void | Promise<void>; | ||
transform?(chunk: InputType, controller: TransformStreamDefaultController<OutputType>): void | Promise<void>; | ||
flush?(controller: TransformStreamDefaultController<OutputType>): void | Promise<void>; | ||
@@ -147,7 +147,7 @@ readableType?: undefined; // for future spec changes | ||
export declare class TransformStream { | ||
constructor(transformer?: Transformer, writableStrategy?: StreamStrategy, readableStrategy?: StreamStrategy); | ||
export declare class TransformStream<InputType, OutputType> { | ||
constructor(transformer?: Transformer<InputType, OutputType>, writableStrategy?: StreamStrategy, readableStrategy?: StreamStrategy); | ||
readonly readable: ReadableStream; | ||
readonly writable: WritableStream; | ||
readonly readable: ReadableStream<OutputType>; | ||
readonly writable: WritableStream<InputType>; | ||
} | ||
@@ -177,2 +177,2 @@ | ||
*/ | ||
export function internal_readableStreamTee(stream: ReadableStream, cloneForBranch2: boolean): ReadableStream[]; | ||
export function internal_readableStreamTee<T>(stream: ReadableStream<T>, cloneForBranch2: boolean): ReadableStream<T>[]; |
{ | ||
"name": "@stardazed/streams", | ||
"description": "Web Streams implementation", | ||
"version": "1.0.7", | ||
"version": "2.0.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Arthur Langereis" |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
211129