RPC
Extends:
Primitive postMessage based RPC for the controls to interact with the parent frame.
Constructor Summary
Public Constructor | ||
public |
constructor(target: window, protocolVersion: string, origin: string) Creates a new RPC instance. |
Method Summary
Public Methods | ||
public |
Makes an RPC call out to the target window. |
|
public |
destroy() Tears down resources associated with the RPC client. |
|
public |
Attaches a method callable by the other window, to this one. |
|
public |
remoteVersion(): string | undefined Returns the protocol version that the remote client implements. |
Public Constructors
Public Methods
public call(method: string, params: *, waitForReply: boolean): Promise.<object> | undefined source
Makes an RPC call out to the target window.
Return:
Promise.<object> | undefined | If waitForReply is true, a promise is returned that resolves once the server responds. |
public expose(method: string, handler: function(params: any): Promise | *) source
Attaches a method callable by the other window, to this one. The handler function will be invoked with whatever the other window gives us. Can return a Promise, or the results directly.
public remoteVersion(): string | undefined source
Returns the protocol version that the remote client implements. This
will return undefined
until we get a ready
event.
Return:
string | undefined |