From 9215a31fa256c67cb8275d7c577f0d4c3f5f0ab3 Mon Sep 17 00:00:00 2001 From: Erik Ritter Date: Wed, 25 Nov 2020 08:21:44 -0800 Subject: [PATCH] chore: type src/logger (#10815) --- superset-frontend/src/logger/{LogUtils.js => LogUtils.ts} | 2 +- superset-frontend/src/logger/actions/{index.js => index.ts} | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) rename superset-frontend/src/logger/{LogUtils.js => LogUtils.ts} (99%) rename superset-frontend/src/logger/actions/{index.js => index.ts} (85%) diff --git a/superset-frontend/src/logger/LogUtils.js b/superset-frontend/src/logger/LogUtils.ts similarity index 99% rename from superset-frontend/src/logger/LogUtils.js rename to superset-frontend/src/logger/LogUtils.ts index 17e4a0f69..bfb7a7f11 100644 --- a/superset-frontend/src/logger/LogUtils.js +++ b/superset-frontend/src/logger/LogUtils.ts @@ -59,7 +59,7 @@ export const LOG_EVENT_TYPE_USER = new Set([ ]); export const Logger = { - // note that this returns ms since page load, NOT ms since epoc + // note that this returns ms since page load, NOT ms since epoch getTimestamp() { return Math.round(window.performance.now()); }, diff --git a/superset-frontend/src/logger/actions/index.js b/superset-frontend/src/logger/actions/index.ts similarity index 85% rename from superset-frontend/src/logger/actions/index.js rename to superset-frontend/src/logger/actions/index.ts index f319068e6..c89ff0ca8 100644 --- a/superset-frontend/src/logger/actions/index.js +++ b/superset-frontend/src/logger/actions/index.ts @@ -16,10 +16,12 @@ * specific language governing permissions and limitations * under the License. */ +import { Dispatch } from 'react-redux'; + export const LOG_EVENT = 'LOG_EVENT'; -export function logEvent(eventName, eventData) { - return dispatch => +export function logEvent(eventName: string, eventData: Record) { + return (dispatch: Dispatch) => dispatch({ type: LOG_EVENT, payload: {