Skip to content

Commit

Permalink
export observability startdeps
Browse files Browse the repository at this point in the history
Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 committed Mar 10, 2024
1 parent 4fce74d commit 7c5fa82
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export { ObservabilityPlugin as Plugin };

export const plugin = (initializerContext: PluginInitializerContext) =>
new ObservabilityPlugin(initializerContext);

export { ObservabilityStart } from './types';
7 changes: 5 additions & 2 deletions public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
observabilityTracesTitle,
} from '../common/constants/shared';
import { QueryManager } from '../common/query_manager';
import { AssociatedObject } from '../common/types/data_connections';
import { VISUALIZATION_SAVED_OBJECT } from '../common/types/observability_saved_object_attributes';
import {
setOSDHttp,
Expand Down Expand Up @@ -102,12 +103,14 @@ interface PublicConfig {
export const [
getRenderAccelerationDetailsFlyout,
setRenderAccelerationDetailsFlyout,
] = createGetterSetter('renderAccelerationDetailsFlyout');
] = createGetterSetter<(acceleration: any) => void>('renderAccelerationDetailsFlyout');

export const [
getRenderAssociatedObjectsDetailsFlyout,
setRenderAssociatedObjectsDetailsFlyout,
] = createGetterSetter('renderAssociatedObjectsDetailsFlyout');
] = createGetterSetter<({ tableDetail }: { tableDetail: AssociatedObject }) => void>(
'renderAssociatedObjectsDetailsFlyout'
);

export const [
getRenderCreateAccelerationFlyout,
Expand Down
14 changes: 11 additions & 3 deletions public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ManagementOverViewPluginSetup } from '../../../src/plugins/management_o
import { NavigationPublicPluginStart } from '../../../src/plugins/navigation/public';
import { UiActionsStart } from '../../../src/plugins/ui_actions/public';
import { VisualizationsSetup } from '../../../src/plugins/visualizations/public';
import { AssociatedObject } from '../common/types/data_connections';
import { AssistantSetup } from './types';

export interface AppPluginStartDependencies {
Expand All @@ -33,13 +34,20 @@ export interface SetupDependencies {
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ObservabilitySetup {}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface ObservabilityStart {}
export interface ObservabilityStart {
renderAccelerationDetailsFlyout: (acceleration: any) => void;
renderAssociatedObjectsDetailsFlyout: ({
tableDetail,
}: {
tableDetail: AssociatedObject;
}) => void;
renderCreateAccelerationFlyout: (selectedDatasource: string) => void;
}

/**
* Introduce a compile dependency on dashboards-assistant
* as observerability need some types from the plugin.
* It will gives an type error when dashboards-assistant is not installed so add a ts-ignore to suppress the error.
*/
// @ts-ignore
export type { AssistantSetup, RenderProps, IMessage } from '../../dashboards-assistant/public';
export type { AssistantSetup, IMessage, RenderProps } from '../../dashboards-assistant/public';

0 comments on commit 7c5fa82

Please sign in to comment.