2023-09-23 12:48:34 +02:00
|
|
|
import { InternalMessagingBinding } from './messaging';
|
|
|
|
|
2021-09-18 17:49:05 +02:00
|
|
|
declare namespace InternalWorkerBinding {
|
|
|
|
class Worker {
|
|
|
|
constructor(
|
|
|
|
url: string | URL | null,
|
|
|
|
env: object | null | undefined,
|
|
|
|
execArgv: string[] | null | undefined,
|
|
|
|
resourceLimits: Float64Array,
|
2021-10-11 18:08:34 +02:00
|
|
|
trackUnmanagedFds: boolean,
|
|
|
|
);
|
2021-09-18 17:49:05 +02:00
|
|
|
startThread(): void;
|
|
|
|
stopThread(): void;
|
|
|
|
ref(): void;
|
|
|
|
unref(): void;
|
|
|
|
getResourceLimits(): Float64Array;
|
|
|
|
takeHeapSnapshot(): object;
|
|
|
|
loopIdleTime(): number;
|
|
|
|
loopStartTime(): number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-09-23 12:48:34 +02:00
|
|
|
export interface WorkerBinding {
|
2021-09-18 17:49:05 +02:00
|
|
|
Worker: typeof InternalWorkerBinding.Worker;
|
|
|
|
getEnvMessagePort(): InternalMessagingBinding.MessagePort;
|
|
|
|
threadId: number;
|
|
|
|
isMainThread: boolean;
|
|
|
|
ownsProcessState: boolean;
|
|
|
|
resourceLimits?: Float64Array;
|
|
|
|
kMaxYoungGenerationSizeMb: number;
|
|
|
|
kMaxOldGenerationSizeMb: number;
|
|
|
|
kCodeRangeSizeMb: number;
|
|
|
|
kStackSizeMb: number;
|
|
|
|
kTotalResourceLimitCount: number;
|
2023-09-23 12:48:34 +02:00
|
|
|
}
|