@stardazed/streams
Advanced tools
Comparing version 1.0.0 to 1.0.1
/** | ||
* @stardazed/streams - implementation of the web streams standard | ||
* Part of Stardazed | ||
* (c) 2018 by Arthur Langereis - @zenmumbler | ||
* https://github.com/stardazed/sd-streams | ||
*/ | ||
* @stardazed/streams - implementation of the web streams standard | ||
* Part of Stardazed | ||
* (c) 2018 by Arthur Langereis - @zenmumbler | ||
* https://github.com/stardazed/sd-streams | ||
*/ | ||
@@ -52,5 +52,5 @@ // ---- Common | ||
export interface ReadableStreamController { | ||
readonly desiredSize: number | null; | ||
close(): void; | ||
error(e?: any): void; | ||
readonly desiredSize: number | null; | ||
} | ||
@@ -68,11 +68,11 @@ | ||
export interface ReadableStreamBYOBRequest { | ||
readonly view: ArrayBufferView; | ||
respond(bytesWritten: number): void; | ||
respondWithNewView(view: ArrayBufferView): void; | ||
readonly view: ArrayBufferView; | ||
} | ||
export interface ReadableStreamReader { | ||
readonly closed: Promise<void>; | ||
cancel(reason: any): Promise<void>; | ||
releaseLock(): void; | ||
readonly closed: Promise<void>; | ||
} | ||
@@ -89,7 +89,7 @@ | ||
interface ReadableStreamSource<Controller extends ReadableStreamController = ReadableStreamDefaultController> { | ||
type?: "bytes" | undefined; | ||
autoAllocateChunkSize?: number; // only for "bytes" type sources | ||
start?(controller: Controller): void | Promise<void>; | ||
pull?(controller: Controller): void | Promise<void>; | ||
cancel?(reason?: any): void; | ||
type?: "bytes" | undefined; | ||
autoAllocateChunkSize?: number; // only for "bytes" type sources | ||
} | ||
@@ -96,0 +96,0 @@ |
{ | ||
"name": "@stardazed/streams", | ||
"description": "Web Streams implementation / polyfill", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Arthur Langereis" |
@@ -10,6 +10,17 @@ sd-streams | ||
### Compliance | ||
This implementation passes all tests (as specified by late June 2018) in the | ||
[web platform tests](https://github.com/web-platform-tests/wpt/tree/master/streams) | ||
except for the detached buffer tests as explained below. | ||
While this is nice, a number of tests in the suite are aimed mainly at browser engine | ||
internals or ordering of instructions strictly to the letter of the spec. | ||
This implementation may at any point deviate from certain spec tests for legibility or | ||
optimization purposes, but only if it's deemed worthwhile. (Actual browser implementations | ||
already do this as well.) | ||
### Limitations | ||
While the full streams API is implemented, because it is written as a client library | ||
it cannot directly be used with other built-in APIs, such as calling `getReader` on the | ||
`body` of a `fetch` call, that may either not be implemented at all or return a browser | ||
While the full streams API is implemented, this library's code lives in the client space | ||
and cannot directly be used with other built-in APIs. This includes calling `getReader` on | ||
the `body` of a `fetch` call, which may either not be implemented at all or return a browser | ||
internal `ReadableStream`. Due to implementation details of streams, you cannot mix and | ||
@@ -16,0 +27,0 @@ match the types in this implementation with those provided by the browser. |
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
95484
2330
53