diff --git a/src/legacy/core_plugins/kbn_vislib_vis_types/public/utils/with_service_settings.tsx b/src/legacy/core_plugins/kbn_vislib_vis_types/public/utils/with_service_settings.tsx index 0dbf82b7fe06e62..d3332c2fc106ff4 100644 --- a/src/legacy/core_plugins/kbn_vislib_vis_types/public/utils/with_service_settings.tsx +++ b/src/legacy/core_plugins/kbn_vislib_vis_types/public/utils/with_service_settings.tsx @@ -18,9 +18,11 @@ */ import React from 'react'; +import { InjectedDependencies, VisOptionsProps } from 'ui/vis/editors/default'; -const withServiceSettings = (Component: React.ComponentType, serviceSettings: any) => ( - props: any -) => ; +const withInjectedDependencies = ( + Component: React.ComponentType, + dependencies: InjectedDependencies +) => (props: VisOptionsProps) => ; -export { withServiceSettings }; +export { withInjectedDependencies }; diff --git a/src/legacy/core_plugins/tile_map/public/tile_map_type.js b/src/legacy/core_plugins/tile_map/public/tile_map_type.js index 49bbbd43cf573dc..374072ef61e10a1 100644 --- a/src/legacy/core_plugins/tile_map/public/tile_map_type.js +++ b/src/legacy/core_plugins/tile_map/public/tile_map_type.js @@ -28,7 +28,7 @@ import { convertToGeoJson } from 'ui/vis/map/convert_to_geojson'; import { createTileMapVisualization } from './tile_map_visualization'; import { visFactory } from '../../visualizations/public'; import { TileMapOptions } from './components/tile_map_options'; -import { withServiceSettings } from '../../kbn_vislib_vis_types/public/utils/with_service_settings'; +import { withInjectedDependencies } from '../../kbn_vislib_vis_types/public/utils/with_service_settings'; export function createTileMapTypeDefinition(dependencies) { const CoordinateMapsVisualization = createTileMapVisualization(dependencies); @@ -113,7 +113,7 @@ export function createTileMapTypeDefinition(dependencies) { ], tmsLayers: [], }, - optionsTemplate: withServiceSettings(TileMapOptions, serviceSettings), + optionsTemplate: withInjectedDependencies(TileMapOptions, { serviceSettings }), schemas: new Schemas([ { group: 'metrics', diff --git a/src/legacy/ui/public/vis/editors/default/vis_options_props.tsx b/src/legacy/ui/public/vis/editors/default/vis_options_props.tsx index 074a04bfdf26034..e8a0f2fd4ada50c 100644 --- a/src/legacy/ui/public/vis/editors/default/vis_options_props.tsx +++ b/src/legacy/ui/public/vis/editors/default/vis_options_props.tsx @@ -20,8 +20,11 @@ import { Vis, VisParams } from 'ui/vis'; export type VisOptionsSetValue = (paramName: string, value: unknown) => void; -export interface VisOptionsProps { - serviceSettings?: any; + +export interface InjectedDependencies { + [key: string]: any; +} +export interface VisOptionsProps extends InjectedDependencies { stateParams: VisParams; vis: Vis; setValue: VisOptionsSetValue;