import { Query , Filter } from 'src/plugins/data/public' ; import { SavedObject as SavedObjectType , SavedObjectAttributes } from 'src/core/public' ; import { SavedDashboardPanel730ToLatest } from '../common' ; import { ViewMode } from './embeddable_plugin' ; export interface DashboardCapabilities { showWriteControls : boolean ; createNew : boolean ; } export type SavedObjectAttribute = string | number | boolean | null | undefined | SavedObjectAttributes | SavedObjectAttributes [ ] ; export interface SimpleSavedObject < T extends SavedObjectAttributes > { attributes : T ; _version ? : SavedObjectType < T > [ 'version' ] ; id : SavedObjectType < T > [ 'id' ] ; type : SavedObjectType < T > [ 'type' ] ; migrationVersion : SavedObjectType < T > [ 'migrationVersion' ] ; error : SavedObjectType < T > [ 'error' ] ; references : SavedObjectType < T > [ 'references' ] ; get ( key ) : any ; set ( key , value ) : T ; has ( key ) : boolean ; save ( ) : Promise < SimpleSavedObject < T > > ; delete ( ) : void ; } interface FieldSubType { multi ? : { parent : string ; } ; nested ? : { path : string ; } ; } export interface Field { name : string ; type : string ; esTypes ? : string [ ] ; aggregatable : boolean ; filterable : boolean ; searchable : boolean ; subType ? : FieldSubType ; } export type NavAction = ( anchorElement ? : any ) => void ; /**
 * This should always represent the latest dashboard panel shape, after all possible migrations.
 */ export type SavedDashboardPanel = SavedDashboardPanel730ToLatest ; export interface DashboardAppState { panels : SavedDashboardPanel [ ] ; fullScreenMode : boolean ; title : string ; description : string ; timeRestore : boolean ; options : { hidePanelTitles : boolean ; useMargins : boolean ; } ; query : Query | string ; filters : Filter [ ] ; viewMode : ViewMode ; expandedPanelId ? : string ; savedQuery ? : string ; } export type DashboardAppStateDefaults = DashboardAppState & { description ? : string ; } ; /**
 * In URL panels are optional,
 * Panels are not added to the URL when in "view" mode
 */ export type DashboardAppStateInUrl = Omit < DashboardAppState , 'panels' > & { panels ? : SavedDashboardPanel [ ] ; } ; export interface DashboardAppStateTransitions { set : ( state : DashboardAppState ) => < T extends keyof DashboardAppState > ( prop : T , value : DashboardAppState [ T ] ) => DashboardAppState ; setOption : ( state : DashboardAppState ) => < T extends keyof DashboardAppState [ 'options' ] > ( prop : T , value : DashboardAppState [ 'options' ] [ T ] ) => DashboardAppState ; } export interface SavedDashboardPanelMap { [ key ] : SavedDashboardPanel ; } export interface StagedFilter { field : string ; value : string ; operator : string ; index : string ; }