From 62c03426a5beacfe96f5baec75408f5c55f34a6b Mon Sep 17 00:00:00 2001 From: Tim Roes Date: Mon, 14 Oct 2019 22:20:50 +0200 Subject: [PATCH] Prepare for TS 3.7 conversion (#47794) --- .../np_ready/public/app/dashboard_container_example.tsx | 2 +- x-pack/legacy/plugins/actions/server/actions_config.ts | 2 +- x-pack/legacy/plugins/alerting/server/types.ts | 4 ++-- x-pack/legacy/plugins/infra/types/eui.d.ts | 1 + .../server/lib/reindexing/reindex_actions.test.ts | 4 +--- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx index ba9a874bcc5d3..5cfaa1c22f4e5 100644 --- a/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx +++ b/test/plugin_functional/plugins/kbn_tp_embeddable_explorer/public/np_ready/public/app/dashboard_container_example.tsx @@ -86,7 +86,7 @@ export class DashboardContainerExample extends React.Component { } public switchViewMode = () => { - this.setState((prevState: State) => { + this.setState<'viewMode'>((prevState: State) => { if (!this.container || isErrorEmbeddable(this.container)) { return prevState; } diff --git a/x-pack/legacy/plugins/actions/server/actions_config.ts b/x-pack/legacy/plugins/actions/server/actions_config.ts index 0d33914920b21..3053c88f1c9ef 100644 --- a/x-pack/legacy/plugins/actions/server/actions_config.ts +++ b/x-pack/legacy/plugins/actions/server/actions_config.ts @@ -61,7 +61,7 @@ function isWhitelistedHostnameInUri(config: ActionsConfigType, uri: string): boo tryCatch(() => new URL(uri)), map(url => url.hostname), mapNullable(hostname => isWhitelisted(config, hostname)), - getOrElse(() => false) + getOrElse(() => false) ); } diff --git a/x-pack/legacy/plugins/alerting/server/types.ts b/x-pack/legacy/plugins/alerting/server/types.ts index e0b9f6e03beab..3c71412da2c89 100644 --- a/x-pack/legacy/plugins/alerting/server/types.ts +++ b/x-pack/legacy/plugins/alerting/server/types.ts @@ -5,7 +5,7 @@ */ import { AlertInstance } from './lib'; -import { AlertTypeRegistry } from './alert_type_registry'; +import { AlertTypeRegistry as OrigAlertTypeRegistry } from './alert_type_registry'; import { PluginSetupContract, PluginStartContract } from './plugin'; import { SavedObjectAttributes, SavedObjectsClientContract } from '../../../../../src/core/server'; @@ -95,4 +95,4 @@ export interface AlertingPlugin { start: PluginStartContract; } -export type AlertTypeRegistry = PublicMethodsOf; +export type AlertTypeRegistry = PublicMethodsOf; diff --git a/x-pack/legacy/plugins/infra/types/eui.d.ts b/x-pack/legacy/plugins/infra/types/eui.d.ts index f117181eae43d..530cda2d57731 100644 --- a/x-pack/legacy/plugins/infra/types/eui.d.ts +++ b/x-pack/legacy/plugins/infra/types/eui.d.ts @@ -96,6 +96,7 @@ declare module '@elastic/eui' { message?: any; rowProps?: any; cellProps?: any; + responsive?: boolean; }; export const EuiInMemoryTable: React.SFC; } diff --git a/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts b/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts index e685b231a356d..4569fdfa33a83 100644 --- a/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts +++ b/x-pack/legacy/plugins/upgrade_assistant/server/lib/reindexing/reindex_actions.test.ts @@ -299,9 +299,7 @@ describe('ReindexActions', () => { }); describe('runWhileConsumerLocked', () => { - Object.keys(IndexGroup).forEach(typeKey => { - const consumerType = IndexGroup[typeKey as any] as IndexGroup; - + Object.entries(IndexGroup).forEach(([typeKey, consumerType]) => { describe(`IndexConsumerType.${typeKey}`, () => { it('creates the lock doc if it does not exist and executes callback', async () => { expect.assertions(3);