[DataViews] Remove some usage of any (#135767)

* fix editor warning

* use UrlFormatEditorFormatParams

* remove unnecessary any

* remove any from FieldFormatEditorFactory

* remove usage of any from src/plugins/data_view_field_editor

* remove usage of any from data_views/server/fetcher

* fix ts

* fix more ts

* back off changes in src/plugins/data_views/server/fetcher/

* pretty

* remove some unknown

* pretty

* fix ts

* retain null-ability

* fix lint

* fix test

* cleanup

* fixes in FieldFormatEditorFactory

* cleanup

* fix FieldFormatEditorStart

* revert functional diff

* knock out a few small any

* fix lint

* set up generic FieldFormatParams, SerializedFieldFormat, FormatFactory

* revert comment

* fix mistake

* use FormatEditorServiceSetup, FormatEditorServiceStart

* make defaultFieldFormatEditorFactories more type safe

* simplify types

* type fixes

* roll back re-leveling of fieldFormatEditors

* review feedback item

* public api correction

Co-authored-by: Matt Kime <matt@mattki.me>
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tim Sullivan 2022-07-13 08:55:06 -07:00 committed by GitHub
parent dec18895eb
commit ca2d1d6975
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 218 additions and 180 deletions

View file

@ -41,12 +41,12 @@ const ExampleCurrencyFormatEditor: FieldFormatEditor<{ currency: string }> = (pr
ExampleCurrencyFormatEditor.formatId = ExampleCurrencyFormat.id;
// 3. Wrap editor component in a factory. This is needed to support and encourage code-splitting.
const ExampleCurrencyFormatEditorFactory: FieldFormatEditorFactory<{
currency: string;
}> = async () => ExampleCurrencyFormatEditor;
const ExampleCurrencyFormatEditorFactory = async () => ExampleCurrencyFormatEditor;
ExampleCurrencyFormatEditorFactory.formatId = ExampleCurrencyFormatEditor.formatId;
export function registerExampleFormatEditor(indexPatternFieldEditor: IndexPatternFieldEditorSetup) {
// 4. Register a field editor. This should happen in setup plugin lifecycle phase.
indexPatternFieldEditor.fieldFormatEditors.register(ExampleCurrencyFormatEditorFactory);
indexPatternFieldEditor.fieldFormatEditors.register(
ExampleCurrencyFormatEditorFactory as FieldFormatEditorFactory
);
}