From 8966a87f6073fe897dca19e368804705c59e5972 Mon Sep 17 00:00:00 2001 From: Walter Rafelsberger Date: Tue, 13 Apr 2021 01:40:31 +0200 Subject: [PATCH] migrate index file to TypeScript --- index.js => index.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) rename index.js => index.ts (82%) diff --git a/index.js b/index.ts similarity index 82% rename from index.js rename to index.ts index c047969..a948bab 100644 --- a/index.js +++ b/index.ts @@ -17,12 +17,14 @@ * under the License. */ -// TODO Migrate this to a .ts file for v7.6.1 https://github.com/elastic/kibana/pull/55194 - import { resolve } from 'path'; import { existsSync } from 'fs'; -const milestonesPluginInitializer = ({ Plugin }) => +import { Legacy } from 'kibana'; + +import { LegacyPluginApi, LegacyPluginInitializer } from '../../src/legacy/types'; + +const milestonesPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) => new Plugin({ id: 'kibana_milestones_vis', require: ['kibana', 'elasticsearch', 'data'], @@ -34,13 +36,13 @@ const milestonesPluginInitializer = ({ Plugin }) => ].find(p => existsSync(p)), hacks: [resolve(__dirname, 'public/legacy')], }, - init: () => ({}), - config(Joi) { + init: (server: Legacy.Server) => ({}), + config(Joi: any) { return Joi.object({ enabled: Joi.boolean().default(true), }).default(); }, - }); + } as Legacy.PluginSpecOptions); // eslint-disable-next-line import/no-default-export export default milestonesPluginInitializer;