1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | export interface Endpoint {
|
14 | postMessage(message: any, transfer?: any[]): void;
|
15 | addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: {}): void;
|
16 | removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: {}): void;
|
17 | }
|
18 | export declare type Proxy = Function;
|
19 | export declare type Exposable = Function | Object;
|
20 | export interface TransferHandler {
|
21 | canHandle: (obj: {}) => Boolean;
|
22 | serialize: (obj: {}) => {};
|
23 | deserialize: (obj: {}) => {};
|
24 | }
|
25 | export declare const transferHandlers: Map<string, TransferHandler>;
|
26 | export declare function proxy(endpoint: Endpoint | Window, target?: any): Proxy;
|
27 | export declare function proxyValue<T>(obj: T): T;
|
28 | export declare function expose(rootObj: Exposable, endpoint: Endpoint | Window): void;
|