in lib/connection.ts [123:132]
setLocalApi(api: API) {
return new Promise((resolve, reject) => {
const id = this.registerCallback(resolve, reject);
this.postMessageToOtherSide({
callId: id,
apiMethods: this.getMethodsFromInterface(api),
type: TYPE_SET_INTERFACE
});
}).then(() => this.localApi = api);
}