import { ComponentType } from 'react'; import { Reducer } from 'redux'; import { Registry, UrlQueryValue, VariableType } from '@grafana/data'; import { VariableEditorProps } from './editor/types'; import { VariablePickerProps } from './pickers/types'; import { VariablesState } from './state/types'; import { VariableModel, VariableOption } from './types'; export interface VariableAdapter { id: VariableType; description: string; name: string; initialState: Model; dependsOn: (variable: Model, variableToTest: Model) => boolean; setValue: (variable: Model, option: VariableOption, emitChanges?: boolean) => Promise; setValueFromUrl: (variable: Model, urlValue: UrlQueryValue) => Promise; updateOptions: (variable: Model, searchFilter?: string) => Promise; getSaveModel: (variable: Model, saveCurrentAsDefault?: boolean) => Partial; getValueForUrl: (variable: Model) => string | string[]; picker: ComponentType>; editor: ComponentType>; reducer: Reducer; beforeAdding?: (model: any) => any; } export const variableAdapters = new Registry>();