88import { ComponentType , NamedExoticComponent , ReactElement , ReactNode , VFC } from 'react' ;
99import { CoreStart } from '@kbn/core/public' ;
1010import { DataPublicPluginStart } from '@kbn/data-plugin/public' ;
11- import {
12- DataViewField ,
13- DataViewsPublicPluginStart ,
14- FieldSpec ,
15- } from '@kbn/data-views-plugin/public' ;
11+ import { DataViewsPublicPluginStart , FieldSpec } from '@kbn/data-views-plugin/public' ;
1612import { Storage } from '@kbn/kibana-utils-plugin/public' ;
1713import { TimelinesUIStart } from '@kbn/timelines-plugin/public' ;
1814import type { TriggersAndActionsUIPublicPluginStart as TriggersActionsStart } from '@kbn/triggers-actions-ui-plugin/public' ;
@@ -26,7 +22,7 @@ import { CreateExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-
2622import { Policy } from './modules/block_list/hooks/use_policies' ;
2723
2824export interface SecuritySolutionDataViewBase extends DataViewBase {
29- fields : Array < FieldSpec & DataViewField > ;
25+ fields : FieldSpec [ ] ;
3026}
3127
3228// eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -64,12 +60,7 @@ export interface LicenseAware {
6460
6561export type BrowserFields = Readonly < Record < string , Partial < BrowserField > > > ;
6662
67- export interface SourcererDataView {
68- indexPattern : SecuritySolutionDataViewBase ;
69- browserFields : BrowserFields ;
70- selectedPatterns : string [ ] ;
71- loading : boolean ;
72- }
63+ export type SourcererDataView = any ;
7364
7465export interface UseInvestigateInTimelineProps {
7566 dataProviders : DataProvider [ ] ;
@@ -101,6 +92,35 @@ export interface Blocking {
10192 getFormComponent : ( ) => NamedExoticComponent < BlockListFormProps > ;
10293}
10394
95+ /**
96+ * Combined data from SourcererDataView and SourcererScope to create
97+ * selected data view state
98+ */
99+ export interface SelectedDataView {
100+ /**
101+ * @deprecated use EcsFlat or fields / indexFields from data view
102+ */
103+ browserFields : SourcererDataView [ 'browserFields' ] ;
104+
105+ /**
106+ * @deprecated use sourcererDataView
107+ * DataViewBase with enhanced index fields used in timelines
108+ */
109+ indexPattern : SecuritySolutionDataViewBase ;
110+ /** do the selected indices exist */
111+ indicesExist : boolean ;
112+ /** is an update being made to the data view */
113+ loading : boolean ;
114+
115+ /**
116+ * Easier to add this additional data rather than
117+ * try to extend the SelectedDataView type from DataView.
118+ */
119+ sourcererDataView : SourcererDataView ;
120+
121+ selectedPatterns : string [ ] ;
122+ }
123+
104124/**
105125 * Methods exposed from the security solution to the threat intelligence application.
106126 */
@@ -123,7 +143,7 @@ export interface SecuritySolutionPluginContext {
123143 /**
124144 * Gets Security Solution shared information like browerFields, indexPattern and selectedPatterns in DataView.
125145 */
126- sourcererDataView : SourcererDataView ;
146+ selectedDataView : SelectedDataView ;
127147
128148 /**
129149 * Security Solution store
0 commit comments