@grafana/k6-test-builder 0.2.7

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.
@@ -0,0 +1,1406 @@
1
+ import { ChangeEventHandler, FocusEventHandler, AnchorHTMLAttributes, ReactNode, ElementType, ReactElement, FunctionComponent } from "react";
2
+ import { ThemeOptions } from "@material-ui/core/styles/createTheme";
3
+ import { InvalidArchiveError } from "har-to-k6";
4
+ /** @todo move this type */
5
+ interface K6LoadZone {
6
+ k6_load_zone_id: string;
7
+ country: string;
8
+ city: string;
9
+ }
10
+ type LoadZoneDistribution = 'even' | 'manual';
11
+ export interface RampingStage {
12
+ id: string;
13
+ target: '' | number | null;
14
+ duration: string;
15
+ }
16
+ declare const ScenarioExecutor: {
17
+ readonly SharedIterations: "shared-iterations";
18
+ readonly PerVUIterations: "per-vu-iterations";
19
+ readonly ConstantVUs: "constant-vus";
20
+ readonly RampingVUs: "ramping-vus";
21
+ readonly ConstantArrivalRate: "constant-arrival-rate";
22
+ readonly RampingArrivalRate: "ramping-arrival-rate";
23
+ };
24
+ type ScenarioExecutorType = typeof ScenarioExecutor[keyof typeof ScenarioExecutor];
25
+ interface ScenarioCommonOptions {
26
+ executor: ScenarioExecutorType;
27
+ startTime?: string;
28
+ gracefulStop?: string;
29
+ exec?: string;
30
+ env: Record<string, string>;
31
+ tags: Record<string, string>;
32
+ }
33
+ interface SharedIterationsOptions extends ScenarioCommonOptions {
34
+ executor: typeof ScenarioExecutor.SharedIterations;
35
+ vus?: number | '';
36
+ iterations?: number;
37
+ maxDuration?: string;
38
+ }
39
+ interface PerVUIterationsOptions extends ScenarioCommonOptions {
40
+ executor: typeof ScenarioExecutor.PerVUIterations;
41
+ vus?: number | '';
42
+ iterations?: number;
43
+ maxDuration?: string;
44
+ }
45
+ interface ConstantVUsOptions extends ScenarioCommonOptions {
46
+ executor: typeof ScenarioExecutor.ConstantVUs;
47
+ duration: string;
48
+ vus?: number | '';
49
+ }
50
+ interface RampingVUsOptions extends ScenarioCommonOptions {
51
+ executor: typeof ScenarioExecutor.RampingVUs;
52
+ stages: RampingStage[];
53
+ startVUs?: number | '';
54
+ gracefulRampDown?: string;
55
+ }
56
+ interface ConstantArrivalRateOptions extends ScenarioCommonOptions {
57
+ executor: typeof ScenarioExecutor.ConstantArrivalRate;
58
+ duration: string;
59
+ rate: number;
60
+ preAllocatedVUs: number;
61
+ timeUnit?: string;
62
+ maxVUs?: number;
63
+ }
64
+ interface RampingArrivalRateOptions extends ScenarioCommonOptions {
65
+ executor: typeof ScenarioExecutor.RampingArrivalRate;
66
+ stages: RampingStage[];
67
+ preAllocatedVUs: number;
68
+ startRate?: number;
69
+ timeUnit?: string;
70
+ maxVUs?: number;
71
+ }
72
+ type ScenarioOptions = SharedIterationsOptions | PerVUIterationsOptions | ConstantVUsOptions | RampingVUsOptions | ConstantArrivalRateOptions | RampingArrivalRateOptions;
73
+ interface PrometheusTokenCredentials {
74
+ token: string;
75
+ }
76
+ interface PrometheusUserPassCredentials {
77
+ username: string;
78
+ password: string;
79
+ }
80
+ interface PrometheusConfig {
81
+ remoteWriteURL: string;
82
+ resampleRate?: number;
83
+ credentials: PrometheusTokenCredentials | PrometheusUserPassCredentials;
84
+ }
85
+ interface DatadogConfig {
86
+ apiKey: string;
87
+ appKey: string;
88
+ region: string;
89
+ resampleRate?: number;
90
+ }
91
+ interface AzureMonitorConfig {
92
+ tenantId: string;
93
+ clientId: string;
94
+ clientSecret: string;
95
+ azureRegion: string;
96
+ subscriptionId: string;
97
+ resourceGroupName: string;
98
+ insightsAppName: string;
99
+ resampleRate?: number;
100
+ }
101
+ type ProviderType = 'prometheus' | 'datadog' | 'azuremonitor';
102
+ interface APMConfig {
103
+ provider: ProviderType;
104
+ metrics: Array<string>;
105
+ includeDefaultMetrics: boolean | undefined;
106
+ includeTestRunId: boolean | undefined;
107
+ active: boolean;
108
+ name: string;
109
+ providerName: string;
110
+ id: string;
111
+ providerConfig: PrometheusConfig | AzureMonitorConfig | DatadogConfig;
112
+ }
113
+ enum ConfigType {
114
+ Base = "base",
115
+ Script = "script",
116
+ TestBuilder = "testBuilder"
117
+ }
118
+ interface ConfigObject<T = ScenarioOptions> {
119
+ id: string;
120
+ name: string;
121
+ type: ConfigType;
122
+ options: T;
123
+ errors: any[];
124
+ optionsPlaceholder?: boolean;
125
+ }
126
+ interface ScriptScenarioConfig<T = ScenarioOptions> extends ConfigObject<T> {
127
+ imports: string[];
128
+ body: string;
129
+ }
130
+ export const DOCS_ARTICLE_LINKS: {
131
+ root: string;
132
+ 'error-codes': string;
133
+ start: string;
134
+ notifications: string;
135
+ 'script-examples': string;
136
+ 'ramp-up': string;
137
+ 'insights-smart-results': string;
138
+ 'interpret-test': string;
139
+ 'concepts.checks': string;
140
+ 'concepts.thresholds': string;
141
+ 'concepts.performance-alerts': string;
142
+ 'performance-alerts.too-many-urls': string;
143
+ 'performance-alerts.third-party-content': string;
144
+ checks: string;
145
+ thresholds: string;
146
+ metrics: string;
147
+ 'metrics.built-in': string;
148
+ 'metrics.custom': string;
149
+ scenarios: string;
150
+ tutorials: string;
151
+ 'tutorials.automated-performance-testing.local-vs-cloud-execution': string;
152
+ 'compare-results': string;
153
+ 'insights-help': string;
154
+ 'how-to-do-browser-recording': string;
155
+ 'user-token': string;
156
+ 'organization-help': string;
157
+ 'project-help': string;
158
+ 'request-builder': string;
159
+ 'cloud-logs': string;
160
+ 'cloud-apm': string;
161
+ 'cloud-apm-azure-monitor': string;
162
+ 'cloud-apm-datadog': string;
163
+ 'cloud-apm-grafana-cloud': string;
164
+ 'cloud-apm-new-relic': string;
165
+ 'results-visualization/cloud': string;
166
+ 'options.discard-response-bodies': string;
167
+ 'groups-help': string;
168
+ 'url-grouping-help': string;
169
+ 'tags-help': string;
170
+ 'websockets-help': string;
171
+ 'http-requests-help': string;
172
+ 'recording-help': string;
173
+ 'data-retention-policy': string;
174
+ 'usage-reports': string;
175
+ 'manage-thresholds': string;
176
+ faq: string;
177
+ 'getting-started': string;
178
+ 'run-test': string;
179
+ 'product-overview': string;
180
+ 'javascript-api': string;
181
+ 'javascript-api.metrics': string;
182
+ 'javascript-api.http.set-response-callback': string;
183
+ 'javascript-api.sleep': string;
184
+ 'api-load-testing': string;
185
+ scripting: string;
186
+ 'test-running': string;
187
+ 'what-is-vus': string;
188
+ 'filter-domains': string;
189
+ debuggin: string;
190
+ 'schedule-help': string;
191
+ 'request-builder.basic': string;
192
+ 'request-builder.advanced': string;
193
+ 'request-builder.payload': string;
194
+ 'request-builder.scripting': string;
195
+ 'request-builder.query-params': string;
196
+ 'request-builder.variables': string;
197
+ 'request-builder.checks': string;
198
+ 'request-builder.headers': string;
199
+ 'request-builder.importing': string;
200
+ 'cloud-tests-from-cli.load-zones': string;
201
+ 'http-requests.url-grouping': string;
202
+ 'http-requests.tags': string;
203
+ 'modules.local-filesystem-modules': string;
204
+ 'performance-insights.too-many-groups': string;
205
+ 'performance-insights.too-many-metrics': string;
206
+ 'performance-insights.too-many-urls': string;
207
+ 'performance-insights.too-many-time-series': string;
208
+ 'performance-insights.third-party-content': string;
209
+ 'performance-insights.high-load-generator-cpu-usage': string;
210
+ 'performance-insights.high-load-generator-memory-usage': string;
211
+ 'performance-insights.high-http-failure-rate': string;
212
+ 'performance-insights.increased-http-failure-rate': string;
213
+ 'performance-insights.throughput-limit': string;
214
+ 'performance-insights.disabling-performance-insights': string;
215
+ 'performance-insights.abort-reason-user': string;
216
+ 'performance-insights.abort-reason-threshold': string;
217
+ 'performance-insights.abort-reason-system': string;
218
+ 'performance-insights.abort-reason-limit': string;
219
+ 'performance-insights.abort-reason-script-error': string;
220
+ };
221
+ type DocsArticleLink = keyof typeof DOCS_ARTICLE_LINKS;
222
+ interface ImportItemChoice {
223
+ label: string;
224
+ value: string;
225
+ package: string;
226
+ }
227
+ export const IMPORT_ITEMS: ImportItemChoice[];
228
+ export type TestBuilderStatus = 'success' | 'error' | 'loading' | 'saving' | 'unsaved' | 'warning';
229
+ interface APM extends PrometheusConfig, AzureMonitorConfig, DatadogConfig {
230
+ provider: ProviderType;
231
+ metrics: Array<string>;
232
+ includeDefaultMetrics: boolean | undefined;
233
+ includeTestRunId: boolean | undefined;
234
+ }
235
+ interface TestConfig {
236
+ apm: APMConfig[];
237
+ distribution: LoadZoneDistribution;
238
+ }
239
+ export interface TestBuilderTest {
240
+ id: null | number;
241
+ name: string;
242
+ request_builder_config: string;
243
+ config: TestConfig;
244
+ }
245
+ interface LoadZoneOption {
246
+ loadZone: string;
247
+ percent: number;
248
+ }
249
+ type ThresholdValue = string | {
250
+ threshold: string;
251
+ abortOnFail: boolean;
252
+ };
253
+ type Thresholds = Record<string, ThresholdValue[]>;
254
+ export interface LogOptions {
255
+ ext: {
256
+ loadimpact: {
257
+ distribution: Record<string, LoadZoneOption>;
258
+ apm: APM[];
259
+ };
260
+ };
261
+ /** @deprecated Only old (pre scenarios) tests has this property */
262
+ stages?: RampingStage[];
263
+ thresholds: Thresholds;
264
+ scenarios: Record<string, ScenarioOptions>;
265
+ }
266
+ export function convertDurationToSeconds(duration?: string): number;
267
+ export function isDurationValid(duration: string): boolean;
268
+ export function isStageTargetValid(target: any): boolean;
269
+ type ConstrainedRangeChange = (currentlyChangedContent: {
270
+ [CONSTRAINED_RANGE_BODY]: string;
271
+ }) => void;
272
+ interface ConstrainedRange {
273
+ range: number[];
274
+ allowMultiline?: boolean;
275
+ label: string;
276
+ value: string;
277
+ }
278
+ declare const CONSTRAINED_RANGE_BODY = "CONSTRAINED_RANGE_BODY";
279
+ type ScriptEditorMode = 'test' | 'scenario';
280
+ /** @todo Create interface that fits cloud app and plugin */
281
+ export interface ScriptEditorProps {
282
+ mode?: ScriptEditorMode;
283
+ scenario?: ScriptScenarioConfig;
284
+ imports?: string[];
285
+ filename?: string;
286
+ functionName?: string;
287
+ body?: string;
288
+ value: string;
289
+ template?: string;
290
+ constrainedRanges?: ConstrainedRange[];
291
+ onChange?: ChangeEventHandler<HTMLTextAreaElement> | ConstrainedRangeChange;
292
+ onBodyChange?: (value: string) => void;
293
+ onBlur?: FocusEventHandler<HTMLTextAreaElement>;
294
+ error?: Error;
295
+ readOnly?: boolean;
296
+ onImportsChange?: (imports: string[]) => void;
297
+ }
298
+ interface DocsLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
299
+ article: DocsArticleLink;
300
+ children: ReactNode;
301
+ }
302
+ interface StagesVirtualizationComponentProps {
303
+ startValue?: number;
304
+ stages: RampingStage[];
305
+ unit?: string;
306
+ }
307
+ type LoadZoneDataItem = {
308
+ id: number;
309
+ } & K6LoadZone;
310
+ interface TestBuilderInternalContextProviderProps {
311
+ children?: ReactNode;
312
+ }
313
+ export function TestBuilderInternalContextProvider({ children, }: TestBuilderInternalContextProviderProps): JSX.Element;
314
+ interface MuiThemeProviderProps {
315
+ children: ReactNode;
316
+ inherit?: boolean;
317
+ theme?: ThemeOptions;
318
+ }
319
+ export function TestBuilderThemeProvider({ children, theme: _theme }: MuiThemeProviderProps): JSX.Element;
320
+ declare function getTestBuilderTest(): Promise<[TestBuilderTest & {
321
+ script: string;
322
+ }, Error | InvalidArchiveError | undefined]>;
323
+ export function useGetTestBuilderTest(): typeof getTestBuilderTest;
324
+ export function TestBuilderStoreProvider({ children }: {
325
+ children: ReactNode;
326
+ }): JSX.Element;
327
+ interface TestBuilderStandaloneProps {
328
+ loading?: boolean;
329
+ saving?: boolean;
330
+ k6Test?: TestBuilderTest;
331
+ hasCloudExecution?: boolean;
332
+ availableLoadZones?: LoadZoneDataItem[];
333
+ DocsLinkComponent?: ElementType<DocsLinkProps>;
334
+ onViewChange?: (view: string) => void;
335
+ StagesVirtualizationComponent?: (props: StagesVirtualizationComponentProps) => ReactElement;
336
+ ScriptEditorComponent?: (props: ScriptEditorProps) => ReactElement;
337
+ }
338
+ export function TestBuilder({ loading, saving, k6Test, hasCloudExecution, availableLoadZones, DocsLinkComponent, onViewChange, StagesVirtualizationComponent, ScriptEditorComponent, }: TestBuilderStandaloneProps): JSX.Element;
339
+ interface TestMetaInformationProps {
340
+ className?: string;
341
+ }
342
+ export const TestMetaInformation: FunctionComponent<TestMetaInformationProps>;
343
+ interface StatusMessageProps {
344
+ text?: string | ReactNode;
345
+ level: TestBuilderStatus;
346
+ }
347
+ export const StatusMessage: FunctionComponent<StatusMessageProps>;
348
+ export const StatusBar: FunctionComponent<{
349
+ className?: string;
350
+ }>;
351
+ export function useTestBuilderName(): [string, (name: string) => void];
352
+ declare const grafanaThemeDark: {
353
+ name: string;
354
+ isDark: boolean;
355
+ isLight: boolean;
356
+ colors: {
357
+ mode: string;
358
+ border: {
359
+ weak: string;
360
+ medium: string;
361
+ strong: string;
362
+ };
363
+ text: {
364
+ primary: string;
365
+ secondary: string;
366
+ disabled: string;
367
+ link: string;
368
+ maxContrast: string;
369
+ };
370
+ primary: {
371
+ main: string;
372
+ text: string;
373
+ border: string;
374
+ name: string;
375
+ shade: string;
376
+ transparent: string;
377
+ contrastText: string;
378
+ };
379
+ secondary: {
380
+ main: string;
381
+ shade: string;
382
+ text: string;
383
+ contrastText: string;
384
+ border: string;
385
+ name: string;
386
+ transparent: string;
387
+ };
388
+ info: {
389
+ main: string;
390
+ text: string;
391
+ border: string;
392
+ name: string;
393
+ shade: string;
394
+ transparent: string;
395
+ contrastText: string;
396
+ };
397
+ error: {
398
+ main: string;
399
+ text: string;
400
+ name: string;
401
+ border: string;
402
+ shade: string;
403
+ transparent: string;
404
+ contrastText: string;
405
+ };
406
+ success: {
407
+ main: string;
408
+ text: string;
409
+ name: string;
410
+ border: string;
411
+ shade: string;
412
+ transparent: string;
413
+ contrastText: string;
414
+ };
415
+ warning: {
416
+ main: string;
417
+ text: string;
418
+ name: string;
419
+ border: string;
420
+ shade: string;
421
+ transparent: string;
422
+ contrastText: string;
423
+ };
424
+ background: {
425
+ canvas: string;
426
+ primary: string;
427
+ secondary: string;
428
+ };
429
+ action: {
430
+ hover: string;
431
+ selected: string;
432
+ focus: string;
433
+ hoverOpacity: number;
434
+ disabledText: string;
435
+ disabledBackground: string;
436
+ disabledOpacity: number;
437
+ };
438
+ gradients: {
439
+ brandHorizontal: string;
440
+ brandVertical: string;
441
+ };
442
+ contrastThreshold: number;
443
+ hoverFactor: number;
444
+ tonalOffset: number;
445
+ };
446
+ breakpoints: {
447
+ values: {
448
+ xs: number;
449
+ sm: number;
450
+ md: number;
451
+ lg: number;
452
+ xl: number;
453
+ xxl: number;
454
+ };
455
+ keys: string[];
456
+ unit: string;
457
+ };
458
+ shape: {};
459
+ components: {
460
+ height: {
461
+ sm: number;
462
+ md: number;
463
+ lg: number;
464
+ };
465
+ input: {
466
+ borderColor: string;
467
+ borderHover: string;
468
+ text: string;
469
+ background: string;
470
+ };
471
+ panel: {
472
+ padding: number;
473
+ headerHeight: number;
474
+ background: string;
475
+ borderColor: string;
476
+ boxShadow: string;
477
+ };
478
+ dropdown: {
479
+ background: string;
480
+ };
481
+ tooltip: {
482
+ background: string;
483
+ text: string;
484
+ };
485
+ dashboard: {
486
+ background: string;
487
+ padding: number;
488
+ };
489
+ overlay: {
490
+ background: string;
491
+ };
492
+ sidemenu: {
493
+ width: number;
494
+ };
495
+ menuTabs: {
496
+ height: number;
497
+ };
498
+ textHighlight: {
499
+ text: string;
500
+ background: string;
501
+ };
502
+ horizontalDrawer: {
503
+ defaultHeight: number;
504
+ };
505
+ };
506
+ typography: {
507
+ htmlFontSize: number;
508
+ fontFamily: string;
509
+ fontFamilyMonospace: string;
510
+ fontSize: number;
511
+ fontWeightLight: number;
512
+ fontWeightRegular: number;
513
+ fontWeightMedium: number;
514
+ fontWeightBold: number;
515
+ size: {
516
+ base: string;
517
+ xs: string;
518
+ sm: string;
519
+ md: string;
520
+ lg: string;
521
+ };
522
+ h1: {
523
+ fontFamily: string;
524
+ fontWeight: number;
525
+ fontSize: string;
526
+ lineHeight: number;
527
+ letterSpacing: string;
528
+ };
529
+ h2: {
530
+ fontFamily: string;
531
+ fontWeight: number;
532
+ fontSize: string;
533
+ lineHeight: number;
534
+ letterSpacing: string;
535
+ };
536
+ h3: {
537
+ fontFamily: string;
538
+ fontWeight: number;
539
+ fontSize: string;
540
+ lineHeight: number;
541
+ letterSpacing: string;
542
+ };
543
+ h4: {
544
+ fontFamily: string;
545
+ fontWeight: number;
546
+ fontSize: string;
547
+ lineHeight: number;
548
+ letterSpacing: string;
549
+ };
550
+ h5: {
551
+ fontFamily: string;
552
+ fontWeight: number;
553
+ fontSize: string;
554
+ lineHeight: number;
555
+ letterSpacing: string;
556
+ };
557
+ h6: {
558
+ fontFamily: string;
559
+ fontWeight: number;
560
+ fontSize: string;
561
+ lineHeight: number;
562
+ letterSpacing: string;
563
+ };
564
+ body: {
565
+ fontFamily: string;
566
+ fontWeight: number;
567
+ fontSize: string;
568
+ lineHeight: number;
569
+ letterSpacing: string;
570
+ };
571
+ bodySmall: {
572
+ fontFamily: string;
573
+ fontWeight: number;
574
+ fontSize: string;
575
+ lineHeight: number;
576
+ letterSpacing: string;
577
+ };
578
+ };
579
+ shadows: {
580
+ z1: string;
581
+ z2: string;
582
+ z3: string;
583
+ };
584
+ transitions: {
585
+ duration: {
586
+ shortest: number;
587
+ shorter: number;
588
+ short: number;
589
+ standard: number;
590
+ complex: number;
591
+ enteringScreen: number;
592
+ leavingScreen: number;
593
+ };
594
+ easing: {
595
+ easeInOut: string;
596
+ easeOut: string;
597
+ easeIn: string;
598
+ sharp: string;
599
+ };
600
+ };
601
+ visualization: {
602
+ hues: ({
603
+ name: string;
604
+ shades: ({
605
+ color: string;
606
+ name: string;
607
+ primary?: undefined;
608
+ } | {
609
+ color: string;
610
+ name: string;
611
+ primary: boolean;
612
+ })[];
613
+ } | {
614
+ name: string;
615
+ shades: ({
616
+ color: string;
617
+ name: string;
618
+ aliases: never[];
619
+ primary?: undefined;
620
+ } | {
621
+ color: string;
622
+ name: string;
623
+ aliases: never[];
624
+ primary: boolean;
625
+ })[];
626
+ })[];
627
+ palette: string[];
628
+ };
629
+ zIndex: {
630
+ navbarFixed: number;
631
+ sidemenu: number;
632
+ dropdown: number;
633
+ typeahead: number;
634
+ tooltip: number;
635
+ modalBackdrop: number;
636
+ modal: number;
637
+ portal: number;
638
+ };
639
+ v1: {
640
+ name: string;
641
+ typography: {
642
+ fontFamily: {
643
+ sansSerif: string;
644
+ monospace: string;
645
+ };
646
+ size: {
647
+ base: string;
648
+ xs: string;
649
+ sm: string;
650
+ md: string;
651
+ lg: string;
652
+ };
653
+ heading: {
654
+ h1: string;
655
+ h2: string;
656
+ h3: string;
657
+ h4: string;
658
+ h5: string;
659
+ h6: string;
660
+ };
661
+ weight: {
662
+ light: number;
663
+ regular: number;
664
+ semibold: number;
665
+ bold: number;
666
+ };
667
+ lineHeight: {
668
+ xs: number;
669
+ sm: number;
670
+ md: number;
671
+ lg: number;
672
+ };
673
+ link: {
674
+ decoration: string;
675
+ hoverDecoration: string;
676
+ };
677
+ };
678
+ breakpoints: {
679
+ xs: string;
680
+ sm: string;
681
+ md: string;
682
+ lg: string;
683
+ xl: string;
684
+ xxl: string;
685
+ };
686
+ spacing: {
687
+ base: number;
688
+ insetSquishMd: string;
689
+ d: string;
690
+ xxs: string;
691
+ xs: string;
692
+ sm: string;
693
+ md: string;
694
+ lg: string;
695
+ xl: string;
696
+ gutter: string;
697
+ formSpacingBase: number;
698
+ formMargin: string;
699
+ formFieldsetMargin: string;
700
+ formInputHeight: number;
701
+ formButtonHeight: number;
702
+ formInputPaddingHorizontal: string;
703
+ formInputAffixPaddingHorizontal: string;
704
+ formInputMargin: string;
705
+ formLabelPadding: string;
706
+ formLabelMargin: string;
707
+ formValidationMessagePadding: string;
708
+ formValidationMessageMargin: string;
709
+ inlineFormMargin: string;
710
+ };
711
+ border: {
712
+ radius: {
713
+ sm: string;
714
+ md: string;
715
+ lg: string;
716
+ };
717
+ width: {
718
+ sm: string;
719
+ };
720
+ };
721
+ height: {
722
+ sm: number;
723
+ md: number;
724
+ lg: number;
725
+ };
726
+ panelPadding: number;
727
+ panelHeaderHeight: number;
728
+ zIndex: {
729
+ navbarFixed: number;
730
+ sidemenu: number;
731
+ dropdown: number;
732
+ typeahead: number;
733
+ tooltip: number;
734
+ modalBackdrop: number;
735
+ modal: number;
736
+ portal: number;
737
+ };
738
+ type: string;
739
+ isDark: boolean;
740
+ isLight: boolean;
741
+ palette: {
742
+ gray98: string;
743
+ gray97: string;
744
+ gray95: string;
745
+ gray90: string;
746
+ gray85: string;
747
+ gray70: string;
748
+ gray60: string;
749
+ gray33: string;
750
+ gray25: string;
751
+ gray15: string;
752
+ gray10: string;
753
+ gray05: string;
754
+ blue95: string;
755
+ blue85: string;
756
+ blue80: string;
757
+ blue77: string;
758
+ red88: string;
759
+ black: string;
760
+ white: string;
761
+ dark1: string;
762
+ dark2: string;
763
+ dark3: string;
764
+ dark4: string;
765
+ dark5: string;
766
+ dark6: string;
767
+ dark7: string;
768
+ dark8: string;
769
+ dark9: string;
770
+ dark10: string;
771
+ gray1: string;
772
+ gray2: string;
773
+ gray3: string;
774
+ gray4: string;
775
+ gray5: string;
776
+ gray6: string;
777
+ gray7: string;
778
+ redBase: string;
779
+ redShade: string;
780
+ greenBase: string;
781
+ greenShade: string;
782
+ red: string;
783
+ yellow: string;
784
+ purple: string;
785
+ variable: string;
786
+ orange: string;
787
+ orangeDark: string;
788
+ brandPrimary: string;
789
+ brandSuccess: string;
790
+ brandWarning: string;
791
+ brandDanger: string;
792
+ queryRed: string;
793
+ queryGreen: string;
794
+ queryPurple: string;
795
+ queryOrange: string;
796
+ online: string;
797
+ warn: string;
798
+ critical: string;
799
+ };
800
+ colors: {
801
+ bg1: string;
802
+ bg2: string;
803
+ bg3: string;
804
+ dashboardBg: string;
805
+ bgBlue1: string;
806
+ bgBlue2: string;
807
+ border1: string;
808
+ border2: string;
809
+ border3: string;
810
+ formLabel: string;
811
+ formDescription: string;
812
+ formInputBg: string;
813
+ formInputBgDisabled: string;
814
+ formInputBorder: string;
815
+ formInputBorderHover: string;
816
+ formInputBorderActive: string;
817
+ formInputBorderInvalid: string;
818
+ formInputPlaceholderText: string;
819
+ formInputText: string;
820
+ formInputDisabledText: string;
821
+ formFocusOutline: string;
822
+ formValidationMessageText: string;
823
+ formValidationMessageBg: string;
824
+ textStrong: string;
825
+ textHeading: string;
826
+ text: string;
827
+ textSemiWeak: string;
828
+ textWeak: string;
829
+ textFaint: string;
830
+ textBlue: string;
831
+ bodyBg: string;
832
+ panelBg: string;
833
+ panelBorder: string;
834
+ pageHeaderBg: string;
835
+ pageHeaderBorder: string;
836
+ dropdownBg: string;
837
+ dropdownShadow: string;
838
+ dropdownOptionHoverBg: string;
839
+ link: string;
840
+ linkDisabled: string;
841
+ linkHover: string;
842
+ linkExternal: string;
843
+ };
844
+ shadows: {
845
+ listItem: string;
846
+ };
847
+ visualization: {
848
+ hues: ({
849
+ name: string;
850
+ shades: ({
851
+ color: string;
852
+ name: string;
853
+ primary?: undefined;
854
+ } | {
855
+ color: string;
856
+ name: string;
857
+ primary: boolean;
858
+ })[];
859
+ } | {
860
+ name: string;
861
+ shades: ({
862
+ color: string;
863
+ name: string;
864
+ aliases: never[];
865
+ primary?: undefined;
866
+ } | {
867
+ color: string;
868
+ name: string;
869
+ aliases: never[];
870
+ primary: boolean;
871
+ })[];
872
+ })[];
873
+ palette: string[];
874
+ };
875
+ };
876
+ };
877
+ declare const grafanaThemeLight: {
878
+ name: string;
879
+ isDark: boolean;
880
+ isLight: boolean;
881
+ colors: {
882
+ mode: string;
883
+ primary: {
884
+ main: string;
885
+ border: string;
886
+ text: string;
887
+ name: string;
888
+ shade: string;
889
+ transparent: string;
890
+ contrastText: string;
891
+ };
892
+ text: {
893
+ primary: string;
894
+ secondary: string;
895
+ disabled: string;
896
+ link: string;
897
+ maxContrast: string;
898
+ };
899
+ border: {
900
+ weak: string;
901
+ medium: string;
902
+ strong: string;
903
+ };
904
+ secondary: {
905
+ main: string;
906
+ shade: string;
907
+ contrastText: string;
908
+ text: string;
909
+ border: string;
910
+ name: string;
911
+ transparent: string;
912
+ };
913
+ info: {
914
+ main: string;
915
+ text: string;
916
+ name: string;
917
+ border: string;
918
+ shade: string;
919
+ transparent: string;
920
+ contrastText: string;
921
+ };
922
+ error: {
923
+ main: string;
924
+ text: string;
925
+ border: string;
926
+ name: string;
927
+ shade: string;
928
+ transparent: string;
929
+ contrastText: string;
930
+ };
931
+ success: {
932
+ main: string;
933
+ text: string;
934
+ name: string;
935
+ border: string;
936
+ shade: string;
937
+ transparent: string;
938
+ contrastText: string;
939
+ };
940
+ warning: {
941
+ main: string;
942
+ text: string;
943
+ name: string;
944
+ border: string;
945
+ shade: string;
946
+ transparent: string;
947
+ contrastText: string;
948
+ };
949
+ background: {
950
+ canvas: string;
951
+ primary: string;
952
+ secondary: string;
953
+ };
954
+ action: {
955
+ hover: string;
956
+ selected: string;
957
+ hoverOpacity: number;
958
+ focus: string;
959
+ disabledBackground: string;
960
+ disabledText: string;
961
+ disabledOpacity: number;
962
+ };
963
+ gradients: {
964
+ brandHorizontal: string;
965
+ brandVertical: string;
966
+ };
967
+ contrastThreshold: number;
968
+ hoverFactor: number;
969
+ tonalOffset: number;
970
+ };
971
+ breakpoints: {
972
+ values: {
973
+ xs: number;
974
+ sm: number;
975
+ md: number;
976
+ lg: number;
977
+ xl: number;
978
+ xxl: number;
979
+ };
980
+ keys: string[];
981
+ unit: string;
982
+ };
983
+ shape: {};
984
+ components: {
985
+ height: {
986
+ sm: number;
987
+ md: number;
988
+ lg: number;
989
+ };
990
+ input: {
991
+ borderColor: string;
992
+ borderHover: string;
993
+ text: string;
994
+ background: string;
995
+ };
996
+ panel: {
997
+ padding: number;
998
+ headerHeight: number;
999
+ background: string;
1000
+ borderColor: string;
1001
+ boxShadow: string;
1002
+ };
1003
+ dropdown: {
1004
+ background: string;
1005
+ };
1006
+ tooltip: {
1007
+ background: string;
1008
+ text: string;
1009
+ };
1010
+ dashboard: {
1011
+ background: string;
1012
+ padding: number;
1013
+ };
1014
+ overlay: {
1015
+ background: string;
1016
+ };
1017
+ sidemenu: {
1018
+ width: number;
1019
+ };
1020
+ menuTabs: {
1021
+ height: number;
1022
+ };
1023
+ textHighlight: {
1024
+ text: string;
1025
+ background: string;
1026
+ };
1027
+ horizontalDrawer: {
1028
+ defaultHeight: number;
1029
+ };
1030
+ };
1031
+ typography: {
1032
+ htmlFontSize: number;
1033
+ fontFamily: string;
1034
+ fontFamilyMonospace: string;
1035
+ fontSize: number;
1036
+ fontWeightLight: number;
1037
+ fontWeightRegular: number;
1038
+ fontWeightMedium: number;
1039
+ fontWeightBold: number;
1040
+ size: {
1041
+ base: string;
1042
+ xs: string;
1043
+ sm: string;
1044
+ md: string;
1045
+ lg: string;
1046
+ };
1047
+ h1: {
1048
+ fontFamily: string;
1049
+ fontWeight: number;
1050
+ fontSize: string;
1051
+ lineHeight: number;
1052
+ letterSpacing: string;
1053
+ };
1054
+ h2: {
1055
+ fontFamily: string;
1056
+ fontWeight: number;
1057
+ fontSize: string;
1058
+ lineHeight: number;
1059
+ letterSpacing: string;
1060
+ };
1061
+ h3: {
1062
+ fontFamily: string;
1063
+ fontWeight: number;
1064
+ fontSize: string;
1065
+ lineHeight: number;
1066
+ letterSpacing: string;
1067
+ };
1068
+ h4: {
1069
+ fontFamily: string;
1070
+ fontWeight: number;
1071
+ fontSize: string;
1072
+ lineHeight: number;
1073
+ letterSpacing: string;
1074
+ };
1075
+ h5: {
1076
+ fontFamily: string;
1077
+ fontWeight: number;
1078
+ fontSize: string;
1079
+ lineHeight: number;
1080
+ letterSpacing: string;
1081
+ };
1082
+ h6: {
1083
+ fontFamily: string;
1084
+ fontWeight: number;
1085
+ fontSize: string;
1086
+ lineHeight: number;
1087
+ letterSpacing: string;
1088
+ };
1089
+ body: {
1090
+ fontFamily: string;
1091
+ fontWeight: number;
1092
+ fontSize: string;
1093
+ lineHeight: number;
1094
+ letterSpacing: string;
1095
+ };
1096
+ bodySmall: {
1097
+ fontFamily: string;
1098
+ fontWeight: number;
1099
+ fontSize: string;
1100
+ lineHeight: number;
1101
+ letterSpacing: string;
1102
+ };
1103
+ };
1104
+ shadows: {
1105
+ z1: string;
1106
+ z2: string;
1107
+ z3: string;
1108
+ };
1109
+ transitions: {
1110
+ duration: {
1111
+ shortest: number;
1112
+ shorter: number;
1113
+ short: number;
1114
+ standard: number;
1115
+ complex: number;
1116
+ enteringScreen: number;
1117
+ leavingScreen: number;
1118
+ };
1119
+ easing: {
1120
+ easeInOut: string;
1121
+ easeOut: string;
1122
+ easeIn: string;
1123
+ sharp: string;
1124
+ };
1125
+ };
1126
+ visualization: {
1127
+ hues: ({
1128
+ name: string;
1129
+ shades: ({
1130
+ color: string;
1131
+ name: string;
1132
+ primary?: undefined;
1133
+ } | {
1134
+ color: string;
1135
+ name: string;
1136
+ primary: boolean;
1137
+ })[];
1138
+ } | {
1139
+ name: string;
1140
+ shades: ({
1141
+ color: string;
1142
+ name: string;
1143
+ aliases: never[];
1144
+ primary?: undefined;
1145
+ } | {
1146
+ color: string;
1147
+ name: string;
1148
+ aliases: never[];
1149
+ primary: boolean;
1150
+ })[];
1151
+ })[];
1152
+ palette: string[];
1153
+ };
1154
+ zIndex: {
1155
+ navbarFixed: number;
1156
+ sidemenu: number;
1157
+ dropdown: number;
1158
+ typeahead: number;
1159
+ tooltip: number;
1160
+ modalBackdrop: number;
1161
+ modal: number;
1162
+ portal: number;
1163
+ };
1164
+ v1: {
1165
+ name: string;
1166
+ typography: {
1167
+ fontFamily: {
1168
+ sansSerif: string;
1169
+ monospace: string;
1170
+ };
1171
+ size: {
1172
+ base: string;
1173
+ xs: string;
1174
+ sm: string;
1175
+ md: string;
1176
+ lg: string;
1177
+ };
1178
+ heading: {
1179
+ h1: string;
1180
+ h2: string;
1181
+ h3: string;
1182
+ h4: string;
1183
+ h5: string;
1184
+ h6: string;
1185
+ };
1186
+ weight: {
1187
+ light: number;
1188
+ regular: number;
1189
+ semibold: number;
1190
+ bold: number;
1191
+ };
1192
+ lineHeight: {
1193
+ xs: number;
1194
+ sm: number;
1195
+ md: number;
1196
+ lg: number;
1197
+ };
1198
+ link: {
1199
+ decoration: string;
1200
+ hoverDecoration: string;
1201
+ };
1202
+ };
1203
+ breakpoints: {
1204
+ xs: string;
1205
+ sm: string;
1206
+ md: string;
1207
+ lg: string;
1208
+ xl: string;
1209
+ xxl: string;
1210
+ };
1211
+ spacing: {
1212
+ base: number;
1213
+ insetSquishMd: string;
1214
+ d: string;
1215
+ xxs: string;
1216
+ xs: string;
1217
+ sm: string;
1218
+ md: string;
1219
+ lg: string;
1220
+ xl: string;
1221
+ gutter: string;
1222
+ formSpacingBase: number;
1223
+ formMargin: string;
1224
+ formFieldsetMargin: string;
1225
+ formInputHeight: number;
1226
+ formButtonHeight: number;
1227
+ formInputPaddingHorizontal: string;
1228
+ formInputAffixPaddingHorizontal: string;
1229
+ formInputMargin: string;
1230
+ formLabelPadding: string;
1231
+ formLabelMargin: string;
1232
+ formValidationMessagePadding: string;
1233
+ formValidationMessageMargin: string;
1234
+ inlineFormMargin: string;
1235
+ };
1236
+ border: {
1237
+ radius: {
1238
+ sm: string;
1239
+ md: string;
1240
+ lg: string;
1241
+ };
1242
+ width: {
1243
+ sm: string;
1244
+ };
1245
+ };
1246
+ height: {
1247
+ sm: number;
1248
+ md: number;
1249
+ lg: number;
1250
+ };
1251
+ panelPadding: number;
1252
+ panelHeaderHeight: number;
1253
+ zIndex: {
1254
+ navbarFixed: number;
1255
+ sidemenu: number;
1256
+ dropdown: number;
1257
+ typeahead: number;
1258
+ tooltip: number;
1259
+ modalBackdrop: number;
1260
+ modal: number;
1261
+ portal: number;
1262
+ };
1263
+ type: string;
1264
+ isDark: boolean;
1265
+ isLight: boolean;
1266
+ palette: {
1267
+ gray98: string;
1268
+ gray97: string;
1269
+ gray95: string;
1270
+ gray90: string;
1271
+ gray85: string;
1272
+ gray70: string;
1273
+ gray60: string;
1274
+ gray33: string;
1275
+ gray25: string;
1276
+ gray15: string;
1277
+ gray10: string;
1278
+ gray05: string;
1279
+ blue95: string;
1280
+ blue85: string;
1281
+ blue80: string;
1282
+ blue77: string;
1283
+ red88: string;
1284
+ black: string;
1285
+ white: string;
1286
+ dark1: string;
1287
+ dark2: string;
1288
+ dark3: string;
1289
+ dark4: string;
1290
+ dark5: string;
1291
+ dark6: string;
1292
+ dark7: string;
1293
+ dark8: string;
1294
+ dark9: string;
1295
+ dark10: string;
1296
+ gray1: string;
1297
+ gray2: string;
1298
+ gray3: string;
1299
+ gray4: string;
1300
+ gray5: string;
1301
+ gray6: string;
1302
+ gray7: string;
1303
+ redBase: string;
1304
+ redShade: string;
1305
+ greenBase: string;
1306
+ greenShade: string;
1307
+ red: string;
1308
+ yellow: string;
1309
+ purple: string;
1310
+ variable: string;
1311
+ orange: string;
1312
+ orangeDark: string;
1313
+ brandPrimary: string;
1314
+ brandSuccess: string;
1315
+ brandWarning: string;
1316
+ brandDanger: string;
1317
+ queryRed: string;
1318
+ queryGreen: string;
1319
+ queryPurple: string;
1320
+ queryOrange: string;
1321
+ online: string;
1322
+ warn: string;
1323
+ critical: string;
1324
+ };
1325
+ colors: {
1326
+ bg1: string;
1327
+ bg2: string;
1328
+ bg3: string;
1329
+ dashboardBg: string;
1330
+ bgBlue1: string;
1331
+ bgBlue2: string;
1332
+ border1: string;
1333
+ border2: string;
1334
+ border3: string;
1335
+ formLabel: string;
1336
+ formDescription: string;
1337
+ formInputBg: string;
1338
+ formInputBgDisabled: string;
1339
+ formInputBorder: string;
1340
+ formInputBorderHover: string;
1341
+ formInputBorderActive: string;
1342
+ formInputBorderInvalid: string;
1343
+ formInputPlaceholderText: string;
1344
+ formInputText: string;
1345
+ formInputDisabledText: string;
1346
+ formFocusOutline: string;
1347
+ formValidationMessageText: string;
1348
+ formValidationMessageBg: string;
1349
+ textStrong: string;
1350
+ textHeading: string;
1351
+ text: string;
1352
+ textSemiWeak: string;
1353
+ textWeak: string;
1354
+ textFaint: string;
1355
+ textBlue: string;
1356
+ bodyBg: string;
1357
+ panelBg: string;
1358
+ panelBorder: string;
1359
+ pageHeaderBg: string;
1360
+ pageHeaderBorder: string;
1361
+ dropdownBg: string;
1362
+ dropdownShadow: string;
1363
+ dropdownOptionHoverBg: string;
1364
+ link: string;
1365
+ linkDisabled: string;
1366
+ linkHover: string;
1367
+ linkExternal: string;
1368
+ };
1369
+ shadows: {
1370
+ listItem: string;
1371
+ };
1372
+ visualization: {
1373
+ hues: ({
1374
+ name: string;
1375
+ shades: ({
1376
+ color: string;
1377
+ name: string;
1378
+ primary?: undefined;
1379
+ } | {
1380
+ color: string;
1381
+ name: string;
1382
+ primary: boolean;
1383
+ })[];
1384
+ } | {
1385
+ name: string;
1386
+ shades: ({
1387
+ color: string;
1388
+ name: string;
1389
+ aliases: never[];
1390
+ primary?: undefined;
1391
+ } | {
1392
+ color: string;
1393
+ name: string;
1394
+ aliases: never[];
1395
+ primary: boolean;
1396
+ })[];
1397
+ })[];
1398
+ palette: string[];
1399
+ };
1400
+ };
1401
+ };
1402
+ type GrafanaTheme = typeof grafanaThemeDark | typeof grafanaThemeLight;
1403
+ export const grafanaThemeToMuiTheme: (theme: GrafanaTheme) => ThemeOptions;
1404
+ type SetImportsHandler = (value: string[]) => void;
1405
+ export function useScriptImports(): [string[] | undefined, SetImportsHandler];
1406
+ export function useGetUnsavedChanges(): [boolean, (value: boolean) => void];