From 88c203dca5f86f38aff0e6a4393e6423b8ff3523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Se=CC=81bastien=20Loix?= Date: Tue, 17 May 2022 15:53:29 +0200 Subject: [PATCH] Fix TS types --- .../visualizations/public/utils/saved_visualize_utils.ts | 2 +- .../public/vis_types/vis_type_alias_registry.ts | 4 ++-- x-pack/plugins/maps/common/map_saved_object_type.ts | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/plugins/visualizations/public/utils/saved_visualize_utils.ts b/src/plugins/visualizations/public/utils/saved_visualize_utils.ts index 9e95d69dfb3db..f5444b6269e22 100644 --- a/src/plugins/visualizations/public/utils/saved_visualize_utils.ts +++ b/src/plugins/visualizations/public/utils/saved_visualize_utils.ts @@ -69,7 +69,7 @@ export function mapHitSource( attributes: SavedObjectAttributes; id: string; references: SavedObjectReference[]; - updatedAt: string; + updatedAt?: string; } ) { const newAttributes: { diff --git a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts index 2945aaa1a0cc8..f113a0a212fe6 100644 --- a/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts +++ b/src/plugins/visualizations/public/vis_types/vis_type_alias_registry.ts @@ -6,7 +6,7 @@ * Side Public License, v 1. */ -import { SavedObject } from '@kbn/core/types/saved_objects'; +import type { SimpleSavedObject } from '@kbn/core/public'; import { BaseVisType } from './base_vis_type'; export type VisualizationStage = 'experimental' | 'beta' | 'production'; @@ -30,7 +30,7 @@ export interface VisualizationListItem { export interface VisualizationsAppExtension { docTypes: string[]; searchFields?: string[]; - toListItem: (savedObject: SavedObject) => VisualizationListItem; + toListItem: (savedObject: SimpleSavedObject) => VisualizationListItem; } export interface VisTypeAlias { diff --git a/x-pack/plugins/maps/common/map_saved_object_type.ts b/x-pack/plugins/maps/common/map_saved_object_type.ts index b37c1af5949c1..5a8216ea49030 100644 --- a/x-pack/plugins/maps/common/map_saved_object_type.ts +++ b/x-pack/plugins/maps/common/map_saved_object_type.ts @@ -6,8 +6,7 @@ */ /* eslint-disable @typescript-eslint/consistent-type-definitions */ - -import { SavedObject } from '@kbn/core/types/saved_objects'; +import type { SimpleSavedObject } from '@kbn/core/public'; export type MapSavedObjectAttributes = { title: string; @@ -17,4 +16,4 @@ export type MapSavedObjectAttributes = { uiStateJSON?: string; }; -export type MapSavedObject = SavedObject; +export type MapSavedObject = SimpleSavedObject;