@maligator/cli 0.1.0-alpha.3 → 0.1.0-alpha.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -92
- package/THIRD_PARTY_NOTICES.md +6357 -0
- package/application-api.d.ts +23 -0
- package/index.d.ts +94 -14
- package/package.json +13 -3
- package/platform-api.d.ts +6 -0
- package/process-api.d.ts +281 -0
- package/test-api.d.ts +230 -0
- package/workers-api.d.ts +445 -0
- package/workers-host-api.d.ts +135 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
// Generated from src/platform/catalog.ts; edit the catalog and regenerate.
|
|
2
|
+
/**
|
|
3
|
+
* Toolchain-owned worker substrate used by the public source API and Node
|
|
4
|
+
* compatibility personality.
|
|
5
|
+
*/
|
|
6
|
+
declare module "maligator:internal/workers" {
|
|
7
|
+
import type * as Workers from "maligator:workers";
|
|
8
|
+
/**
|
|
9
|
+
* Values whose ownership moves when a message is admitted.
|
|
10
|
+
*/
|
|
11
|
+
export type Transferable = Workers.Transferable;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A terminal record. The error is the uncaught value as thrown.
|
|
15
|
+
*/
|
|
16
|
+
export type WorkerExit = {
|
|
17
|
+
readonly id: number;
|
|
18
|
+
readonly code: number;
|
|
19
|
+
readonly reason: "completed" | "terminated" | "error";
|
|
20
|
+
readonly error?: unknown;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A worker's uncaught value as thrown and its own string message, or the empty
|
|
25
|
+
* string.
|
|
26
|
+
*/
|
|
27
|
+
export type WorkerErrorEvent = Event & {
|
|
28
|
+
readonly error: unknown;
|
|
29
|
+
readonly message: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A transactional endpoint. postMessage returns the admission ticket, or undefined
|
|
34
|
+
* when nothing was queued; _discard drops a posted message the peer has not
|
|
35
|
+
* received.
|
|
36
|
+
*/
|
|
37
|
+
export type MessagePort<Send = unknown, Receive = unknown> = {
|
|
38
|
+
postMessage(value: Send, transfer?: ReadonlyArray<Transferable>): number | undefined;
|
|
39
|
+
_discard(ticket: number): boolean;
|
|
40
|
+
addEventListener(
|
|
41
|
+
type: "message",
|
|
42
|
+
listener: (event: MessageEvent<Receive>) => void | Promise<void>,
|
|
43
|
+
options?: AddEventListenerOptions | boolean,
|
|
44
|
+
): void;
|
|
45
|
+
onmessage: ((event: MessageEvent<Receive>) => void) | null;
|
|
46
|
+
onmessageerror: ((event: MessageEvent<unknown>) => void) | null;
|
|
47
|
+
start(): void;
|
|
48
|
+
close(): void;
|
|
49
|
+
ref(): MessagePort<Send, Receive>;
|
|
50
|
+
unref(): MessagePort<Send, Receive>;
|
|
51
|
+
hasRef(): boolean;
|
|
52
|
+
} & EventTarget;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* A channel whose first port sends Forward messages and receives Backward messages.
|
|
56
|
+
*/
|
|
57
|
+
export type MessageChannel<Forward = unknown, Backward = unknown> = {
|
|
58
|
+
readonly port1: MessagePort<Forward, Backward>;
|
|
59
|
+
readonly port2: MessagePort<Backward, Forward>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* A source-API worker handle over a transactional parent port.
|
|
64
|
+
*/
|
|
65
|
+
export type Worker<Send = unknown, Receive = unknown> = {
|
|
66
|
+
readonly id: number;
|
|
67
|
+
readonly ready: Promise<void>;
|
|
68
|
+
readonly closed: Promise<WorkerExit>;
|
|
69
|
+
readonly port: MessagePort<Send, Receive>;
|
|
70
|
+
addEventListener(
|
|
71
|
+
type: "error",
|
|
72
|
+
listener: (event: WorkerErrorEvent) => void,
|
|
73
|
+
options?: AddEventListenerOptions | boolean,
|
|
74
|
+
): void;
|
|
75
|
+
terminate(): Promise<WorkerExit>;
|
|
76
|
+
ref(): Worker<Send, Receive>;
|
|
77
|
+
unref(): Worker<Send, Receive>;
|
|
78
|
+
hasRef(): boolean;
|
|
79
|
+
} & EventTarget;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Start a declared isolated module with a transactional parent port.
|
|
83
|
+
*/
|
|
84
|
+
export const Worker: {
|
|
85
|
+
new <Send = unknown, Receive = unknown>(
|
|
86
|
+
entry: { readonly href: string },
|
|
87
|
+
options?: Workers.WorkerOptions,
|
|
88
|
+
): Worker<Send, Receive>;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Create two transactional endpoints.
|
|
92
|
+
*/
|
|
93
|
+
export const MessageChannel: {
|
|
94
|
+
new <Forward = unknown, Backward = unknown>(
|
|
95
|
+
options?: Workers.MessageChannelOptions,
|
|
96
|
+
): MessageChannel<Forward, Backward>;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* The transactional port prototype.
|
|
100
|
+
*/
|
|
101
|
+
export const MessagePort: { readonly prototype: MessagePort };
|
|
102
|
+
/**
|
|
103
|
+
* Synchronously dequeue one pending message without running unrelated callbacks.
|
|
104
|
+
*/
|
|
105
|
+
export const receiveMessageOnPort: <Receive>(
|
|
106
|
+
port: MessagePort<unknown, Receive>,
|
|
107
|
+
) => { readonly message: Receive } | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Report the running host's worker facilities and capacity.
|
|
110
|
+
*/
|
|
111
|
+
export const capabilities: typeof Workers.capabilities;
|
|
112
|
+
/**
|
|
113
|
+
* Fail the current worker after its outcome cannot be published.
|
|
114
|
+
*/
|
|
115
|
+
export const failCurrent: () => void;
|
|
116
|
+
/**
|
|
117
|
+
* Internal static entry declaration.
|
|
118
|
+
*/
|
|
119
|
+
export const createWorkerUrl: (
|
|
120
|
+
specifier: string,
|
|
121
|
+
base: string,
|
|
122
|
+
) => { readonly href: string };
|
|
123
|
+
/**
|
|
124
|
+
* Isolate-owned worker state.
|
|
125
|
+
*/
|
|
126
|
+
export const parentPort: MessagePort | null;
|
|
127
|
+
/**
|
|
128
|
+
* Isolate-owned worker state.
|
|
129
|
+
*/
|
|
130
|
+
export const workerData: unknown;
|
|
131
|
+
/**
|
|
132
|
+
* The task-pool bootstrap entry.
|
|
133
|
+
*/
|
|
134
|
+
export const poolEntry: { readonly href: string };
|
|
135
|
+
}
|