iframe.io 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export default class IOF {
32
32
  initiate(contentWindow: MessageEventSource, iframeOrigin: string): this;
33
33
  listen(hostOrigin?: string): this;
34
34
  fire(_event: string, payload?: MessageData['payload'], callback?: boolean): void;
35
- emit(_event: string, payload?: MessageData['payload'], fn?: Listener): this;
35
+ emit(_event: string, payload?: MessageData['payload'], fn?: CallbackFunction): this;
36
36
  on(_event: string, fn: Listener): this;
37
37
  once(_event: string, fn: Listener): this;
38
38
  off(_event: string, fn?: Listener): this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iframe.io",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Easy and friendly API to connect and interact between content window and its containing iframe",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/src/index.ts CHANGED
@@ -165,7 +165,7 @@ export default class IOF {
165
165
  listeners.map( fn => payload ? fn( payload, callbackFn ) : fn( callbackFn ) )
166
166
  }
167
167
 
168
- emit( _event: string, payload?: MessageData['payload'], fn?: Listener ){
168
+ emit( _event: string, payload?: MessageData['payload'], fn?: CallbackFunction ){
169
169
 
170
170
  if( !this.peer.source )
171
171
  throw new Error('No Connection initiated')
@@ -178,7 +178,7 @@ export default class IOF {
178
178
  // Acknowledge/callback event listener
179
179
  let hasCallback = false
180
180
  if( typeof fn === 'function' ){
181
- const callbackFunction = fn as CallbackFunction
181
+ const callbackFunction = fn
182
182
 
183
183
  this.once( _event +'--@callback', ({ error, args }) => callbackFunction( error, ...args ) )
184
184
  hasCallback = true