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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
declare function InternalBinding(binding: 'worker'): {
|
|
|
|
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;
|
|
|
|
};
|