Saved objects: improve typesafety (#140099)

* Remove SavedObjectAttributes from examples

* Remove SavedObjectAttributes from dev_docs

* Deprecate SavedObjectAttributes type

* Remove SavedObjectAttributes from kibana_usage_collection plugin

* Remove low hanging SavedObjectAttributes in security_solution

* Remove low hanging SavedObjectAttributes in upgrade_assistant

* Remove low hanging SavedObjectAttributes in lens

* Stricter types for SavedObjectsServiceSetup.registerType

* Review feedback

* Some more low hanging fruit

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Rudolf Meijering 2022-09-13 09:56:29 +02:00 committed by GitHub
parent c9628fc0be
commit 191bfbc97e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 47 additions and 89 deletions

View file

@ -7,7 +7,6 @@
*/
import type { KibanaRequest } from '@kbn/core-http-server';
import type { SavedObjectAttributes } from '@kbn/core-saved-objects-common';
import type {
SavedObjectsClientContract,
ISavedObjectsRepository,
@ -124,9 +123,7 @@ export interface SavedObjectsServiceSetup {
* }
* ```
*/
registerType: <Attributes extends SavedObjectAttributes = any>(
type: SavedObjectsType<Attributes>
) => void;
registerType: <Attributes = unknown>(type: SavedObjectsType<Attributes>) => void;
/**
* Returns the default index used for saved objects.