Last change
on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | /// <reference types="node" />
|
---|
2 | import type { MessagePort } from 'worker_threads';
|
---|
3 | export interface StartupMessage {
|
---|
4 | filename: string | null;
|
---|
5 | name: string;
|
---|
6 | port: MessagePort;
|
---|
7 | sharedBuffer: Int32Array;
|
---|
8 | useAtomics: boolean;
|
---|
9 | niceIncrement: number;
|
---|
10 | }
|
---|
11 | export interface RequestMessage {
|
---|
12 | taskId: number;
|
---|
13 | task: any;
|
---|
14 | filename: string;
|
---|
15 | name: string;
|
---|
16 | }
|
---|
17 | export interface ReadyMessage {
|
---|
18 | ready: true;
|
---|
19 | }
|
---|
20 | export interface ResponseMessage {
|
---|
21 | taskId: number;
|
---|
22 | result: any;
|
---|
23 | error: Error | null;
|
---|
24 | }
|
---|
25 | export declare const commonState: {
|
---|
26 | isWorkerThread: boolean;
|
---|
27 | workerData: undefined;
|
---|
28 | };
|
---|
29 | export declare const kTransferable: unique symbol;
|
---|
30 | export declare const kValue: unique symbol;
|
---|
31 | export declare const kQueueOptions: unique symbol;
|
---|
32 | export declare function isTransferable(value: any): boolean;
|
---|
33 | export declare function isMovable(value: any): boolean;
|
---|
34 | export declare function markMovable(value: object): void;
|
---|
35 | export interface Transferable {
|
---|
36 | readonly [kTransferable]: object;
|
---|
37 | readonly [kValue]: object;
|
---|
38 | }
|
---|
39 | export interface Task {
|
---|
40 | readonly [kQueueOptions]: object | null;
|
---|
41 | }
|
---|
42 | export interface TaskQueue {
|
---|
43 | readonly size: number;
|
---|
44 | shift(): Task | null;
|
---|
45 | remove(task: Task): void;
|
---|
46 | push(task: Task): void;
|
---|
47 | }
|
---|
48 | export declare function isTaskQueue(value: any): boolean;
|
---|
49 | export declare const kRequestCountField = 0;
|
---|
50 | export declare const kResponseCountField = 1;
|
---|
51 | export declare const kFieldCount = 2;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.