Skip to content

Commit

Permalink
better typing on injected dependencies
Browse files Browse the repository at this point in the history
Signed-off-by: Aleksandar Djindjic <djindjic@gmail.com>
  • Loading branch information
djindjic committed Jan 22, 2023
1 parent ab586e6 commit f883426
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
15 changes: 5 additions & 10 deletions public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import {
} from '../../../src/core/public';
import { PLUGIN_NAME, ROUTES } from './utils/constants';
import { SecurityAnalyticsPluginSetup, SecurityAnalyticsPluginStart } from './index';
import { Plugin as DataPublicPlugin } from '../../../src/plugins/data/public';
import { DataPublicPluginStart, DataPublicPluginSetup } from '../../../src/plugins/data/public';

export interface SecurityAnalyticsPluginSetupDeps {
data: DataPublicPlugin;
data: DataPublicPluginSetup;
}
export interface SecurityAnalyticsPluginStartDeps {
data: DataPublicPlugin;
data: DataPublicPluginStart;
}

export class SecurityAnalyticsPlugin
Expand All @@ -34,7 +34,7 @@ export class SecurityAnalyticsPlugin
}

public setup(
core: CoreSetup,
core: CoreSetup<SecurityAnalyticsPluginStartDeps>,
plugins: SecurityAnalyticsPluginSetupDeps
): SecurityAnalyticsPluginSetup {
core.application.register({
Expand All @@ -49,12 +49,7 @@ export class SecurityAnalyticsPlugin
mount: async (params: AppMountParameters) => {
const { renderApp } = await import('./security_analytics_app');
const [coreStart, depsStart] = await core.getStartServices();
return renderApp(
coreStart,
params,
ROUTES.LANDING_PAGE,
depsStart as SecurityAnalyticsPluginStartDeps
);
return renderApp(coreStart, params, ROUTES.LANDING_PAGE, depsStart);
},
});
return {};
Expand Down
2 changes: 1 addition & 1 deletion public/security_analytics_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function renderApp(
const alertsService = new AlertsService(http);
const ruleService = new RuleService(http);
const notificationsService = new NotificationsService(http);
const indexPatternsService = new IndexPatternsService((depsStart.data as any).indexPatterns);
const indexPatternsService = new IndexPatternsService(depsStart.data.indexPatterns);

const services: BrowserServices = {
detectorsService,
Expand Down

0 comments on commit f883426

Please sign in to comment.