diff --git a/packages/grafana-ui/src/types/index.ts b/packages/grafana-ui/src/types/index.ts index f618ce6db34..7d8fabeb092 100644 --- a/packages/grafana-ui/src/types/index.ts +++ b/packages/grafana-ui/src/types/index.ts @@ -1,3 +1,4 @@ export * from './series'; export * from './time'; export * from './panel'; +export * from './plugin'; diff --git a/packages/grafana-ui/src/types/plugin.ts b/packages/grafana-ui/src/types/plugin.ts new file mode 100644 index 00000000000..9abeba583d5 --- /dev/null +++ b/packages/grafana-ui/src/types/plugin.ts @@ -0,0 +1,20 @@ +import { ComponentClass } from 'react'; +import { PanelProps, PanelOptionsProps } from './panel'; + +export interface PluginExports { + Datasource?: any; + QueryCtrl?: any; + QueryEditor?: any; + ConfigCtrl?: any; + AnnotationsQueryCtrl?: any; + VariableQueryEditor?: any; + ExploreQueryField?: any; + ExploreStartPage?: any; + + // Panel plugin + PanelCtrl?: any; + Panel?: ComponentClass; + PanelOptions?: ComponentClass; + PanelDefaults?: any; +} + diff --git a/public/app/features/plugins/plugin_loader.ts b/public/app/features/plugins/plugin_loader.ts index 3c4fa29382d..206edf0bd9d 100644 --- a/public/app/features/plugins/plugin_loader.ts +++ b/public/app/features/plugins/plugin_loader.ts @@ -18,7 +18,7 @@ import config from 'app/core/config'; import TimeSeries from 'app/core/time_series2'; import TableModel from 'app/core/table_model'; import { coreModule, appEvents, contextSrv } from 'app/core/core'; -import { PluginExports } from 'app/types/plugins'; +import { PluginExports } from '@grafana/ui'; import * as datemath from 'app/core/utils/datemath'; import * as fileExport from 'app/core/utils/file_export'; import * as flatten from 'app/core/utils/flatten'; diff --git a/public/app/types/datasources.ts b/public/app/types/datasources.ts index 5670d762d77..f2c2478e78b 100644 --- a/public/app/types/datasources.ts +++ b/public/app/types/datasources.ts @@ -1,5 +1,6 @@ import { LayoutMode } from '../core/components/LayoutSelector/LayoutSelector'; -import { Plugin, PluginExports, PluginMeta } from './plugins'; +import { Plugin, PluginMeta } from './plugins'; +import { PluginExports } from '@grafana/ui'; export interface DataSource { id: number; diff --git a/public/app/types/index.ts b/public/app/types/index.ts index ad9f19e2c9f..5b43d1909e3 100644 --- a/public/app/types/index.ts +++ b/public/app/types/index.ts @@ -1,90 +1,20 @@ -import { Team, TeamsState, TeamState, TeamGroup, TeamMember } from './teams'; -import { AlertRuleDTO, AlertRule, AlertRulesState } from './alerting'; -import { LocationState, LocationUpdate, UrlQueryMap, UrlQueryValue } from './location'; -import { NavModel, NavModelItem, NavIndex } from './navModel'; -import { FolderDTO, FolderState, FolderInfo } from './folders'; -import { DashboardState } from './dashboard'; -import { DashboardAcl, OrgRole, PermissionLevel } from './acl'; -import { ApiKey, ApiKeysState, NewApiKey } from './apiKeys'; -import { Invitee, OrgUser, User, UsersState, UserState } from './user'; -import { DataSource, DataSourceSelectItem, DataSourcesState } from './datasources'; -import { DataQuery, DataQueryResponse, DataQueryOptions } from './series'; -import { PluginDashboard, PluginMeta, Plugin, PanelPlugin, PluginsState } from './plugins'; -import { Organization, OrganizationState } from './organization'; -import { - AppNotification, - AppNotificationSeverity, - AppNotificationsState, - AppNotificationTimeout, -} from './appNotifications'; -import { DashboardSearchHit } from './search'; -import { ValidationEvents, ValidationRule } from './form'; -import { ExploreState } from './explore'; -export { - Team, - TeamsState, - TeamState, - TeamGroup, - TeamMember, - AlertRuleDTO, - AlertRule, - AlertRulesState, - LocationState, - LocationUpdate, - NavModel, - NavModelItem, - NavIndex, - UrlQueryMap, - UrlQueryValue, - FolderDTO, - FolderState, - FolderInfo, - DashboardState, - DashboardAcl, - OrgRole, - PermissionLevel, - DataSource, - DataSourceSelectItem, - PluginMeta, - ApiKey, - ApiKeysState, - NewApiKey, - Plugin, - PluginsState, - DataSourcesState, - Invitee, - OrgUser, - User, - UsersState, - PanelPlugin, - DataQuery, - DataQueryResponse, - DataQueryOptions, - PluginDashboard, - Organization, - OrganizationState, - AppNotification, - AppNotificationsState, - AppNotificationSeverity, - AppNotificationTimeout, - DashboardSearchHit, - UserState, - ValidationEvents, - ValidationRule, -}; +export * from './teams'; +export * from './alerting'; +export * from './location'; +export * from './navModel'; +export * from './folders'; +export * from './dashboard'; +export * from './acl'; +export * from './apiKeys'; +export * from './user'; +export * from './datasources'; +export * from './series'; +export * from './plugins'; +export * from './organization'; +export * from './appNotifications'; +export * from './search'; +export * from './form'; +export * from './explore'; +export * from './store'; + -export interface StoreState { - navIndex: NavIndex; - location: LocationState; - alertRules: AlertRulesState; - teams: TeamsState; - team: TeamState; - folder: FolderState; - dashboard: DashboardState; - dataSources: DataSourcesState; - explore: ExploreState; - users: UsersState; - organization: OrganizationState; - appNotifications: AppNotificationsState; - user: UserState; -} diff --git a/public/app/types/plugins.ts b/public/app/types/plugins.ts index 4dacb3f8ccb..632e301613b 100644 --- a/public/app/types/plugins.ts +++ b/public/app/types/plugins.ts @@ -1,22 +1,4 @@ -import { ComponentClass } from 'react'; -import { PanelProps, PanelOptionsProps } from '@grafana/ui'; - -export interface PluginExports { - Datasource?: any; - QueryCtrl?: any; - QueryEditor?: any; - ConfigCtrl?: any; - AnnotationsQueryCtrl?: any; - VariableQueryEditor?: any; - ExploreQueryField?: any; - ExploreStartPage?: any; - - // Panel plugin - PanelCtrl?; - Panel?: ComponentClass; - PanelOptions?: ComponentClass; - PanelDefaults?: any; -} +import { PluginExports } from '@grafana/ui/src/types'; export interface PanelPlugin { id: string; diff --git a/public/app/types/series.ts b/public/app/types/series.ts index 6f1795ef544..c07e543d8b5 100644 --- a/public/app/types/series.ts +++ b/public/app/types/series.ts @@ -1,5 +1,5 @@ -import { PluginMeta, PluginExports } from './plugins'; -import { TimeSeries, TimeRange, RawTimeRange } from '@grafana/ui'; +import { PluginMeta } from './plugins'; +import { TimeSeries, TimeRange, RawTimeRange, PluginExports } from '@grafana/ui'; export interface DataQueryResponse { data: TimeSeries[]; diff --git a/public/app/types/store.ts b/public/app/types/store.ts new file mode 100644 index 00000000000..0f5ad8cd088 --- /dev/null +++ b/public/app/types/store.ts @@ -0,0 +1,27 @@ +import { NavIndex } from './navModel'; +import { LocationState } from './location'; +import { AlertRulesState } from './alerting'; +import { TeamsState, TeamState } from './teams'; +import { FolderState } from './folders'; +import { DashboardState } from './dashboard'; +import { DataSourcesState } from './datasources'; +import { ExploreState } from './explore'; +import { UsersState, UserState } from './user'; +import { OrganizationState } from './organization'; +import { AppNotificationsState } from './appNotifications'; + +export interface StoreState { + navIndex: NavIndex; + location: LocationState; + alertRules: AlertRulesState; + teams: TeamsState; + team: TeamState; + folder: FolderState; + dashboard: DashboardState; + dataSources: DataSourcesState; + explore: ExploreState; + users: UsersState; + organization: OrganizationState; + appNotifications: AppNotificationsState; + user: UserState; +}