mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-05 16:35:33 +00:00
25 lines
No EOL
880 B
TypeScript
25 lines
No EOL
880 B
TypeScript
// Necessary for headless compilation. All contents were copied from the definitions in lib.dom.d.ts and trimmed for
|
|
// relevance.
|
|
|
|
/** A message received by a target object. */
|
|
interface MessageEvent {
|
|
/**
|
|
* Returns the data of the message.
|
|
*/
|
|
readonly data: any;
|
|
|
|
// Other properties exist; we just don't use them yet.
|
|
}
|
|
|
|
interface PostMessageOptions {
|
|
transfer?: any[];
|
|
}
|
|
|
|
/** This Web Workers API interface represents a background task that can be easily created and can send messages back to its creator. Creating a worker is as simple as calling the Worker() constructor and specifying a script to be run in the worker thread. */
|
|
interface Worker {
|
|
onmessage: ((this: Worker, ev: MessageEvent) => any) | null;
|
|
postMessage(message: any): void;
|
|
terminate(): void;
|
|
|
|
// addEventListener and removeEventListener also exist, but we don't utilize them.
|
|
} |