Commit 1eec1e0c authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Avoid duplication of the documentation

`CrossFrame#call|onConnect|on` are proxies of
`Bridge#call|onConnect|on`.

Instead of duplicating the documentation of `Bridge` methods on
`CrossFrame` we use a `@see`.
parent 145e57d9
...@@ -105,12 +105,9 @@ export class CrossFrame { ...@@ -105,12 +105,9 @@ export class CrossFrame {
* Subscribe to an event from the sidebar. * Subscribe to an event from the sidebar.
* *
* @param {string} method * @param {string} method
* @param {(...args: any[]) => void} listener -- Final argument is an optional * @param {(...args: any[]) => void} listener
* callback of the type: `(error: string|Error|null, ...result: any[]) => void`. *
* This callback must be invoked in order to respond (via `postMessage`) * @see {Bridge.on} for details.
* to the other frame/s with a result or an error.
* @throws {Error} If trying to register a callback after a channel has already been created
* @throws {Error} If trying to register a callback with the same name multiple times
*/ */
on(method, listener) { on(method, listener) {
this._bridge.on(method, listener); this._bridge.on(method, listener);
...@@ -119,12 +116,10 @@ export class CrossFrame { ...@@ -119,12 +116,10 @@ export class CrossFrame {
/** /**
* Call an RPC method exposed by the sidebar to the annotator. * Call an RPC method exposed by the sidebar to the annotator.
* *
* @param {string} method * @param {string} method - Name of remote method to call.
* @param {any[]} args - Arguments to method. Final argument is an optional * @param {any[]} args
* callback with this type: `(error: string|Error|null, ...result: any[]) => void`. *
* This callback, if any, will be triggered once a response (via `postMessage`) * @see {Bridge.call} for details.
* comes back from the other frame/s. If the first argument (error) is `null`
* it means successful execution of the whole remote procedure call.
*/ */
call(method, ...args) { call(method, ...args) {
this._bridge.call(method, ...args); this._bridge.call(method, ...args);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment