-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshims-vue.d.ts
174 lines (160 loc) · 4.78 KB
/
shims-vue.d.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
declare module '*.vue' {
import Vue from 'vue';
export default Vue;
}
declare module 'vue-styled-components' {
import * as CSS from 'csstype';
import * as Vue from 'vue';
export type CSSProperties = CSS.Properties<string | number>;
export type CSSPseudos = { [K in CSS.Pseudos]?: CSSObject };
export interface CSSObject extends CSSProperties, CSSPseudos {
[key: string]: CSSObject | string | number | undefined;
}
export type CSS = CSSProperties;
type VueProps = {
[propsName: string]: {
type: new (...args: any[]) => unknown
default?: unknown
required?: boolean
validator?(value: unknown): boolean;
}
} | {
[propsName: string]: new (...args: any[]) => unknown
}
type PropsType<Props extends VueProps> = {
[K in keyof Props]:
Props[K] extends { type: new (...args: any[]) => unknown } ?
InstanceType<Props[K]['type']>
: Props[K] extends new (...args: any[]) => unknown ?
InstanceType<Props[K]>
: never
}
export type StyledComponent<Props extends VueProps> = Vue.Component & Vue.VueConstructor & {
extend<U extends VueProps>(cssRules: TemplateStringsArray, ...interpolate: TemplateStringsArray[]): StyledComponent<Props & U>
withComponent<V extends VueProps>(target: Vue.VueConstructor): StyledComponent<Props & V>
} & { new(props: PropsType<Props>): Vue.Component }
export type StyledComponentElements<T = HTMLElements> = {
[k in keyof T]: (str: TemplateStringsArray) => StyledComponent<{}>
}
export type Component = HTMLElements | keyof HTMLElements | Vue.Component | Vue.VueConstructor
export type Styled = StyledComponentElements & {
<T extends Component, Props extends VueProps>(Component: T, props?: Props): (str: TemplateStringsArray, ...placeholders: ((props: PropsType<Props>) => string | String | { toString: () => string | String })[]) => StyledComponent<Props>
}
export interface HTMLElements {
a: HTMLAnchorElement
abbr: HTMLElement
address: HTMLElement
area: HTMLAreaElement
article: HTMLElement
aside: HTMLElement
audio: HTMLAudioElement
b: HTMLElement
base: HTMLBaseElement
bdi: HTMLElement
bdo: HTMLElement
big: HTMLElement
blockquote: HTMLElement
body: HTMLBodyElement
br: HTMLBRElement
button: HTMLButtonElement
canvas: HTMLCanvasElement
caption: HTMLElement
cite: HTMLElement
code: HTMLElement
col: HTMLTableColElement
colgroup: HTMLTableColElement
data: HTMLElement
datalist: HTMLDataListElement
dd: HTMLElement
del: HTMLElement
details: HTMLElement
dfn: HTMLElement
dialog: HTMLDialogElement
div: HTMLDivElement
dl: HTMLDListElement
dt: HTMLElement
em: HTMLElement
embed: HTMLEmbedElement
fieldset: HTMLFieldSetElement
figcaption: HTMLElement
figure: HTMLElement
footer: HTMLElement
form: HTMLFormElement
h1: HTMLHeadingElement
h2: HTMLHeadingElement
h3: HTMLHeadingElement
h4: HTMLHeadingElement
h5: HTMLHeadingElement
h6: HTMLHeadingElement
head: HTMLElement
header: HTMLElement
hgroup: HTMLElement
hr: HTMLHRElement
html: HTMLHtmlElement
i: HTMLElement
iframe: HTMLIFrameElement
img: HTMLImageElement
input: HTMLInputElement
ins: HTMLModElement
kbd: HTMLElement
keygen: HTMLElement
label: HTMLLabelElement
legend: HTMLLegendElement
li: HTMLLIElement
link: HTMLLinkElement
main: HTMLElement
map: HTMLMapElement
mark: HTMLElement
menu: HTMLElement
menuitem: HTMLElement
meta: HTMLMetaElement
meter: HTMLElement
nav: HTMLElement
noscript: HTMLElement
object: HTMLObjectElement
ol: HTMLOListElement
optgroup: HTMLOptGroupElement
option: HTMLOptionElement
output: HTMLElement
p: HTMLParagraphElement
param: HTMLParamElement
picture: HTMLElement
pre: HTMLPreElement
progress: HTMLProgressElement
q: HTMLQuoteElement
rp: HTMLElement
rt: HTMLElement
ruby: HTMLElement
s: HTMLElement
samp: HTMLElement
script: HTMLScriptElement
section: HTMLElement
select: HTMLSelectElement
small: HTMLElement
source: HTMLSourceElement
span: HTMLSpanElement
strong: HTMLElement
style: HTMLStyleElement
sub: HTMLElement
summary: HTMLElement
sup: HTMLElement
table: HTMLTableElement
tbody: HTMLTableSectionElement
td: HTMLTableDataCellElement
textarea: HTMLTextAreaElement
tfoot: HTMLTableSectionElement
th: HTMLTableHeaderCellElement
thead: HTMLTableSectionElement
time: HTMLElement
title: HTMLTitleElement
tr: HTMLTableRowElement
track: HTMLTrackElement
u: HTMLElement
ul: HTMLUListElement
var: HTMLElement
video: HTMLVideoElement
wbr: HTMLElement
}
export let styled: Styled;
export default styled;
}