forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SharedWorker.d.ts
29 lines (26 loc) · 936 Bytes
/
SharedWorker.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Type definitions for SharedWorker
// Project: http://www.w3.org/TR/workers/
// Definitions by: Toshiya Nakakura <https://github.com/nakakura>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module SharedWorker {
interface AbstractWorker extends EventTarget {
onerror: (ev: ErrorEvent) => any;
}
export interface SharedWorker extends AbstractWorker {
/**
* the value it was assigned by the object's constructor.
* It represents the MessagePort for communicating with the shared worker.
* @type {MessagePort}
*/
port: MessagePort;
}
}
declare var SharedWorker: {
prototype: SharedWorker.SharedWorker;
/***
*
* @param {string} stringUrl Pathname to JavaScript file
* @param {string} name Name of the worker to execute
*/
new (stringUrl: string, name?: string): SharedWorker.SharedWorker;
};