@grafana/aws-sdk 0.3.5 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/ConnectionConfig.js +35 -56
- package/dist/esm/components/ConnectionConfig.js.map +1 -1
- package/dist/esm/regions.js +9 -0
- package/dist/esm/regions.js.map +1 -1
- package/dist/esm/sql/ConfigEditor/ConfigSelect.js +0 -1
- package/dist/esm/sql/ConfigEditor/ConfigSelect.js.map +1 -1
- package/dist/esm/sql/ConfigEditor/InlineInput.js.map +1 -1
- package/dist/esm/sql/QueryEditor/FillValueSelect.js +4 -37
- package/dist/esm/sql/QueryEditor/FillValueSelect.js.map +1 -1
- package/dist/esm/sql/QueryEditor/FormatSelect.js +3 -13
- package/dist/esm/sql/QueryEditor/FormatSelect.js.map +1 -1
- package/dist/esm/sql/QueryEditor/QueryEditorHeader.js +3 -1
- package/dist/esm/sql/QueryEditor/QueryEditorHeader.js.map +1 -1
- package/dist/esm/sql/ResourceSelector.js +3 -26
- package/dist/esm/sql/ResourceSelector.js.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/index.d.ts +13 -19
- package/dist/index.js +53 -320
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/dist/esm/components/NewConnectionConfig.js +0 -200
- package/dist/esm/components/NewConnectionConfig.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Select
|
|
1
|
+
import { Select } from '@grafana/ui';
|
|
2
2
|
import { isEqual } from 'lodash';
|
|
3
3
|
import React, { useRef, useState, useMemo, useEffect } from 'react';
|
|
4
4
|
import { defaultKey } from './types.js';
|
|
@@ -102,7 +102,7 @@ function ResourceSelector(props) {
|
|
|
102
102
|
setIsLoading(false);
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
|
-
return /* @__PURE__ */ React.createElement(
|
|
105
|
+
return /* @__PURE__ */ React.createElement(
|
|
106
106
|
Select,
|
|
107
107
|
__spreadProps(__spreadValues({}, props), {
|
|
108
108
|
id: props.id,
|
|
@@ -115,30 +115,7 @@ function ResourceSelector(props) {
|
|
|
115
115
|
onOpenMenu: () => props.fetch && onClick(),
|
|
116
116
|
menuShouldPortal: true
|
|
117
117
|
})
|
|
118
|
-
)
|
|
119
|
-
InlineField,
|
|
120
|
-
{
|
|
121
|
-
label: props.label,
|
|
122
|
-
labelWidth: props.labelWidth,
|
|
123
|
-
tooltip: props.tooltip,
|
|
124
|
-
hidden: props.hidden,
|
|
125
|
-
htmlFor: props.id
|
|
126
|
-
},
|
|
127
|
-
/* @__PURE__ */ React.createElement("div", { "data-testid": props["data-testid"], title: props.title }, /* @__PURE__ */ React.createElement(
|
|
128
|
-
Select,
|
|
129
|
-
__spreadProps(__spreadValues({}, props), {
|
|
130
|
-
id: props.id,
|
|
131
|
-
inputId: props.id,
|
|
132
|
-
"aria-label": props.label,
|
|
133
|
-
options,
|
|
134
|
-
onChange,
|
|
135
|
-
isLoading,
|
|
136
|
-
className: props.className || "min-width-6",
|
|
137
|
-
onOpenMenu: () => props.fetch && onClick(),
|
|
138
|
-
menuShouldPortal: true
|
|
139
|
-
})
|
|
140
|
-
))
|
|
141
|
-
));
|
|
118
|
+
);
|
|
142
119
|
}
|
|
143
120
|
|
|
144
121
|
export { ResourceSelector };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResourceSelector.js","sources":["../../../src/sql/ResourceSelector.tsx"],"sourcesContent":["import { SelectableValue } from '@grafana/data';\nimport {
|
|
1
|
+
{"version":3,"file":"ResourceSelector.js","sources":["../../../src/sql/ResourceSelector.tsx"],"sourcesContent":["import { SelectableValue } from '@grafana/data';\nimport { Select, SelectCommonProps } from '@grafana/ui';\nimport { isEqual } from 'lodash';\nimport React, { useEffect, useMemo, useState, DependencyList, useRef } from 'react';\n\nimport { defaultKey } from './types';\n\nexport interface ResourceSelectorProps extends SelectCommonProps<string> {\n // props for old form styling\n tooltip?: string;\n hidden?: boolean;\n\n value: string | null;\n dependencies?: DependencyList;\n id: string;\n label: string;\n 'data-testid'?: string;\n // Options only needed for QueryEditor\n default?: string;\n // Options only needed for the ConfigEditor\n title?: string;\n labelWidth?: number;\n saveOptions?: () => Promise<void>;\n // Either set a way of fetching resources or the resource list\n fetch?: () => Promise<Array<string | SelectableValue<string>>>;\n resources?: string[];\n onChange: (e: SelectableValue<string> | null) => void;\n}\n\nexport function ResourceSelector(props: ResourceSelectorProps) {\n const propsDependencies = props.dependencies;\n const propsOnChange = props.onChange;\n\n const dependencies = useRef(props.dependencies);\n const fetched = useRef<boolean>(false);\n const resource = useRef<string | null>(props.value || props.default || null);\n\n const [resources, setResources] = useState<Array<string | SelectableValue>>(\n resource.current ? [resource.current] : []\n );\n const [isLoading, setIsLoading] = useState(false);\n\n const defaultOpts = useMemo(() => {\n const opts: Array<SelectableValue<string>> = [\n {\n label: `default (${props.default})`,\n value: defaultKey,\n description: `Default value set in the data source`,\n },\n ];\n if (props.value && props.value !== defaultKey) {\n opts.push({ label: props.value, value: props.value });\n }\n return opts;\n }, [props.default, props.value]);\n const [options, setOptions] = useState<Array<SelectableValue<string>>>(props.default ? defaultOpts : []);\n useEffect(() => {\n if (props.resources !== undefined) {\n setResources(props.resources);\n }\n }, [props.resources]);\n useEffect(() => {\n const newOptions: Array<SelectableValue<string>> = props.default ? defaultOpts : [];\n if (resources.length) {\n resources.forEach((r) => {\n const value = typeof r === 'string' ? r : r.value;\n if (!newOptions.find((o) => o.value === value)) {\n typeof r === 'string' ? newOptions.push({ label: r, value: r }) : newOptions.push(r);\n }\n });\n setOptions(newOptions);\n } else {\n setOptions([]);\n }\n }, [resources, defaultOpts, props.default]);\n\n useEffect(() => {\n // A change in the dependencies cause a state clean-up\n if (!isEqual(propsDependencies, dependencies.current)) {\n fetched.current = false;\n resource.current = null;\n dependencies.current = propsDependencies;\n propsOnChange(null);\n }\n }, [propsDependencies, propsOnChange]);\n\n const fetch = async () => {\n if (fetched.current) {\n return;\n }\n if (props.saveOptions) {\n await props.saveOptions();\n }\n try {\n const resources = (await props.fetch?.()) || [];\n setResources(resources);\n } finally {\n fetched.current = true;\n }\n };\n\n const onChange = (e: SelectableValue<string>) => {\n propsOnChange(e);\n if (e.value) {\n resource.current = e.value;\n }\n };\n const onClick = async () => {\n setIsLoading(true);\n try {\n await fetch();\n } finally {\n setIsLoading(false);\n }\n };\n\n return <Select\n {...props}\n id={props.id}\n inputId={props.id}\n aria-label={props.label}\n options={options}\n onChange={onChange}\n isLoading={isLoading}\n className={props.className || 'min-width-6'}\n onOpenMenu={() => props.fetch && onClick()}\n menuShouldPortal={true}\n />\n\n}\n"],"names":["resources"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA6BO,SAAS,iBAAiB,KAA8B,EAAA;AAC7D,EAAA,MAAM,oBAAoB,KAAM,CAAA,YAAA,CAAA;AAChC,EAAA,MAAM,gBAAgB,KAAM,CAAA,QAAA,CAAA;AAE5B,EAAM,MAAA,YAAA,GAAe,MAAO,CAAA,KAAA,CAAM,YAAY,CAAA,CAAA;AAC9C,EAAM,MAAA,OAAA,GAAU,OAAgB,KAAK,CAAA,CAAA;AACrC,EAAA,MAAM,WAAW,MAAsB,CAAA,KAAA,CAAM,KAAS,IAAA,KAAA,CAAM,WAAW,IAAI,CAAA,CAAA;AAE3E,EAAM,MAAA,CAAC,SAAW,EAAA,YAAY,CAAI,GAAA,QAAA;AAAA,IAChC,SAAS,OAAU,GAAA,CAAC,QAAS,CAAA,OAAO,IAAI,EAAC;AAAA,GAC3C,CAAA;AACA,EAAA,MAAM,CAAC,SAAA,EAAW,YAAY,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAEhD,EAAM,MAAA,WAAA,GAAc,QAAQ,MAAM;AAChC,IAAA,MAAM,IAAuC,GAAA;AAAA,MAC3C;AAAA,QACE,KAAA,EAAO,YAAY,KAAM,CAAA,OAAA,CAAA,CAAA,CAAA;AAAA,QACzB,KAAO,EAAA,UAAA;AAAA,QACP,WAAa,EAAA,CAAA,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AA,KAAA,CAAA;AAAA,KACvB;AAAA,GACF,CAAA;AACA,EAAA,MAAM,UAAU,YAAY;AAC1B,IAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AACjB,IAAI,IAAA;AACF,MAAA,MAAM,KAAM,EAAA,CAAA;AAAA,KACZ,SAAA;AACA,MAAA,YAAA,CAAa,KAAK,CAAA,CAAA;AAAA,KACpB;AAAA,GACF,CAAA;AAEA,EAAO,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,MAAA;AAAA,IAAA,aAAA,CAAA,cAAA,CAAA,EAAA,EACI,KADJ,CAAA,EAAA;AAAA,MAEA,IAAI,KAAM,CAAA,EAAA;AAAA,MACV,SAAS,KAAM,CAAA,EAAA;AAAA,MACf,cAAY,KAAM,CAAA,KAAA;AAAA,MAClB,OAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAA;AAAA,MACA,SAAA,EAAW,MAAM,SAAa,IAAA,aAAA;AAAA,MAC9B,UAAY,EAAA,MAAM,KAAM,CAAA,KAAA,IAAS,OAAQ,EAAA;AAAA,MACzC,gBAAkB,EAAA,IAAA;AAAA,KAAA,CAAA;AAAA,GACpB,CAAA;AAER;;;;"}
|
package/dist/esm/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import type { DataSourceJsonData, DataSourcePluginOptionsEditorProps, DataSourceSettings } from '@grafana/data';\n\nexport enum AwsAuthType {\n Keys = 'keys',\n Credentials = 'credentials',\n Default = 'default', // was 'arn',\n EC2IAMRole = 'ec2_iam_role',\n /**\n * @deprecated use default\n */\n ARN = 'arn',\n GrafanaAssumeRole = 'grafana_assume_role'\n}\n\nexport interface AwsAuthDataSourceJsonData extends DataSourceJsonData {\n authType?: AwsAuthType;\n assumeRoleArn?: string;\n externalId?: string;\n profile?: string; // Credentials profile name, as specified in ~/.aws/credentials\n defaultRegion?: string; // region if it is not defined by your credentials file\n endpoint?: string;\n}\n\nexport interface AwsAuthDataSourceSecureJsonData {\n accessKey?: string;\n secretKey?: string;\n sessionToken?: string;\n}\n\nexport type AwsAuthDataSourceSettings = DataSourceSettings<AwsAuthDataSourceJsonData, AwsAuthDataSourceSecureJsonData>;\n\nexport interface ConnectionConfigProps<\n J extends AwsAuthDataSourceJsonData = AwsAuthDataSourceJsonData,\n S = AwsAuthDataSourceSecureJsonData\n> extends DataSourcePluginOptionsEditorProps<J, S> {\n standardRegions?: string[];\n loadRegions?: () => Promise<string[]>;\n defaultEndpoint?: string;\n skipHeader?: boolean;\n skipEndpoint?: boolean;\n children?: React.ReactNode;\n labelWidth?: number;\n inExperimentalAuthComponent?: boolean;\n externalId?: string;\n
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import type { DataSourceJsonData, DataSourcePluginOptionsEditorProps, DataSourceSettings } from '@grafana/data';\n\nexport enum AwsAuthType {\n Keys = 'keys',\n Credentials = 'credentials',\n Default = 'default', // was 'arn',\n EC2IAMRole = 'ec2_iam_role',\n /**\n * @deprecated use default\n */\n ARN = 'arn',\n GrafanaAssumeRole = 'grafana_assume_role'\n}\n\nexport interface AwsAuthDataSourceJsonData extends DataSourceJsonData {\n authType?: AwsAuthType;\n assumeRoleArn?: string;\n externalId?: string;\n profile?: string; // Credentials profile name, as specified in ~/.aws/credentials\n defaultRegion?: string; // region if it is not defined by your credentials file\n endpoint?: string;\n}\n\nexport interface AwsAuthDataSourceSecureJsonData {\n accessKey?: string;\n secretKey?: string;\n sessionToken?: string;\n}\n\nexport type AwsAuthDataSourceSettings = DataSourceSettings<AwsAuthDataSourceJsonData, AwsAuthDataSourceSecureJsonData>;\n\nexport interface ConnectionConfigProps<\n J extends AwsAuthDataSourceJsonData = AwsAuthDataSourceJsonData,\n S = AwsAuthDataSourceSecureJsonData\n> extends DataSourcePluginOptionsEditorProps<J, S> {\n standardRegions?: string[];\n loadRegions?: () => Promise<string[]>;\n defaultEndpoint?: string;\n skipHeader?: boolean;\n skipEndpoint?: boolean;\n children?: React.ReactNode;\n labelWidth?: number;\n inExperimentalAuthComponent?: boolean;\n externalId?: string;\n}\n"],"names":["AwsAuthType"],"mappings":"AAEY,IAAA,WAAA,qBAAAA,YAAL,KAAA;AACL,EAAAA,aAAA,MAAO,CAAA,GAAA,MAAA,CAAA;AACP,EAAAA,aAAA,aAAc,CAAA,GAAA,aAAA,CAAA;AACd,EAAAA,aAAA,SAAU,CAAA,GAAA,SAAA,CAAA;AACV,EAAAA,aAAA,YAAa,CAAA,GAAA,cAAA,CAAA;AAIb,EAAAA,aAAA,KAAM,CAAA,GAAA,KAAA,CAAA;AACN,EAAAA,aAAA,mBAAoB,CAAA,GAAA,qBAAA,CAAA;AATV,EAAAA,OAAAA,YAAAA,CAAAA;AAAA,CAAA,EAAA,WAAA,IAAA,EAAA;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import React$1, { FC, DependencyList } from 'react';
|
|
2
|
+
import React$1, { FC, FormEvent, DependencyList } from 'react';
|
|
3
3
|
import { DataSourceJsonData, DataSourceSettings, DataSourcePluginOptionsEditorProps, SelectableValue, DataQuery, DataSourceApi, QueryEditorProps, ScopedVars } from '@grafana/data';
|
|
4
4
|
import { InputActionMeta, SelectCommonProps, CodeEditorSuggestionItem, CodeEditorMonacoOptions } from '@grafana/ui';
|
|
5
|
-
import { FormEvent } from 'react-dom/node_modules/@types/react';
|
|
6
5
|
|
|
7
6
|
declare enum AwsAuthType {
|
|
8
7
|
Keys = "keys",
|
|
@@ -28,7 +27,7 @@ interface AwsAuthDataSourceSecureJsonData {
|
|
|
28
27
|
secretKey?: string;
|
|
29
28
|
sessionToken?: string;
|
|
30
29
|
}
|
|
31
|
-
|
|
30
|
+
type AwsAuthDataSourceSettings = DataSourceSettings<AwsAuthDataSourceJsonData, AwsAuthDataSourceSecureJsonData>;
|
|
32
31
|
interface ConnectionConfigProps<J extends AwsAuthDataSourceJsonData = AwsAuthDataSourceJsonData, S = AwsAuthDataSourceSecureJsonData> extends DataSourcePluginOptionsEditorProps<J, S> {
|
|
33
32
|
standardRegions?: string[];
|
|
34
33
|
loadRegions?: () => Promise<string[]>;
|
|
@@ -39,13 +38,12 @@ interface ConnectionConfigProps<J extends AwsAuthDataSourceJsonData = AwsAuthDat
|
|
|
39
38
|
labelWidth?: number;
|
|
40
39
|
inExperimentalAuthComponent?: boolean;
|
|
41
40
|
externalId?: string;
|
|
42
|
-
newFormStylingEnabled?: boolean;
|
|
43
41
|
}
|
|
44
42
|
|
|
45
43
|
declare const DEFAULT_LABEL_WIDTH = 28;
|
|
46
44
|
declare const ConnectionConfig: FC<ConnectionConfigProps>;
|
|
47
45
|
|
|
48
|
-
declare function Divider(): JSX.Element;
|
|
46
|
+
declare function Divider(): React$1.JSX.Element;
|
|
49
47
|
|
|
50
48
|
interface SIGV4ConnectionConfigProps extends DataSourcePluginOptionsEditorProps<any, any> {
|
|
51
49
|
inExperimentalAuthComponent?: boolean;
|
|
@@ -85,9 +83,8 @@ interface ConfigSelectProps extends DataSourcePluginOptionsEditorProps<AwsAuthDa
|
|
|
85
83
|
width?: number;
|
|
86
84
|
isOptionDisabled?: () => boolean;
|
|
87
85
|
labelWidth?: number;
|
|
88
|
-
newFormStylingEnabled?: boolean;
|
|
89
86
|
}
|
|
90
|
-
declare function ConfigSelect(props: ConfigSelectProps): JSX.Element;
|
|
87
|
+
declare function ConfigSelect(props: ConfigSelectProps): React$1.JSX.Element;
|
|
91
88
|
|
|
92
89
|
interface InlineInputProps extends DataSourcePluginOptionsEditorProps<{}, AwsAuthDataSourceSecureJsonData> {
|
|
93
90
|
value: string;
|
|
@@ -100,12 +97,11 @@ interface InlineInputProps extends DataSourcePluginOptionsEditorProps<{}, AwsAut
|
|
|
100
97
|
disabled?: boolean;
|
|
101
98
|
labelWidth?: number;
|
|
102
99
|
}
|
|
103
|
-
declare function InlineInput(props: InlineInputProps): JSX.Element;
|
|
100
|
+
declare function InlineInput(props: InlineInputProps): React$1.JSX.Element;
|
|
104
101
|
|
|
105
102
|
interface ResourceSelectorProps extends SelectCommonProps<string> {
|
|
106
103
|
tooltip?: string;
|
|
107
104
|
hidden?: boolean;
|
|
108
|
-
newFormStylingEnabled?: boolean;
|
|
109
105
|
value: string | null;
|
|
110
106
|
dependencies?: DependencyList;
|
|
111
107
|
id: string;
|
|
@@ -119,20 +115,19 @@ interface ResourceSelectorProps extends SelectCommonProps<string> {
|
|
|
119
115
|
resources?: string[];
|
|
120
116
|
onChange: (e: SelectableValue<string> | null) => void;
|
|
121
117
|
}
|
|
122
|
-
declare function ResourceSelector(props: ResourceSelectorProps): JSX.Element;
|
|
118
|
+
declare function ResourceSelector(props: ResourceSelectorProps): React$1.JSX.Element;
|
|
123
119
|
|
|
124
120
|
declare enum FillValueOptions {
|
|
125
121
|
Previous = 0,
|
|
126
122
|
Null = 1,
|
|
127
123
|
Value = 2
|
|
128
124
|
}
|
|
129
|
-
|
|
125
|
+
type FillValueSelectProps<TQuery extends DataQuery> = {
|
|
130
126
|
query: TQuery;
|
|
131
127
|
onChange: (value: TQuery) => void;
|
|
132
|
-
newFormStylingEnabled?: boolean;
|
|
133
128
|
onRunQuery?: () => void;
|
|
134
129
|
};
|
|
135
|
-
declare function FillValueSelect<TQuery extends DataQuery & Record<string, any>>(props: FillValueSelectProps<TQuery>): JSX.Element;
|
|
130
|
+
declare function FillValueSelect<TQuery extends DataQuery & Record<string, any>>(props: FillValueSelectProps<TQuery>): React$1.JSX.Element;
|
|
136
131
|
|
|
137
132
|
interface SQLQuery extends DataQuery {
|
|
138
133
|
rawSQL: string;
|
|
@@ -143,7 +138,7 @@ interface SQLQuery extends DataQuery {
|
|
|
143
138
|
};
|
|
144
139
|
}
|
|
145
140
|
|
|
146
|
-
|
|
141
|
+
type EditorProps = {
|
|
147
142
|
width?: number | string;
|
|
148
143
|
height?: number | string;
|
|
149
144
|
readOnly?: boolean;
|
|
@@ -151,7 +146,7 @@ declare type EditorProps = {
|
|
|
151
146
|
showLineNumbers?: boolean;
|
|
152
147
|
monacoOptions?: CodeEditorMonacoOptions;
|
|
153
148
|
};
|
|
154
|
-
|
|
149
|
+
type Props$1<TQuery extends DataQuery> = {
|
|
155
150
|
query: TQuery;
|
|
156
151
|
language: string;
|
|
157
152
|
editorProps?: EditorProps;
|
|
@@ -159,7 +154,7 @@ declare type Props$1<TQuery extends DataQuery> = {
|
|
|
159
154
|
onRunQuery: () => void;
|
|
160
155
|
getSuggestions: (query: TQuery) => CodeEditorSuggestionItem[];
|
|
161
156
|
};
|
|
162
|
-
declare function QueryCodeEditor<TQuery extends DataQuery>(props: Props$1<TQuery>): JSX.Element;
|
|
157
|
+
declare function QueryCodeEditor<TQuery extends DataQuery>(props: Props$1<TQuery>): React$1.JSX.Element;
|
|
163
158
|
|
|
164
159
|
interface Props<Datasource extends DataSourceApi<TQuery, JsonData>, TQuery extends DataQuery, JsonData extends DataSourceJsonData> extends QueryEditorProps<Datasource, TQuery, JsonData> {
|
|
165
160
|
showAsyncQueryButtons?: boolean;
|
|
@@ -171,15 +166,14 @@ interface Props<Datasource extends DataSourceApi<TQuery, JsonData>, TQuery exten
|
|
|
171
166
|
}
|
|
172
167
|
declare function QueryEditorHeader<Datasource extends DataSourceApi<TQuery, JsonData>, TQuery extends DataQuery, JsonData extends DataSourceJsonData>({ query, showAsyncQueryButtons, extraHeaderElementLeft, extraHeaderElementRight, enableRunButton, onRunQuery, data, cancel, }: Props<Datasource, TQuery, JsonData>): JSX.Element;
|
|
173
168
|
|
|
174
|
-
|
|
175
|
-
newFormStylingEnabled?: boolean;
|
|
169
|
+
type FormatSelectProps<TQuery extends DataQuery, FormatOptions> = {
|
|
176
170
|
id?: string;
|
|
177
171
|
query: TQuery;
|
|
178
172
|
options: Array<SelectableValue<FormatOptions>>;
|
|
179
173
|
onChange: (value: TQuery) => void;
|
|
180
174
|
onRunQuery?: () => void;
|
|
181
175
|
};
|
|
182
|
-
declare function FormatSelect<TQuery extends DataQuery & Record<string, any>, FormatOptions>(props: FormatSelectProps<TQuery, FormatOptions>): JSX.Element;
|
|
176
|
+
declare function FormatSelect<TQuery extends DataQuery & Record<string, any>, FormatOptions>(props: FormatSelectProps<TQuery, FormatOptions>): React$1.JSX.Element;
|
|
183
177
|
|
|
184
178
|
/**
|
|
185
179
|
* Do not execute queries that do not exist yet
|