Skip to content

Commit

Permalink
migrate index file to TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed Apr 12, 2021
1 parent ad003ac commit 8966a87
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.js → index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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;

0 comments on commit 8966a87

Please sign in to comment.