-
Notifications
You must be signed in to change notification settings - Fork 17
/
panels.ts
196 lines (149 loc) · 6.25 KB
/
panels.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
import { ExoticComponent } from 'react';
import * as attributes from './attribute-types';
export interface AttributesByPanel {
Panel: attributes.PanelAttributes;
Label: attributes.LabelAttributes;
Image: attributes.ImageAttributes;
DOTAAbilityImage: attributes.DOTAAbilityImageAttributes;
DOTAItemImage: attributes.DOTAItemImageAttributes;
DOTAHeroImage: attributes.DOTAHeroImageAttributes;
DOTACountryFlagImage: attributes.DOTACountryFlagImageAttributes;
DOTALeagueImage: attributes.DOTALeagueImageAttributes;
EconItemImage: attributes.EconItemImageAttributes;
AnimatedImageStrip: attributes.AnimatedImageStripAttributes;
DOTAEmoticon: attributes.DOTAEmoticonAttributes;
Movie: attributes.MovieAttributes;
DOTAHeroMovie: attributes.DOTAHeroMovieAttributes;
DOTAScenePanel: attributes.DOTAScenePanelAttributes;
DOTAEconItem: attributes.DOTAEconItemAttributes;
ProgressBar: attributes.ProgressBarAttributes;
CircularProgressBar: attributes.CircularProgressBarAttributes;
ProgressBarWithMiddle: attributes.ProgressBarWithMiddleAttributes;
DOTAUserName: attributes.DOTAUserNameAttributes;
DOTAUserRichPresence: attributes.DOTAUserRichPresenceAttributes;
DOTAAvatarImage: attributes.DOTAAvatarImageAttributes;
Countdown: attributes.CountdownAttributes;
Button: attributes.PanelAttributes;
TextButton: attributes.TextButtonAttributes;
ToggleButton: attributes.ToggleButtonAttributes;
RadioButton: attributes.RadioButtonAttributes;
TextEntry: attributes.TextEntryAttributes;
NumberEntry: attributes.NumberEntryAttributes;
Slider: attributes.SliderAttributes;
SlottedSlider: attributes.SlottedSliderAttributes;
DropDown: attributes.DropDownAttributes;
ContextMenuScript: attributes.PanelAttributes;
Carousel: attributes.CarouselAttributes;
CarouselNav: attributes.CarouselNavAttributes;
DOTAHUDOverlayMap: attributes.DOTAHUDOverlayMapAttributes;
DOTAMinimap: attributes.PanelAttributes;
HTML: attributes.HTMLAttributes;
CustomLayoutPanel: attributes.CustomLayoutPanelAttributes;
GenericPanel: attributes.GenericPanelAttributes;
}
export type PanelType = keyof AttributesByPanel;
export type PanelTypeByName<T extends PanelType> = PanoramaPanelNameMap[Extract<
T,
keyof PanoramaPanelNameMap
>];
declare global {
/* eslint-disable no-var, vars-on-top */
var Panel: ExoticComponent<attributes.PanelAttributes>;
var Label: ExoticComponent<attributes.LabelAttributes>;
var Image: ExoticComponent<attributes.ImageAttributes>;
var DOTAAbilityImage: ExoticComponent<attributes.DOTAAbilityImageAttributes>;
var DOTAItemImage: ExoticComponent<attributes.DOTAItemImageAttributes>;
var DOTAHeroImage: ExoticComponent<attributes.DOTAHeroImageAttributes>;
var DOTACountryFlagImage: ExoticComponent<attributes.DOTACountryFlagImageAttributes>;
var DOTALeagueImage: ExoticComponent<attributes.DOTALeagueImageAttributes>;
var EconItemImage: ExoticComponent<attributes.EconItemImageAttributes>;
var AnimatedImageStrip: ExoticComponent<attributes.AnimatedImageStripAttributes>;
var DOTAEmoticon: ExoticComponent<attributes.DOTAEmoticonAttributes>;
var Movie: ExoticComponent<attributes.MovieAttributes>;
var DOTAHeroMovie: ExoticComponent<attributes.DOTAHeroMovieAttributes>;
var DOTAScenePanel: ExoticComponent<attributes.DOTAScenePanelAttributes>;
var DOTAEconItem: ExoticComponent<attributes.DOTAEconItemAttributes>;
var ProgressBar: ExoticComponent<attributes.ProgressBarAttributes>;
var CircularProgressBar: ExoticComponent<attributes.CircularProgressBarAttributes>;
var ProgressBarWithMiddle: ExoticComponent<attributes.ProgressBarWithMiddleAttributes>;
var DOTAUserName: ExoticComponent<attributes.DOTAUserNameAttributes>;
var DOTAUserRichPresence: ExoticComponent<attributes.DOTAUserRichPresenceAttributes>;
var DOTAAvatarImage: ExoticComponent<attributes.DOTAAvatarImageAttributes>;
var Countdown: ExoticComponent<attributes.CountdownAttributes>;
var Button: ExoticComponent<attributes.PanelAttributes>;
var TextButton: ExoticComponent<attributes.TextButtonAttributes>;
var ToggleButton: ExoticComponent<attributes.ToggleButtonAttributes>;
var RadioButton: ExoticComponent<attributes.RadioButtonAttributes>;
var TextEntry: ExoticComponent<attributes.TextEntryAttributes>;
var NumberEntry: ExoticComponent<attributes.NumberEntryAttributes>;
var Slider: ExoticComponent<attributes.SliderAttributes>;
var SlottedSlider: ExoticComponent<attributes.SlottedSliderAttributes>;
var DropDown: ExoticComponent<attributes.DropDownAttributes>;
var ContextMenuScript: ExoticComponent<attributes.PanelAttributes>;
var Carousel: ExoticComponent<attributes.CarouselAttributes>;
var CarouselNav: ExoticComponent<attributes.CarouselNavAttributes>;
var DOTAHUDOverlayMap: ExoticComponent<attributes.DOTAHUDOverlayMapAttributes>;
var DOTAMinimap: ExoticComponent<attributes.PanelAttributes>;
var HTML: ExoticComponent<attributes.HTMLAttributes>;
var CustomLayoutPanel: ExoticComponent<attributes.CustomLayoutPanelAttributes>;
/**
* This element allows to render any unsupported Panorama panel type.
* All unknown attributes are assumed to be XML properties.
*
* @example
* return (
* <GenericPanel
* type="DOTABuffList"
* showdebuffs={false}
* style={{ backgroundColor: 'black' }}
* />
* );
*/
var GenericPanel: ExoticComponent<attributes.GenericPanelAttributes>;
/* eslint-enable */
}
// eslint-disable-next-line no-new-func
const global: typeof globalThis = new Function('return this')();
for (const panelName of [
'Panel',
'Label',
'Image',
'DOTAAbilityImage',
'DOTAItemImage',
'DOTAHeroImage',
'DOTACountryFlagImage',
'DOTALeagueImage',
'EconItemImage',
'AnimatedImageStrip',
'DOTAEmoticon',
'Movie',
'DOTAHeroMovie',
'DOTAScenePanel',
'DOTAEconItem',
'ProgressBar',
'CircularProgressBar',
'ProgressBarWithMiddle',
'DOTAUserName',
'DOTAUserRichPresence',
'DOTAAvatarImage',
'Countdown',
'Button',
'TextButton',
'ToggleButton',
'RadioButton',
'TextEntry',
'NumberEntry',
'Slider',
'SlottedSlider',
'DropDown',
'ContextMenuScript',
'Carousel',
'CarouselNav',
'DOTAHUDOverlayMap',
'DOTAMinimap',
'HTML',
'CustomLayoutPanel',
'GenericPanel',
] as const) {
global[panelName] = panelName as any;
}