wip: typings

This commit is contained in:
Torkel Ödegaard
2019-01-18 17:19:35 +01:00
parent 4c9046d6c0
commit 98fabfae3e
10 changed files with 112 additions and 76 deletions

View File

@@ -11,7 +11,7 @@ import { getNextCharacter, getPreviousCousin } from 'app/features/explore/utils/
import BracesPlugin from 'app/features/explore/slate-plugins/braces';
import RunnerPlugin from 'app/features/explore/slate-plugins/runner';
import QueryField, { TypeaheadInput, QueryFieldState } from 'app/features/explore/QueryField';
import { DataQuery } from '@grafana/ui/src/types';
import { PromQuery } from '../types';
const HISTOGRAM_GROUP = '__histograms__';
const METRIC_MARK = 'metric';
@@ -88,13 +88,13 @@ interface CascaderOption {
interface PromQueryFieldProps {
datasource: any;
error?: string | JSX.Element;
initialQuery: DataQuery;
initialQuery: PromQuery;
hint?: any;
history?: any[];
metricsByPrefix?: CascaderOption[];
onClickHintFix?: (action: any) => void;
onPressEnter?: () => void;
onQueryChange?: (value: DataQuery, override?: boolean) => void;
onQueryChange?: (value: PromQuery, override?: boolean) => void;
}
interface PromQueryFieldState {
@@ -166,7 +166,7 @@ class PromQueryField extends React.PureComponent<PromQueryFieldProps, PromQueryF
// Send text change to parent
const { initialQuery, onQueryChange } = this.props;
if (onQueryChange) {
const query: DataQuery = {
const query: PromQuery = {
...initialQuery,
expr: value,
};