Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion typings/internalBinding/fs.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AsyncWrap } from './async_wrap';
import { ConstantsBinding } from './constants';

interface ReadFileContext {
Expand All @@ -20,6 +21,8 @@ declare namespace InternalFSBinding {
context: ReadFileContext;
}

interface FSReqCallback<ResultType = unknown> extends AsyncWrap {}

interface FSSyncContext {
fd?: number;
path?: string;
Expand All @@ -39,12 +42,13 @@ declare namespace InternalFSBinding {
class FileHandle {
constructor(fd: number, offset: number, length: number);
fd: number;
getAsyncId(): number;
close(): Promise<void>;
onread: () => void;
stream: Stream;
}

interface FileHandle extends AsyncWrap {}

class StatWatcher {
constructor(useBigint: boolean);
initialized: boolean;
Expand Down
3 changes: 3 additions & 0 deletions typings/internalBinding/fs_dir.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AsyncWrap } from './async_wrap';
import { InternalFSBinding } from './fs';

declare namespace InternalFSDirBinding {
Expand All @@ -12,6 +13,8 @@ declare namespace InternalFSDirBinding {
close(): void;
}

interface DirHandle extends AsyncWrap {}

function opendir(path: StringOrBuffer, encoding: string, req: FSReqCallback): DirHandle;
function opendir(path: StringOrBuffer, encoding: string): DirHandle;
function opendirSync(path: StringOrBuffer): DirHandle;
Expand Down
3 changes: 2 additions & 1 deletion typings/internalBinding/heap_utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { AsyncWrap } from './async_wrap';
import { owner_symbol } from './symbols';

declare namespace InternalHeapUtilsBinding {
interface HeapSnapshotStreamHandle {
interface HeapSnapshotStreamHandle extends AsyncWrap {
[owner_symbol]?: object;
onread?: (arrayBuffer: ArrayBuffer | undefined) => void;
readStart(): number;
Expand Down
4 changes: 4 additions & 0 deletions typings/internalBinding/http_parser.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AsyncWrap } from './async_wrap';

declare namespace InternalHttpParserBinding {
type Buffer = Uint8Array;
type Stream = object;
Expand Down Expand Up @@ -55,6 +57,8 @@ declare namespace InternalHttpParserBinding {
unconsume(): void;
getCurrentBuffer(): Buffer;
}

interface HTTPParser extends AsyncWrap {}
}

export interface HttpParserBinding {
Expand Down
8 changes: 5 additions & 3 deletions typings/internalBinding/quic.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AsyncWrap } from './async_wrap';

interface QuicCallbacks {
onEndpointClose: (context: number, status: number) => void;
onSessionNew: (session: Session) => void;
Expand Down Expand Up @@ -53,10 +55,10 @@ interface EndpointOptions {
interface SessionOptions {}
interface SocketAddress {}

interface Session {}
interface Stream {}
interface Session extends AsyncWrap {}
interface Stream extends AsyncWrap {}

interface Endpoint {
interface Endpoint extends AsyncWrap {
listen(options: SessionOptions): void;
connect(address: SocketAddress, options: SessionOptions): Session;
closeGracefully(): void;
Expand Down
4 changes: 4 additions & 0 deletions typings/internalBinding/stream_pipe.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AsyncWrap } from './async_wrap';

declare namespace InternalStreamPipeBinding {
class StreamPipe {
constructor(source: object, sink: object);
Expand All @@ -10,6 +12,8 @@ declare namespace InternalStreamPipeBinding {
isClosed(): boolean;
pendingWrites(): number;
}

interface StreamPipe extends AsyncWrap {}
}

export interface StreamPipeBinding {
Expand Down
3 changes: 3 additions & 0 deletions typings/internalBinding/worker.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AsyncWrap } from './async_wrap';
import { InternalMessagingBinding } from './messaging';

declare namespace InternalWorkerBinding {
Expand All @@ -23,6 +24,8 @@ declare namespace InternalWorkerBinding {
loopIdleTime(): number;
loopStartTime(): number;
}

interface Worker extends AsyncWrap {}
}

export interface CPUProfileHandle {
Expand Down
4 changes: 4 additions & 0 deletions typings/internalBinding/zlib.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { AsyncWrap } from './async_wrap';

declare namespace InternalZlibBinding {
class ZlibBase {
// These attributes are not used by the C++ binding, but declared on JS side.
Expand All @@ -15,6 +17,8 @@ declare namespace InternalZlibBinding {
writeSync(flushFlag: number, input: TypedArray, inputOff: number, inputLen: number, out: TypedArray, outOff: number, outLen: number): void;
}

interface ZlibBase extends AsyncWrap {}

class Zlib extends ZlibBase {
constructor(mode: number)
init(windowBits: number, level: number, memLevel: number, strategy: number, writeState: Uint32Array, callback: VoidFunction, dictionary: Uint32Array): number;
Expand Down
Loading