wip: moved plugin exports

This commit is contained in:
Torkel Ödegaard 2019-01-17 17:04:24 +01:00
parent dfe1b20f3d
commit a201c76c5f
8 changed files with 73 additions and 112 deletions

View File

@ -1,3 +1,4 @@
export * from './series';
export * from './time';
export * from './panel';
export * from './plugin';

View File

@ -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<PanelProps>;
PanelOptions?: ComponentClass<PanelOptionsProps>;
PanelDefaults?: any;
}

View File

@ -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';

View File

@ -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;

View File

@ -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;
}

View File

@ -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<PanelProps>;
PanelOptions?: ComponentClass<PanelOptionsProps>;
PanelDefaults?: any;
}
import { PluginExports } from '@grafana/ui/src/types';
export interface PanelPlugin {
id: string;

View File

@ -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[];

27
public/app/types/store.ts Normal file
View File

@ -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;
}