Comparing version 3.3.4 to 3.3.5
122
index.d.ts
@@ -5,35 +5,67 @@ /// <reference types="node" /> | ||
export type Encoding = BufferEncoding | 'buffer' | null | ||
declare namespace Minipass { | ||
type Encoding = BufferEncoding | 'buffer' | null | ||
interface Writable extends EventEmitter { | ||
end(): any | ||
write(chunk: any, ...args: any[]): any | ||
} | ||
interface Writable extends EventEmitter { | ||
end(): any | ||
write(chunk: any, ...args: any[]): any | ||
} | ||
interface Readable extends EventEmitter { | ||
pause(): any | ||
resume(): any | ||
pipe(): any | ||
} | ||
interface Readable extends EventEmitter { | ||
pause(): any | ||
resume(): any | ||
pipe(): any | ||
} | ||
interface Pipe<R, W> { | ||
src: Minipass<R, W> | ||
dest: Writable | ||
opts: PipeOptions | ||
} | ||
interface Pipe<R, W> { | ||
src: Minipass<R, W> | ||
dest: Writable | ||
opts: PipeOptions | ||
} | ||
type DualIterable<T> = Iterable<T> & AsyncIterable<T> | ||
type DualIterable<T> = Iterable<T> & AsyncIterable<T> | ||
type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string | ||
type ContiguousData = Buffer | ArrayBufferLike | ArrayBufferView | string | ||
type BufferOrString = Buffer | string | ||
type BufferOrString = Buffer | string | ||
export default class Minipass< | ||
interface StringOptions { | ||
encoding: BufferEncoding | ||
objectMode?: boolean | ||
async?: boolean | ||
} | ||
interface BufferOptions { | ||
encoding?: null | 'buffer' | ||
objectMode?: boolean | ||
async?: boolean | ||
} | ||
interface ObjectModeOptions { | ||
objectMode: true | ||
async?: boolean | ||
} | ||
interface PipeOptions { | ||
end?: boolean | ||
proxyErrors?: boolean | ||
} | ||
type Options<T> = T extends string | ||
? StringOptions | ||
: T extends Buffer | ||
? BufferOptions | ||
: ObjectModeOptions | ||
} | ||
declare class Minipass< | ||
RType extends any = Buffer, | ||
WType extends any = RType extends BufferOrString ? ContiguousData : RType | ||
WType extends any = RType extends Minipass.BufferOrString | ||
? Minipass.ContiguousData | ||
: RType | ||
> | ||
extends Stream | ||
implements DualIterable<RType> | ||
implements Minipass.DualIterable<RType> | ||
{ | ||
static isStream(stream: any): stream is Readable | Writable | ||
static isStream(stream: any): stream is Minipass.Readable | Minipass.Writable | ||
@@ -52,3 +84,3 @@ readonly bufferLength: number | ||
private readonly buffer: RType[] | ||
private readonly pipes: Pipe<RType, WType>[] | ||
private readonly pipes: Minipass.Pipe<RType, WType>[] | ||
@@ -75,3 +107,3 @@ /** | ||
*/ | ||
readonly encoding: Encoding | ||
readonly encoding: Minipass.Encoding | ||
// setEncoding(encoding: Encoding): void | ||
@@ -82,12 +114,12 @@ | ||
...args: RType extends Buffer | ||
? [] | [Options<RType>] | ||
: [Options<RType>] | ||
? [] | [options: Minipass.Options<RType>] | ||
: [options: Minipass.Options<RType>] | ||
) | ||
write(chunk: WType, cb?: () => void): boolean | ||
write(chunk: WType, encoding?: Encoding, cb?: () => void): boolean | ||
write(chunk: WType, encoding?: Minipass.Encoding, cb?: () => void): boolean | ||
read(size?: number): RType | ||
end(cb?: () => void): this | ||
end(chunk: any, cb?: () => void): this | ||
end(chunk: any, encoding?: Encoding, cb?: () => void): this | ||
end(chunk: any, encoding?: Minipass.Encoding, cb?: () => void): this | ||
pause(): void | ||
@@ -98,6 +130,6 @@ resume(): void | ||
concat(): RType extends BufferOrString ? Promise<RType> : never | ||
concat(): RType extends Minipass.BufferOrString ? Promise<RType> : never | ||
destroy(er?: any): void | ||
pipe<W extends Writable>(dest: W, opts?: PipeOptions): W | ||
unpipe<W extends Writable>(dest: W): void | ||
pipe<W extends Minipass.Writable>(dest: W, opts?: Minipass.PipeOptions): W | ||
unpipe<W extends Minipass.Writable>(dest: W): void | ||
@@ -128,28 +160,2 @@ /** | ||
interface StringOptions { | ||
encoding: BufferEncoding | ||
objectMode?: boolean | ||
async?: boolean | ||
} | ||
interface BufferOptions { | ||
encoding?: null | 'buffer' | ||
objectMode?: boolean | ||
async?: boolean | ||
} | ||
interface ObjectModeOptions { | ||
objectMode: true | ||
async?: boolean | ||
} | ||
export declare interface PipeOptions { | ||
end?: boolean | ||
proxyErrors?: boolean | ||
} | ||
export declare type Options<T> = T extends string | ||
? StringOptions | ||
: T extends Buffer | ||
? BufferOptions | ||
: ObjectModeOptions | ||
export = Minipass |
{ | ||
"name": "minipass", | ||
"version": "3.3.4", | ||
"version": "3.3.5", | ||
"description": "minimal implementation of a PassThrough stream", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"dependencies": { | ||
@@ -7,0 +8,0 @@ "yallist": "^4.0.0" |
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
48119
690