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;