-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.d.ts
51 lines (40 loc) · 1.42 KB
/
node.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
declare namespace NodeJS {
export type Buffer = import("./deps.ts").NodeBuffer;
export const Buffer: Buffer;
export type EventEmitter = import("./deps.ts").NodeEventEmitter;
export const EventEmitter: EventEmitter;
export type Readable = import("./deps.ts").NodeReadable;
export const Readable: Readable;
export type Writable = import("./deps.ts").NodeWritable;
export const Writable: Writable;
export type Stream = import("./deps.ts").NodeStream;
export const Stream: Stream;
export type ReadableStream = Readable & { readonly readable: true };
export const ReadableStream: ReadableStream;
export type WritableStream = Writable & { readonly writable: true };
export const WritableStream: WritableStream;
export interface Streams extends EventEmitter {
pipe<T extends Writable>(
destination: T,
options?: { end?: boolean },
): T;
}
export const Streams: Streams;
}
declare interface SymbolConstructor {
readonly observable: symbol;
}
// deno-lint-ignore ban-types
declare interface WeakRef<T extends object> {
readonly [Symbol.toStringTag]: "WeakRef";
deref(): T | undefined;
}
/**
* Matches a value that is like an Observable.
* @see https://github.com/tc39/proposal-observable
*/
declare interface ObservableLike {
subscribe(observer: (value: unknown) => void): void;
[Symbol.observable](): ObservableLike;
}
declare type Falsy = false | 0 | 0n | "" | null | undefined;