-
Notifications
You must be signed in to change notification settings - Fork 67
/
Settings.types.ts
50 lines (42 loc) 路 1.32 KB
/
Settings.types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import Config from 'models/Config.model';
import Demo from 'models/Demo.model';
import Linter from 'models/Linter.model';
import Polling from 'models/Polling.model';
export type TListResponse<T> = {
count: number;
items: T[];
};
export enum SupportedDemos {
Pokeshop = 'pokeshop',
OpentelemetryStore = 'otelstore',
}
export enum SupportedDemosFormField {
Pokeshop = 'pokeshop',
OpentelemetryStore = 'opentelemetryStore',
}
export const SupportedDemosFormFieldMap = {
[SupportedDemosFormField.Pokeshop]: SupportedDemos.Pokeshop,
[SupportedDemosFormField.OpentelemetryStore]: SupportedDemos.OpentelemetryStore,
};
export enum ResourceType {
ConfigType = 'Config',
PollingProfileType = 'PollingProfile',
DemoType = 'Demo',
AnalyzerType = 'Analyzer',
}
export enum ResourceTypePlural {
ConfigType = 'Configs',
PollingProfileType = 'PollingProfiles',
DemoType = 'Demos',
AnalyzerType = 'Analyzers',
}
export type TDraftDemo = Record<Required<Demo['type']>, Partial<Demo>>;
export type TDraftPollingProfiles = Partial<Polling>;
export type TDraftConfig = Partial<Config>;
export type TDraftLinter = Partial<Linter>;
export type TDraftSpec = TDraftConfig | TDraftPollingProfiles | Partial<Demo> | TDraftLinter;
export type TDraftResource = {
type: ResourceType;
typePlural: ResourceTypePlural;
spec: TDraftSpec;
};