@gooddata/js-utils
Advanced tools
Comparing version 3.10.4 to 3.10.5
@@ -1,13 +0,2 @@ | ||
export interface IGdcMessageEvent extends MessageEvent { | ||
data: { | ||
gdc: { | ||
product: string; | ||
event: { | ||
name: string; | ||
data: any; | ||
}; | ||
}; | ||
}; | ||
} | ||
export declare type GdcMessageEventListener = (event: IGdcMessageEvent) => boolean; | ||
import { GdcMessageEventListener } from '@gooddata/typings'; | ||
export interface IHost { | ||
@@ -14,0 +3,0 @@ postMessage?: Window['postMessage']; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// (C) 2007-2019 GoodData Corporation | ||
// (C) 2007-2020 GoodData Corporation | ||
var get_1 = __importDefault(require("lodash/get")); | ||
@@ -9,0 +9,0 @@ var host; |
{ | ||
"name": "@gooddata/js-utils", | ||
"version": "3.10.4", | ||
"version": "3.10.5", | ||
"description": "Various utils shared on GoodData frontend", | ||
@@ -49,2 +49,3 @@ "repository": { | ||
"dependencies": { | ||
"@gooddata/typings": "^2.24.0", | ||
"js-cookie": "^2.1.4", | ||
@@ -51,0 +52,0 @@ "lodash": "^4.17.15" |
@@ -1,17 +0,5 @@ | ||
// (C) 2007-2019 GoodData Corporation | ||
// (C) 2007-2020 GoodData Corporation | ||
import get from 'lodash/get'; | ||
import { IGdcMessageEvent, GdcMessageEventListener, IGdcMessageEventListenerConfig } from '@gooddata/typings'; | ||
export interface IGdcMessageEvent extends MessageEvent { | ||
data: { | ||
gdc: { | ||
product: string; | ||
event: { | ||
name: string; | ||
data: any; | ||
} | ||
} | ||
}; | ||
} | ||
export type GdcMessageEventListener = (event: IGdcMessageEvent) => boolean; | ||
export interface IHost { | ||
@@ -51,8 +39,6 @@ postMessage?: Window['postMessage']; | ||
} | ||
const receivers: IReceiverEntry[] = []; | ||
interface IConfig { | ||
product: string; | ||
validReceivedPostEvents: string[]; | ||
} | ||
let config: IConfig = { | ||
let config: IGdcMessageEventListenerConfig = { | ||
product: '', | ||
@@ -62,3 +48,5 @@ validReceivedPostEvents: [] | ||
const receiveListener = (listener: GdcMessageEventListener): GdcMessageEventListener => (event: IGdcMessageEvent) => { | ||
const receiveListener = ( | ||
listener: GdcMessageEventListener | ||
): GdcMessageEventListener => (event: IGdcMessageEvent<string, string, any>) => { | ||
return ( | ||
@@ -65,0 +53,0 @@ get(event, 'data.gdc.product') === config.product && |
@@ -1,3 +0,4 @@ | ||
// (C) 2007-2018 GoodData Corporation | ||
import { setHost, postEvent, setConfig, addListener, removeListener, IGdcMessageEvent } from '../post-events'; | ||
// (C) 2007-2020 GoodData Corporation | ||
import { IGdcMessageEvent } from '@gooddata/typings'; | ||
import { setHost, postEvent, setConfig, addListener, removeListener } from '../post-events'; | ||
@@ -34,3 +35,3 @@ describe('Post events', () => { | ||
beforeEach(() => { | ||
listener = (e: IGdcMessageEvent) => e.data.gdc.event.data; | ||
listener = (e: IGdcMessageEvent<string, string, any>) => e.data.gdc.event.data; | ||
target = { | ||
@@ -37,0 +38,0 @@ addEventListener: jest.fn(), |
Sorry, the diff of this file is not supported yet
318
72940
3
1475
+ Added@gooddata/typings@^2.24.0
+ Added@gooddata/typings@2.29.0(transitive)