kiru 0.44.4
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/LICENSE +7 -0
- package/README.md +5 -0
- package/package.json +81 -0
- package/src/appContext.ts +186 -0
- package/src/cloneVNode.ts +14 -0
- package/src/constants.ts +146 -0
- package/src/context.ts +56 -0
- package/src/dom.ts +712 -0
- package/src/element.ts +54 -0
- package/src/env.ts +6 -0
- package/src/error.ts +85 -0
- package/src/flags.ts +15 -0
- package/src/form/index.ts +662 -0
- package/src/form/types.ts +261 -0
- package/src/form/utils.ts +19 -0
- package/src/generateId.ts +19 -0
- package/src/globalContext.ts +161 -0
- package/src/globals.ts +21 -0
- package/src/hmr.ts +178 -0
- package/src/hooks/index.ts +14 -0
- package/src/hooks/useAsync.ts +136 -0
- package/src/hooks/useCallback.ts +31 -0
- package/src/hooks/useContext.ts +79 -0
- package/src/hooks/useEffect.ts +44 -0
- package/src/hooks/useEffectEvent.ts +24 -0
- package/src/hooks/useId.ts +42 -0
- package/src/hooks/useLayoutEffect.ts +47 -0
- package/src/hooks/useMemo.ts +33 -0
- package/src/hooks/useReducer.ts +50 -0
- package/src/hooks/useRef.ts +40 -0
- package/src/hooks/useState.ts +62 -0
- package/src/hooks/useSyncExternalStore.ts +59 -0
- package/src/hooks/useViewTransition.ts +26 -0
- package/src/hooks/utils.ts +259 -0
- package/src/hydration.ts +67 -0
- package/src/index.ts +61 -0
- package/src/jsx.ts +11 -0
- package/src/lazy.ts +238 -0
- package/src/memo.ts +48 -0
- package/src/portal.ts +43 -0
- package/src/profiling.ts +105 -0
- package/src/props.ts +36 -0
- package/src/reconciler.ts +531 -0
- package/src/renderToString.ts +91 -0
- package/src/router/index.ts +2 -0
- package/src/router/route.ts +51 -0
- package/src/router/router.ts +275 -0
- package/src/router/routerUtils.ts +49 -0
- package/src/scheduler.ts +522 -0
- package/src/signals/base.ts +237 -0
- package/src/signals/computed.ts +139 -0
- package/src/signals/effect.ts +60 -0
- package/src/signals/globals.ts +11 -0
- package/src/signals/index.ts +12 -0
- package/src/signals/jsx.ts +45 -0
- package/src/signals/types.ts +10 -0
- package/src/signals/utils.ts +12 -0
- package/src/signals/watch.ts +151 -0
- package/src/ssr/client.ts +29 -0
- package/src/ssr/hydrationBoundary.ts +63 -0
- package/src/ssr/index.ts +1 -0
- package/src/ssr/server.ts +124 -0
- package/src/store.ts +241 -0
- package/src/swr.ts +360 -0
- package/src/transition.ts +80 -0
- package/src/types.dom.ts +1250 -0
- package/src/types.ts +209 -0
- package/src/types.utils.ts +39 -0
- package/src/utils.ts +581 -0
- package/src/warning.ts +9 -0
package/src/types.dom.ts
ADDED
|
@@ -0,0 +1,1250 @@
|
|
|
1
|
+
import { Signal } from "./signals"
|
|
2
|
+
import type { Prettify, Signalable } from "./types.utils"
|
|
3
|
+
|
|
4
|
+
export type {
|
|
5
|
+
HTMLTagToElement,
|
|
6
|
+
SVGTagToElement,
|
|
7
|
+
HtmlElementAttributes,
|
|
8
|
+
HtmlElementBindableProps,
|
|
9
|
+
SvgElementAttributes,
|
|
10
|
+
SvgGlobalAttributes,
|
|
11
|
+
GlobalAttributes,
|
|
12
|
+
StyleObject,
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type HTMLTagToElement<T extends keyof HtmlElementAttributes> =
|
|
16
|
+
T extends keyof HTMLElementTagNameMap
|
|
17
|
+
? HTMLElementTagNameMap[T]
|
|
18
|
+
: T extends keyof HTMLElementDeprecatedTagNameMap
|
|
19
|
+
? HTMLElementDeprecatedTagNameMap[T]
|
|
20
|
+
: never
|
|
21
|
+
|
|
22
|
+
type SVGTagToElement<T extends keyof SvgElementAttributes> =
|
|
23
|
+
T extends keyof SVGElementTagNameMap ? SVGElementTagNameMap[T] : never
|
|
24
|
+
|
|
25
|
+
type NumericStyleKeys =
|
|
26
|
+
// Layout: Margin, Padding, Position
|
|
27
|
+
| "bottom"
|
|
28
|
+
| "gap"
|
|
29
|
+
| "inset"
|
|
30
|
+
| "insetBlock"
|
|
31
|
+
| "insetBlockEnd"
|
|
32
|
+
| "insetBlockStart"
|
|
33
|
+
| "insetInline"
|
|
34
|
+
| "insetInlineEnd"
|
|
35
|
+
| "insetInlineStart"
|
|
36
|
+
| "left"
|
|
37
|
+
| "margin"
|
|
38
|
+
| "marginBlock"
|
|
39
|
+
| "marginBlockEnd"
|
|
40
|
+
| "marginBlockStart"
|
|
41
|
+
| "marginInline"
|
|
42
|
+
| "marginInlineEnd"
|
|
43
|
+
| "marginInlineStart"
|
|
44
|
+
| "padding"
|
|
45
|
+
| "paddingBlock"
|
|
46
|
+
| "paddingBlockEnd"
|
|
47
|
+
| "paddingBlockStart"
|
|
48
|
+
| "paddingInline"
|
|
49
|
+
| "paddingInlineEnd"
|
|
50
|
+
| "paddingInlineStart"
|
|
51
|
+
| "right"
|
|
52
|
+
| "top"
|
|
53
|
+
|
|
54
|
+
// Sizing
|
|
55
|
+
| "height"
|
|
56
|
+
| "maxHeight"
|
|
57
|
+
| "maxWidth"
|
|
58
|
+
| "minHeight"
|
|
59
|
+
| "minWidth"
|
|
60
|
+
| "width"
|
|
61
|
+
|
|
62
|
+
// Flexbox
|
|
63
|
+
| "flexBasis"
|
|
64
|
+
| "flexGrow"
|
|
65
|
+
| "flexShrink"
|
|
66
|
+
| "order"
|
|
67
|
+
|
|
68
|
+
// Grid
|
|
69
|
+
| "columnGap"
|
|
70
|
+
| "gridAutoColumns"
|
|
71
|
+
| "gridAutoRows"
|
|
72
|
+
| "gridColumnGap" // legacy, still used in some cases
|
|
73
|
+
| "gridRowGap" // legacy
|
|
74
|
+
| "rowGap"
|
|
75
|
+
|
|
76
|
+
// Border
|
|
77
|
+
| "borderBottomWidth"
|
|
78
|
+
| "borderImageOutset"
|
|
79
|
+
| "borderImageSlice"
|
|
80
|
+
| "borderImageWidth"
|
|
81
|
+
| "borderLeftWidth"
|
|
82
|
+
| "borderRadius"
|
|
83
|
+
| "borderRightWidth"
|
|
84
|
+
| "borderSpacing"
|
|
85
|
+
| "borderTopWidth"
|
|
86
|
+
| "borderWidth"
|
|
87
|
+
|
|
88
|
+
// Typography
|
|
89
|
+
| "fontSize"
|
|
90
|
+
| "letterSpacing"
|
|
91
|
+
| "lineHeight"
|
|
92
|
+
| "tabSize"
|
|
93
|
+
| "textIndent"
|
|
94
|
+
| "wordSpacing"
|
|
95
|
+
|
|
96
|
+
// Scroll Margin
|
|
97
|
+
| "scrollMargin"
|
|
98
|
+
| "scrollMarginBlock"
|
|
99
|
+
| "scrollMarginBlockEnd"
|
|
100
|
+
| "scrollMarginBlockStart"
|
|
101
|
+
| "scrollMarginBottom"
|
|
102
|
+
| "scrollMarginInline"
|
|
103
|
+
| "scrollMarginInlineEnd"
|
|
104
|
+
| "scrollMarginInlineStart"
|
|
105
|
+
| "scrollMarginLeft"
|
|
106
|
+
| "scrollMarginRight"
|
|
107
|
+
| "scrollMarginTop"
|
|
108
|
+
|
|
109
|
+
// Scroll Padding
|
|
110
|
+
| "scrollPadding"
|
|
111
|
+
| "scrollPaddingBlock"
|
|
112
|
+
| "scrollPaddingBlockEnd"
|
|
113
|
+
| "scrollPaddingBlockStart"
|
|
114
|
+
| "scrollPaddingBottom"
|
|
115
|
+
| "scrollPaddingInline"
|
|
116
|
+
| "scrollPaddingInlineEnd"
|
|
117
|
+
| "scrollPaddingInlineStart"
|
|
118
|
+
| "scrollPaddingLeft"
|
|
119
|
+
| "scrollPaddingRight"
|
|
120
|
+
| "scrollPaddingTop"
|
|
121
|
+
|
|
122
|
+
// Animation / Transition
|
|
123
|
+
| "animationDelay"
|
|
124
|
+
| "animationDuration"
|
|
125
|
+
| "transitionDelay"
|
|
126
|
+
| "transitionDuration"
|
|
127
|
+
|
|
128
|
+
// Transform (treated as numeric in APIs)
|
|
129
|
+
| "rotate"
|
|
130
|
+
| "scale"
|
|
131
|
+
| "translate"
|
|
132
|
+
|
|
133
|
+
// Effects
|
|
134
|
+
| "boxShadow"
|
|
135
|
+
| "zIndex"
|
|
136
|
+
| "opacity"
|
|
137
|
+
|
|
138
|
+
type FunctionKeys<T> = {
|
|
139
|
+
[K in keyof T]: T[K] extends (...args: any) => any ? K : never
|
|
140
|
+
}[keyof T]
|
|
141
|
+
|
|
142
|
+
type AllStyleRules = Omit<
|
|
143
|
+
CSSStyleDeclaration,
|
|
144
|
+
| typeof Symbol.iterator
|
|
145
|
+
| FunctionKeys<CSSStyleDeclaration>
|
|
146
|
+
| "length"
|
|
147
|
+
| "parentRule"
|
|
148
|
+
> & {
|
|
149
|
+
[Key in `--${string}`]: string | number
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
type StyleObject = Prettify<
|
|
153
|
+
Partial<{
|
|
154
|
+
[Key in keyof AllStyleRules & string]: Key extends NumericStyleKeys
|
|
155
|
+
? number | string
|
|
156
|
+
: AllStyleRules[Key]
|
|
157
|
+
}>
|
|
158
|
+
>
|
|
159
|
+
|
|
160
|
+
type ValidUrl = `http${"s" | ""}://${string}`
|
|
161
|
+
type ValidPath = `/${string}`
|
|
162
|
+
type ValidUrlOrPath = ValidUrl | ValidPath | string
|
|
163
|
+
type ListOfUrlsOrPaths = string
|
|
164
|
+
type FileName = string
|
|
165
|
+
|
|
166
|
+
type MediaPreload = "none" | "metadata" | "auto" | ""
|
|
167
|
+
type HTMLMediaElementAttrs = {
|
|
168
|
+
autoplay?: boolean
|
|
169
|
+
controls?: boolean
|
|
170
|
+
crossOrigin?: string
|
|
171
|
+
loop?: boolean
|
|
172
|
+
muted?: boolean
|
|
173
|
+
preload?: MediaPreload
|
|
174
|
+
preservesPitch?: boolean
|
|
175
|
+
src?: string
|
|
176
|
+
srcObject?: MediaProvider | null
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
type FormAction = ValidUrlOrPath
|
|
180
|
+
type InputType =
|
|
181
|
+
| "button"
|
|
182
|
+
| "checkbox"
|
|
183
|
+
| "color"
|
|
184
|
+
| "date"
|
|
185
|
+
| "datetime-local"
|
|
186
|
+
| "email"
|
|
187
|
+
| "file"
|
|
188
|
+
| "hidden"
|
|
189
|
+
| "image"
|
|
190
|
+
| "month"
|
|
191
|
+
| "number"
|
|
192
|
+
| "password"
|
|
193
|
+
| "radio"
|
|
194
|
+
| "range"
|
|
195
|
+
| "reset"
|
|
196
|
+
| "search"
|
|
197
|
+
| "submit"
|
|
198
|
+
| "tel"
|
|
199
|
+
| "text"
|
|
200
|
+
| "time"
|
|
201
|
+
| "url"
|
|
202
|
+
| "week"
|
|
203
|
+
|
|
204
|
+
type InputMode =
|
|
205
|
+
| "decimal"
|
|
206
|
+
| "email"
|
|
207
|
+
| "none"
|
|
208
|
+
| "numeric"
|
|
209
|
+
| "search"
|
|
210
|
+
| "text"
|
|
211
|
+
| "tel"
|
|
212
|
+
| "url"
|
|
213
|
+
|
|
214
|
+
type LanguageCode =
|
|
215
|
+
| "en"
|
|
216
|
+
| "fr"
|
|
217
|
+
| "es"
|
|
218
|
+
| "de"
|
|
219
|
+
| "it"
|
|
220
|
+
| "pt"
|
|
221
|
+
| "ru"
|
|
222
|
+
| "zh"
|
|
223
|
+
| string
|
|
224
|
+
type MediaQuery = string
|
|
225
|
+
type MediaType = string
|
|
226
|
+
type MimeType = string
|
|
227
|
+
type ReferrerPolicy =
|
|
228
|
+
| "no-referrer"
|
|
229
|
+
| "no-referrer-when-downgrade"
|
|
230
|
+
| "origin"
|
|
231
|
+
| "origin-when-cross-origin"
|
|
232
|
+
| "unsafe-url"
|
|
233
|
+
|
|
234
|
+
type AnchorRel =
|
|
235
|
+
| "alternate"
|
|
236
|
+
| "author"
|
|
237
|
+
| "bookmark"
|
|
238
|
+
| "external"
|
|
239
|
+
| "help"
|
|
240
|
+
| "license"
|
|
241
|
+
| "next"
|
|
242
|
+
| "nofollow"
|
|
243
|
+
| "noreferrer"
|
|
244
|
+
| "noopener"
|
|
245
|
+
| "prev"
|
|
246
|
+
| "search"
|
|
247
|
+
| "tag"
|
|
248
|
+
|
|
249
|
+
type LinkRel =
|
|
250
|
+
| "alternate"
|
|
251
|
+
| "archives"
|
|
252
|
+
| "author"
|
|
253
|
+
| "bookmark"
|
|
254
|
+
| "external"
|
|
255
|
+
| "first"
|
|
256
|
+
| "help"
|
|
257
|
+
| "icon"
|
|
258
|
+
| "last"
|
|
259
|
+
| "license"
|
|
260
|
+
| "next"
|
|
261
|
+
| "nofollow"
|
|
262
|
+
| "noreferrer"
|
|
263
|
+
| "pingback"
|
|
264
|
+
| "prefetch"
|
|
265
|
+
| "preload"
|
|
266
|
+
| "prev"
|
|
267
|
+
| "search"
|
|
268
|
+
| "sidebar"
|
|
269
|
+
| "stylesheet"
|
|
270
|
+
| "tag"
|
|
271
|
+
| "up"
|
|
272
|
+
|
|
273
|
+
type Loading = "eager" | "lazy"
|
|
274
|
+
|
|
275
|
+
type Target = "_blank" | "_self" | "_parent" | "_top"
|
|
276
|
+
|
|
277
|
+
type EncType =
|
|
278
|
+
| "application/x-www-form-urlencoded"
|
|
279
|
+
| "multipart/form-data"
|
|
280
|
+
| "text/plain"
|
|
281
|
+
|
|
282
|
+
type IFrameSandbox = string | boolean
|
|
283
|
+
// | "allow-forms"
|
|
284
|
+
// | "allow-modals"
|
|
285
|
+
// | "allow-orientation-lock"
|
|
286
|
+
// | "allow-pointer-lock"
|
|
287
|
+
// | "allow-popups"
|
|
288
|
+
// | "allow-popups-to-escape-sandbox"
|
|
289
|
+
// | "allow-presentation"
|
|
290
|
+
// | "allow-same-origin"
|
|
291
|
+
// | "allow-scripts"
|
|
292
|
+
// | "allow-top-navigation"
|
|
293
|
+
// | "allow-top-navigation-by-user-activation"
|
|
294
|
+
|
|
295
|
+
type InputAccept = "audio/*" | "video/*" | "image/*" | MimeType
|
|
296
|
+
type AutoComplete = "on" | "off"
|
|
297
|
+
type FormMethod = "get" | "post" | "dialog"
|
|
298
|
+
|
|
299
|
+
type Direction = "ltr" | "rtl" | "auto"
|
|
300
|
+
|
|
301
|
+
type GlobalAttributes = {
|
|
302
|
+
accessKey?: string
|
|
303
|
+
autocapitalize?: "on" | "off" | "none" | "sentences" | "words" | "characters"
|
|
304
|
+
className?: string
|
|
305
|
+
contentEditable?: boolean
|
|
306
|
+
dir?: Direction
|
|
307
|
+
draggable?: boolean | "auto"
|
|
308
|
+
hidden?: boolean
|
|
309
|
+
id?: string
|
|
310
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#inputmode) */
|
|
311
|
+
inputMode?: InputMode
|
|
312
|
+
lang?: LanguageCode
|
|
313
|
+
spellcheck?: boolean | "default"
|
|
314
|
+
style?: string | StyleObject
|
|
315
|
+
tabIndex?: number
|
|
316
|
+
title?: string
|
|
317
|
+
translate?: "yes" | "no"
|
|
318
|
+
popover?: "auto" | "manual" | boolean
|
|
319
|
+
inert?: boolean
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
type NativeAnimationEvent = AnimationEvent
|
|
323
|
+
type NativeClipboardEvent = ClipboardEvent
|
|
324
|
+
type NativeCompositionEvent = CompositionEvent
|
|
325
|
+
type NativeDragEvent = DragEvent
|
|
326
|
+
type NativeFocusEvent = FocusEvent
|
|
327
|
+
type NativeKeyboardEvent = KeyboardEvent
|
|
328
|
+
type NativeMouseEvent = MouseEvent
|
|
329
|
+
type NativeTouchEvent = TouchEvent
|
|
330
|
+
type NativePointerEvent = PointerEvent
|
|
331
|
+
type NativeSubmitEvent = SubmitEvent
|
|
332
|
+
type NativeToggleEvent = ToggleEvent
|
|
333
|
+
type NativeTransitionEvent = TransitionEvent
|
|
334
|
+
type NativeUIEvent = UIEvent
|
|
335
|
+
type NativeWheelEvent = WheelEvent
|
|
336
|
+
|
|
337
|
+
type NoChildElementElement =
|
|
338
|
+
| HTMLAreaElement
|
|
339
|
+
| HTMLBaseElement
|
|
340
|
+
| HTMLBRElement
|
|
341
|
+
| HTMLEmbedElement
|
|
342
|
+
| HTMLHRElement
|
|
343
|
+
| HTMLImageElement
|
|
344
|
+
| HTMLInputElement
|
|
345
|
+
| HTMLLinkElement
|
|
346
|
+
| HTMLMetaElement
|
|
347
|
+
| HTMLSourceElement
|
|
348
|
+
| HTMLTrackElement
|
|
349
|
+
| HTMLTextAreaElement
|
|
350
|
+
|
|
351
|
+
declare global {
|
|
352
|
+
namespace Kaioken {
|
|
353
|
+
type DOMEvent<E = Event, C = unknown, T = unknown> = Omit<
|
|
354
|
+
E,
|
|
355
|
+
"target" | "currentTarget"
|
|
356
|
+
> & {
|
|
357
|
+
target: C extends NoChildElementElement
|
|
358
|
+
? EventTarget & C
|
|
359
|
+
: EventTarget & T
|
|
360
|
+
currentTarget: EventTarget & C
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
type EventHandler<E extends DOMEvent> = {
|
|
364
|
+
bivarianceHack(event: E): void
|
|
365
|
+
}["bivarianceHack"]
|
|
366
|
+
|
|
367
|
+
type BaseEventHandler<T = Element> = EventHandler<DOMEvent<Event, T>>
|
|
368
|
+
type AnimationEvent<T = Element> = DOMEvent<NativeAnimationEvent, T>
|
|
369
|
+
type ClipboardEvent<T = Element> = DOMEvent<NativeClipboardEvent, T>
|
|
370
|
+
type CompositionEvent<T = Element> = DOMEvent<NativeCompositionEvent, T>
|
|
371
|
+
type DragEvent<T = Element> = DOMEvent<NativeDragEvent, T>
|
|
372
|
+
type FocusEvent<T = Element> = DOMEvent<NativeFocusEvent, T>
|
|
373
|
+
type FormEvent<T = Element> = DOMEvent<Event, T>
|
|
374
|
+
type KeyboardEvent<T = Element> = DOMEvent<NativeKeyboardEvent, T>
|
|
375
|
+
type MouseEvent<T = Element> = DOMEvent<NativeMouseEvent, T>
|
|
376
|
+
type PointerEvent<T = Element> = DOMEvent<NativePointerEvent, T>
|
|
377
|
+
type SubmitEvent<T = Element> = DOMEvent<NativeSubmitEvent, T>
|
|
378
|
+
type TouchEvent<T = Element> = DOMEvent<NativeTouchEvent, T>
|
|
379
|
+
type ToggleEvent<T = Element> = DOMEvent<NativeToggleEvent, T>
|
|
380
|
+
type TransitionEvent<T = Element> = DOMEvent<NativeTransitionEvent, T>
|
|
381
|
+
type UIEvent<T = Element> = DOMEvent<NativeUIEvent, T>
|
|
382
|
+
type WheelEvent<T = Element> = DOMEvent<NativeWheelEvent, T>
|
|
383
|
+
|
|
384
|
+
type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>
|
|
385
|
+
type CompositionEventHandler<T = Element> = EventHandler<
|
|
386
|
+
CompositionEvent<T>
|
|
387
|
+
>
|
|
388
|
+
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>
|
|
389
|
+
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>
|
|
390
|
+
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>
|
|
391
|
+
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>
|
|
392
|
+
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>
|
|
393
|
+
type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>
|
|
394
|
+
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>
|
|
395
|
+
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>
|
|
396
|
+
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>
|
|
397
|
+
type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>
|
|
398
|
+
type ToggleEventHandler<T = Element> = EventHandler<ToggleEvent<T>>
|
|
399
|
+
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>
|
|
400
|
+
|
|
401
|
+
type EventAttributes<T = Element> = {
|
|
402
|
+
// Clipboard Events
|
|
403
|
+
oncopy?: ClipboardEventHandler<T> | undefined
|
|
404
|
+
oncut?: ClipboardEventHandler<T> | undefined
|
|
405
|
+
onpaste?: ClipboardEventHandler<T> | undefined
|
|
406
|
+
|
|
407
|
+
// Composition Events
|
|
408
|
+
oncompositionend?: CompositionEventHandler<T> | undefined
|
|
409
|
+
oncompositionstart?: CompositionEventHandler<T> | undefined
|
|
410
|
+
oncompositionupdate?: CompositionEventHandler<T> | undefined
|
|
411
|
+
|
|
412
|
+
// Focus Events
|
|
413
|
+
onfocus?: FocusEventHandler<T> | undefined
|
|
414
|
+
onblur?: FocusEventHandler<T> | undefined
|
|
415
|
+
|
|
416
|
+
// Form Events
|
|
417
|
+
onchange?: FormEventHandler<T> | undefined
|
|
418
|
+
onbeforeinput?: FormEventHandler<T> | undefined
|
|
419
|
+
oninput?: FormEventHandler<T> | undefined
|
|
420
|
+
onreset?: FormEventHandler<T> | undefined
|
|
421
|
+
onsubmit?: FormEventHandler<T> | undefined
|
|
422
|
+
oninvalid?: FormEventHandler<T> | undefined
|
|
423
|
+
|
|
424
|
+
// Image Events
|
|
425
|
+
onload?: BaseEventHandler<T> | undefined
|
|
426
|
+
onerror?: BaseEventHandler<T> | undefined
|
|
427
|
+
|
|
428
|
+
// Keyboard Events
|
|
429
|
+
onkeydown?: KeyboardEventHandler<T> | undefined
|
|
430
|
+
onkeypress?: KeyboardEventHandler<T> | undefined
|
|
431
|
+
onkeyup?: KeyboardEventHandler<T> | undefined
|
|
432
|
+
|
|
433
|
+
// Media Events
|
|
434
|
+
onabort?: BaseEventHandler<T> | undefined
|
|
435
|
+
oncanplay?: BaseEventHandler<T> | undefined
|
|
436
|
+
oncanplaythrough?: BaseEventHandler<T> | undefined
|
|
437
|
+
ondurationchange?: BaseEventHandler<T> | undefined
|
|
438
|
+
onemptied?: BaseEventHandler<T> | undefined
|
|
439
|
+
onencrypted?: BaseEventHandler<T> | undefined
|
|
440
|
+
onended?: BaseEventHandler<T> | undefined
|
|
441
|
+
onloadeddata?: BaseEventHandler<T> | undefined
|
|
442
|
+
onloadedmetadata?: BaseEventHandler<T> | undefined
|
|
443
|
+
onloadstart?: BaseEventHandler<T> | undefined
|
|
444
|
+
onpause?: BaseEventHandler<T> | undefined
|
|
445
|
+
onplay?: BaseEventHandler<T> | undefined
|
|
446
|
+
onplaying?: BaseEventHandler<T> | undefined
|
|
447
|
+
onprogress?: BaseEventHandler<T> | undefined
|
|
448
|
+
onratechange?: BaseEventHandler<T> | undefined
|
|
449
|
+
onresize?: BaseEventHandler<T> | undefined
|
|
450
|
+
onseeked?: BaseEventHandler<T> | undefined
|
|
451
|
+
onseeking?: BaseEventHandler<T> | undefined
|
|
452
|
+
onstalled?: BaseEventHandler<T> | undefined
|
|
453
|
+
onsuspend?: BaseEventHandler<T> | undefined
|
|
454
|
+
ontimeupdate?: BaseEventHandler<T> | undefined
|
|
455
|
+
onvolumechange?: BaseEventHandler<T> | undefined
|
|
456
|
+
onwaiting?: BaseEventHandler<T> | undefined
|
|
457
|
+
|
|
458
|
+
// Mouse Events
|
|
459
|
+
onauxclick?: MouseEventHandler<T> | undefined
|
|
460
|
+
onclick?: MouseEventHandler<T> | undefined
|
|
461
|
+
oncontextmenu?: MouseEventHandler<T> | undefined
|
|
462
|
+
ondblclick?: MouseEventHandler<T> | undefined
|
|
463
|
+
ondrag?: DragEventHandler<T> | undefined
|
|
464
|
+
ondragend?: DragEventHandler<T> | undefined
|
|
465
|
+
ondragenter?: DragEventHandler<T> | undefined
|
|
466
|
+
ondragexit?: DragEventHandler<T> | undefined
|
|
467
|
+
ondragleave?: DragEventHandler<T> | undefined
|
|
468
|
+
ondragover?: DragEventHandler<T> | undefined
|
|
469
|
+
ondragstart?: DragEventHandler<T> | undefined
|
|
470
|
+
ondrop?: DragEventHandler<T> | undefined
|
|
471
|
+
onmousedown?: MouseEventHandler<T> | undefined
|
|
472
|
+
onmouseenter?: MouseEventHandler<T> | undefined
|
|
473
|
+
onmouseleave?: MouseEventHandler<T> | undefined
|
|
474
|
+
onmousemove?: MouseEventHandler<T> | undefined
|
|
475
|
+
onmouseout?: MouseEventHandler<T> | undefined
|
|
476
|
+
onmouseover?: MouseEventHandler<T> | undefined
|
|
477
|
+
onmouseup?: MouseEventHandler<T> | undefined
|
|
478
|
+
|
|
479
|
+
// Selection Events
|
|
480
|
+
onselect?: BaseEventHandler<T> | undefined
|
|
481
|
+
|
|
482
|
+
// Touch Events
|
|
483
|
+
ontouchcancel?: TouchEventHandler<T> | undefined
|
|
484
|
+
ontouchend?: TouchEventHandler<T> | undefined
|
|
485
|
+
ontouchmove?: TouchEventHandler<T> | undefined
|
|
486
|
+
ontouchstart?: TouchEventHandler<T> | undefined
|
|
487
|
+
|
|
488
|
+
// Pointer Events
|
|
489
|
+
onpointerdown?: PointerEventHandler<T> | undefined
|
|
490
|
+
onpointermove?: PointerEventHandler<T> | undefined
|
|
491
|
+
onpointerup?: PointerEventHandler<T> | undefined
|
|
492
|
+
onpointercancel?: PointerEventHandler<T> | undefined
|
|
493
|
+
onpointerenter?: PointerEventHandler<T> | undefined
|
|
494
|
+
onpointerleave?: PointerEventHandler<T> | undefined
|
|
495
|
+
onpointerover?: PointerEventHandler<T> | undefined
|
|
496
|
+
onpointerout?: PointerEventHandler<T> | undefined
|
|
497
|
+
ongotpointercapture?: PointerEventHandler<T> | undefined
|
|
498
|
+
onlostpointercapture?: PointerEventHandler<T> | undefined
|
|
499
|
+
|
|
500
|
+
// UI Events
|
|
501
|
+
onscroll?: UIEventHandler<T> | undefined
|
|
502
|
+
onscrollend?: UIEventHandler<T> | undefined
|
|
503
|
+
|
|
504
|
+
// Wheel Events
|
|
505
|
+
onwheel?: WheelEventHandler<T> | undefined
|
|
506
|
+
|
|
507
|
+
// Animation Events
|
|
508
|
+
onanimationstart?: AnimationEventHandler<T> | undefined
|
|
509
|
+
onanimationend?: AnimationEventHandler<T> | undefined
|
|
510
|
+
onanimationiteration?: AnimationEventHandler<T> | undefined
|
|
511
|
+
|
|
512
|
+
// Toggle Events
|
|
513
|
+
ontoggle?: ToggleEventHandler<T> | undefined
|
|
514
|
+
onbeforetoggle?: ToggleEventHandler<T> | undefined
|
|
515
|
+
|
|
516
|
+
// Transition Events
|
|
517
|
+
ontransitioncancel?: TransitionEventHandler<T> | undefined
|
|
518
|
+
ontransitionend?: TransitionEventHandler<T> | undefined
|
|
519
|
+
ontransitionrun?: TransitionEventHandler<T> | undefined
|
|
520
|
+
ontransitionstart?: TransitionEventHandler<T> | undefined
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
type ElementReference<T extends HTMLElement> = T | null | string
|
|
526
|
+
|
|
527
|
+
type PopoverControlAttributes = {
|
|
528
|
+
popoverTarget?: string
|
|
529
|
+
popoverTargetAction?: "show" | "hide" | "toggle"
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
declare class DoNotUseBindWithPlainError extends Error {
|
|
533
|
+
$brand: "DoNotUseBindWithPlainError"
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
type BindableProp<K extends string, V> =
|
|
537
|
+
| ({
|
|
538
|
+
[k in K]?: Signalable<V>
|
|
539
|
+
} & { [k in `bind:${K}`]?: DoNotUseBindWithPlainError })
|
|
540
|
+
| ({
|
|
541
|
+
[k in `bind:${K}`]?: Signal<V>
|
|
542
|
+
} & { [k in K]?: DoNotUseBindWithPlainError })
|
|
543
|
+
|
|
544
|
+
type MediaElementBindableProps = BindableProp<"volume", number> &
|
|
545
|
+
BindableProp<"playbackRate", number> &
|
|
546
|
+
BindableProp<"currentTime", number>
|
|
547
|
+
|
|
548
|
+
interface HtmlElementBindableProps {
|
|
549
|
+
input: BindableProp<"value", string | number> &
|
|
550
|
+
BindableProp<"checked", boolean>
|
|
551
|
+
textarea: BindableProp<"value", string>
|
|
552
|
+
select:
|
|
553
|
+
| ({
|
|
554
|
+
multiple: true
|
|
555
|
+
} & BindableProp<"value", string[]>)
|
|
556
|
+
| ({
|
|
557
|
+
multiple?: false
|
|
558
|
+
} & BindableProp<"value", string>)
|
|
559
|
+
details: BindableProp<"open", boolean>
|
|
560
|
+
dialog: BindableProp<"open", boolean>
|
|
561
|
+
audio: MediaElementBindableProps
|
|
562
|
+
video: MediaElementBindableProps
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
interface HtmlElementAttributes {
|
|
566
|
+
a: {
|
|
567
|
+
autofocus?: boolean
|
|
568
|
+
download?: FileName
|
|
569
|
+
href?: ValidUrlOrPath
|
|
570
|
+
hreflang?: LanguageCode
|
|
571
|
+
media?: MediaQuery
|
|
572
|
+
target?: Target
|
|
573
|
+
rel?: AnchorRel
|
|
574
|
+
type?: MediaType
|
|
575
|
+
ping?: ListOfUrlsOrPaths
|
|
576
|
+
mask?: string
|
|
577
|
+
}
|
|
578
|
+
abbr: {}
|
|
579
|
+
address: {}
|
|
580
|
+
area: HtmlElementAttributes["a"] & {
|
|
581
|
+
alt?: string
|
|
582
|
+
coords?: string
|
|
583
|
+
shape?: "default" | "rect" | "circle" | "poly"
|
|
584
|
+
}
|
|
585
|
+
article: {}
|
|
586
|
+
aside: {}
|
|
587
|
+
audio: HTMLMediaElementAttrs
|
|
588
|
+
b: {}
|
|
589
|
+
base: {
|
|
590
|
+
href?: ValidUrlOrPath
|
|
591
|
+
target?: Target
|
|
592
|
+
}
|
|
593
|
+
bdi: {}
|
|
594
|
+
bdo: {}
|
|
595
|
+
big: {}
|
|
596
|
+
blockquote: {
|
|
597
|
+
cite?: string
|
|
598
|
+
}
|
|
599
|
+
body: {}
|
|
600
|
+
br: {}
|
|
601
|
+
button: {
|
|
602
|
+
autofocus?: boolean
|
|
603
|
+
disabled?: boolean
|
|
604
|
+
form?: ElementReference<HTMLFormElement>
|
|
605
|
+
formAction?: FormAction
|
|
606
|
+
formEnctype?: EncType
|
|
607
|
+
formMethod?: FormMethod
|
|
608
|
+
name?: string
|
|
609
|
+
type?: "button" | "reset" | "submit"
|
|
610
|
+
value?: string
|
|
611
|
+
} & PopoverControlAttributes
|
|
612
|
+
canvas: {
|
|
613
|
+
width?: string | number
|
|
614
|
+
height?: string | number
|
|
615
|
+
}
|
|
616
|
+
caption: {}
|
|
617
|
+
cite: {}
|
|
618
|
+
code: {}
|
|
619
|
+
col: {
|
|
620
|
+
span?: string | number
|
|
621
|
+
}
|
|
622
|
+
colgroup: {
|
|
623
|
+
span?: string | number
|
|
624
|
+
}
|
|
625
|
+
data: {
|
|
626
|
+
value?: string
|
|
627
|
+
}
|
|
628
|
+
datalist: {}
|
|
629
|
+
dd: {}
|
|
630
|
+
del: {
|
|
631
|
+
cite?: string
|
|
632
|
+
dateTime?: string
|
|
633
|
+
}
|
|
634
|
+
details: {}
|
|
635
|
+
dfn: {}
|
|
636
|
+
dialog: {}
|
|
637
|
+
div: {}
|
|
638
|
+
dl: {}
|
|
639
|
+
dt: {}
|
|
640
|
+
em: {}
|
|
641
|
+
embed: {
|
|
642
|
+
src?: ValidUrlOrPath
|
|
643
|
+
type?: string
|
|
644
|
+
width?: string | number
|
|
645
|
+
height?: string | number
|
|
646
|
+
}
|
|
647
|
+
fieldset: {
|
|
648
|
+
disabled?: boolean
|
|
649
|
+
form?: ElementReference<HTMLFormElement>
|
|
650
|
+
name?: string
|
|
651
|
+
}
|
|
652
|
+
figcaption: {}
|
|
653
|
+
figure: {}
|
|
654
|
+
footer: {}
|
|
655
|
+
form: {
|
|
656
|
+
acceptCharset?: string
|
|
657
|
+
autocomplete?: AutoComplete
|
|
658
|
+
enctype?: EncType
|
|
659
|
+
method?: FormMethod
|
|
660
|
+
name?: string
|
|
661
|
+
novalidate?: boolean
|
|
662
|
+
target?: string
|
|
663
|
+
action?: FormAction
|
|
664
|
+
}
|
|
665
|
+
h1: {}
|
|
666
|
+
h2: {}
|
|
667
|
+
h3: {}
|
|
668
|
+
h4: {}
|
|
669
|
+
h5: {}
|
|
670
|
+
h6: {}
|
|
671
|
+
head: {}
|
|
672
|
+
header: {}
|
|
673
|
+
hgroup: {}
|
|
674
|
+
hr: {}
|
|
675
|
+
html: {
|
|
676
|
+
lang?: LanguageCode
|
|
677
|
+
}
|
|
678
|
+
i: {}
|
|
679
|
+
iframe: {
|
|
680
|
+
allow?: string
|
|
681
|
+
src?: ValidUrlOrPath
|
|
682
|
+
srcdoc?: string
|
|
683
|
+
name?: string
|
|
684
|
+
sandbox?: IFrameSandbox
|
|
685
|
+
width?: string | number
|
|
686
|
+
height?: string | number
|
|
687
|
+
loading?: Loading
|
|
688
|
+
}
|
|
689
|
+
img: {
|
|
690
|
+
alt?: string
|
|
691
|
+
src?: ValidUrlOrPath
|
|
692
|
+
crossOrigin?: string
|
|
693
|
+
useMap?: string
|
|
694
|
+
width?: string | number
|
|
695
|
+
height?: string | number
|
|
696
|
+
loading?: Loading
|
|
697
|
+
}
|
|
698
|
+
input: {
|
|
699
|
+
accept?: InputAccept
|
|
700
|
+
alt?: string
|
|
701
|
+
autocomplete?: AutoComplete
|
|
702
|
+
autofocus?: boolean
|
|
703
|
+
dirName?: Direction
|
|
704
|
+
disabled?: boolean
|
|
705
|
+
files?: FileList | null
|
|
706
|
+
form?: ElementReference<HTMLFormElement>
|
|
707
|
+
formAction?: FormAction
|
|
708
|
+
formEnctype?: EncType
|
|
709
|
+
formMethod?: FormMethod
|
|
710
|
+
formNoValidate?: boolean
|
|
711
|
+
formTarget?: Target
|
|
712
|
+
height?: string | number
|
|
713
|
+
list?: ElementReference<HTMLDataListElement>
|
|
714
|
+
max?: string | number
|
|
715
|
+
maxLength?: string | number
|
|
716
|
+
min?: string | number
|
|
717
|
+
minLength?: string | number
|
|
718
|
+
multiple?: boolean
|
|
719
|
+
name?: string
|
|
720
|
+
pattern?: RegExp
|
|
721
|
+
placeholder?: string
|
|
722
|
+
readOnly?: boolean
|
|
723
|
+
required?: boolean
|
|
724
|
+
size?: string | number
|
|
725
|
+
src?: ValidUrlOrPath
|
|
726
|
+
step?: string | number
|
|
727
|
+
type?: InputType
|
|
728
|
+
width?: string | number
|
|
729
|
+
} & PopoverControlAttributes
|
|
730
|
+
ins: {
|
|
731
|
+
cite?: string
|
|
732
|
+
dateTime?: string
|
|
733
|
+
}
|
|
734
|
+
kbd: {}
|
|
735
|
+
label: {
|
|
736
|
+
htmlFor?: string
|
|
737
|
+
form?: ElementReference<HTMLFormElement>
|
|
738
|
+
}
|
|
739
|
+
legend: {}
|
|
740
|
+
li: {
|
|
741
|
+
value?: number
|
|
742
|
+
}
|
|
743
|
+
link: {
|
|
744
|
+
crossOrigin?: string
|
|
745
|
+
disabled?: boolean
|
|
746
|
+
fetchPriority?: "auto" | "high" | "low"
|
|
747
|
+
href?: ValidUrlOrPath
|
|
748
|
+
hreflang?: LanguageCode
|
|
749
|
+
integrity?: string
|
|
750
|
+
media?: MediaQuery
|
|
751
|
+
referrerPolicy?: ReferrerPolicy
|
|
752
|
+
rel?: LinkRel
|
|
753
|
+
sizes?: string
|
|
754
|
+
type?: MediaType
|
|
755
|
+
title?: string
|
|
756
|
+
}
|
|
757
|
+
main: {}
|
|
758
|
+
map: {
|
|
759
|
+
name?: string
|
|
760
|
+
}
|
|
761
|
+
mark: {}
|
|
762
|
+
menu: {}
|
|
763
|
+
meta: {
|
|
764
|
+
charset?: string
|
|
765
|
+
content?: string
|
|
766
|
+
httpEquiv?: string
|
|
767
|
+
name?: string
|
|
768
|
+
}
|
|
769
|
+
meter: {
|
|
770
|
+
value?: string | number
|
|
771
|
+
min?: string | number
|
|
772
|
+
max?: string | number
|
|
773
|
+
low?: string | number
|
|
774
|
+
high?: string | number
|
|
775
|
+
optimum?: string | number
|
|
776
|
+
}
|
|
777
|
+
nav: {}
|
|
778
|
+
noscript: {}
|
|
779
|
+
object: {
|
|
780
|
+
data?: ValidUrlOrPath
|
|
781
|
+
type?: MediaType
|
|
782
|
+
name?: string
|
|
783
|
+
useMap?: string
|
|
784
|
+
width?: string | number
|
|
785
|
+
height?: string | number
|
|
786
|
+
}
|
|
787
|
+
ol: {
|
|
788
|
+
reversed?: boolean
|
|
789
|
+
start?: string | number
|
|
790
|
+
type?: "1" | "a" | "A" | "i" | "I"
|
|
791
|
+
}
|
|
792
|
+
optgroup: {
|
|
793
|
+
disabled?: boolean
|
|
794
|
+
label?: string
|
|
795
|
+
}
|
|
796
|
+
option: {
|
|
797
|
+
disabled?: boolean
|
|
798
|
+
label?: string
|
|
799
|
+
selected?: boolean
|
|
800
|
+
value?: string
|
|
801
|
+
}
|
|
802
|
+
output: {
|
|
803
|
+
for?: string
|
|
804
|
+
form?: ElementReference<HTMLFormElement>
|
|
805
|
+
name?: string
|
|
806
|
+
}
|
|
807
|
+
p: {}
|
|
808
|
+
picture: {}
|
|
809
|
+
pre: {}
|
|
810
|
+
progress: {
|
|
811
|
+
value?: string | number
|
|
812
|
+
min?: string | number
|
|
813
|
+
max?: string | number
|
|
814
|
+
}
|
|
815
|
+
q: {
|
|
816
|
+
cite?: string
|
|
817
|
+
}
|
|
818
|
+
rp: {}
|
|
819
|
+
rt: {}
|
|
820
|
+
ruby: {}
|
|
821
|
+
s: {}
|
|
822
|
+
samp: {}
|
|
823
|
+
script: {
|
|
824
|
+
async?: boolean
|
|
825
|
+
crossOrigin?: string
|
|
826
|
+
defer?: boolean
|
|
827
|
+
integrity?: string
|
|
828
|
+
noModule?: boolean
|
|
829
|
+
nonce?: string
|
|
830
|
+
referrerPolicy?: ReferrerPolicy
|
|
831
|
+
src?: ValidUrlOrPath
|
|
832
|
+
type?: string
|
|
833
|
+
}
|
|
834
|
+
search: {}
|
|
835
|
+
section: {}
|
|
836
|
+
select: {
|
|
837
|
+
autofocus?: boolean
|
|
838
|
+
disabled?: boolean
|
|
839
|
+
form?: ElementReference<HTMLFormElement>
|
|
840
|
+
name?: string
|
|
841
|
+
required?: boolean
|
|
842
|
+
size?: string | number
|
|
843
|
+
}
|
|
844
|
+
slot: {
|
|
845
|
+
name?: string
|
|
846
|
+
}
|
|
847
|
+
small: {}
|
|
848
|
+
source: {
|
|
849
|
+
src?: ValidUrlOrPath
|
|
850
|
+
srcset?: string
|
|
851
|
+
type?: MediaType
|
|
852
|
+
media?: MediaQuery
|
|
853
|
+
height?: string | number
|
|
854
|
+
width?: string | number
|
|
855
|
+
}
|
|
856
|
+
span: {}
|
|
857
|
+
strong: {}
|
|
858
|
+
style: {
|
|
859
|
+
media?: MediaQuery
|
|
860
|
+
nonce?: string
|
|
861
|
+
type?: "text/css"
|
|
862
|
+
title?: string
|
|
863
|
+
}
|
|
864
|
+
sub: {}
|
|
865
|
+
summary: {}
|
|
866
|
+
sup: {}
|
|
867
|
+
table: {}
|
|
868
|
+
tbody: {}
|
|
869
|
+
td: {
|
|
870
|
+
colSpan?: string | number
|
|
871
|
+
rowSpan?: string | number
|
|
872
|
+
headers?: string
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* This serves as a mechanism for holding HTML fragments, which can either be used
|
|
876
|
+
* later via JavaScript or generated immediately into shadow DOM.
|
|
877
|
+
* @link [MDN example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#examples)
|
|
878
|
+
*
|
|
879
|
+
* This element includes the [global attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes).
|
|
880
|
+
*/
|
|
881
|
+
template: {
|
|
882
|
+
/**
|
|
883
|
+
* Creates a **shadow root** for the parent element. It is a declarative version of the `Element.attachShadow()`
|
|
884
|
+
* method and accepts the same enumerated values.
|
|
885
|
+
* @link [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#shadowrootmode)
|
|
886
|
+
*/
|
|
887
|
+
shadowrootmode?: "open" | "closed"
|
|
888
|
+
/**
|
|
889
|
+
* Sets the value of the **clonable** property of a **ShadowRoot** created using this element to `true`. If set, a clone
|
|
890
|
+
* of the shadow host (the parent element of this `<template>`) created with `Node.cloneNode()` or `Document.importNode()`
|
|
891
|
+
* will include a shadow root in the copy.
|
|
892
|
+
* @link [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#shadowrootclonable)
|
|
893
|
+
*/
|
|
894
|
+
shadowrootclonable?: boolean
|
|
895
|
+
/**
|
|
896
|
+
* Sets the value of the **delegatesFocus** property of a **ShadowRoot** created using this element to `true`. If this
|
|
897
|
+
* is set and a non-focusable element in the shadow tree is selected, then focus is delegated to the first
|
|
898
|
+
* focusable element in the tree.
|
|
899
|
+
* @defaultvalue false
|
|
900
|
+
* @link [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#shadowrootdelegatesfocus)
|
|
901
|
+
*/
|
|
902
|
+
shadowrootdelegatesfocus?: boolean
|
|
903
|
+
/**
|
|
904
|
+
* Sets the value of the serializable property of a ShadowRoot created using this element to true. If set, the
|
|
905
|
+
* shadow root may be serialized by calling the Element.getHTML() or ShadowRoot.getHTML() methods with the
|
|
906
|
+
* options.serializableShadowRoots parameter set true.
|
|
907
|
+
* @defaultvalue false
|
|
908
|
+
* @link [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template#shadowrootserializable)
|
|
909
|
+
* @deprecated This is an experimental property - your mileage may vary
|
|
910
|
+
*
|
|
911
|
+
*/
|
|
912
|
+
shadowrootserializable?: boolean
|
|
913
|
+
}
|
|
914
|
+
textarea: {
|
|
915
|
+
autocomplete?: AutoComplete
|
|
916
|
+
autocorrect?: "on" | "off"
|
|
917
|
+
autofocus?: boolean
|
|
918
|
+
cols?: string | number
|
|
919
|
+
dirName?: Direction
|
|
920
|
+
disabled?: boolean
|
|
921
|
+
form?: ElementReference<HTMLFormElement>
|
|
922
|
+
maxLength?: string | number
|
|
923
|
+
minLength?: string | number
|
|
924
|
+
name?: string
|
|
925
|
+
placeholder?: string
|
|
926
|
+
readOnly?: boolean
|
|
927
|
+
required?: boolean
|
|
928
|
+
rows?: string | number
|
|
929
|
+
wrap?: "hard" | "soft"
|
|
930
|
+
value?: string
|
|
931
|
+
"bind:value"?: Signal<string | number>
|
|
932
|
+
}
|
|
933
|
+
tfoot: {}
|
|
934
|
+
th: {
|
|
935
|
+
abbr?: string
|
|
936
|
+
colSpan?: string | number
|
|
937
|
+
rowSpan?: string | number
|
|
938
|
+
headers?: string
|
|
939
|
+
scope?: "col" | "row" | "colgroup" | "rowgroup"
|
|
940
|
+
}
|
|
941
|
+
thead: {}
|
|
942
|
+
time: {
|
|
943
|
+
dateTime?: string
|
|
944
|
+
}
|
|
945
|
+
title: {}
|
|
946
|
+
tr: {}
|
|
947
|
+
track: {
|
|
948
|
+
default?: boolean
|
|
949
|
+
kind?: "subtitles" | "captions" | "descriptions" | "chapters" | "metadata"
|
|
950
|
+
label?: string
|
|
951
|
+
src?: ValidUrlOrPath
|
|
952
|
+
srclang?: LanguageCode
|
|
953
|
+
}
|
|
954
|
+
u: {}
|
|
955
|
+
ul: {}
|
|
956
|
+
var: {}
|
|
957
|
+
video: HTMLMediaElementAttrs & {
|
|
958
|
+
disablePictureInPicture?: boolean
|
|
959
|
+
playsInline?: boolean
|
|
960
|
+
poster?: ValidUrlOrPath
|
|
961
|
+
width?: string | number
|
|
962
|
+
height?: string | number
|
|
963
|
+
onenterpictureinpicture?: (
|
|
964
|
+
this: HTMLVideoElement,
|
|
965
|
+
ev: PictureInPictureEvent
|
|
966
|
+
) => void
|
|
967
|
+
onleavepictureinpicture?: (
|
|
968
|
+
this: HTMLVideoElement,
|
|
969
|
+
ev: PictureInPictureEvent
|
|
970
|
+
) => void
|
|
971
|
+
}
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
interface SvgGlobalAttributes {
|
|
975
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/fill) */
|
|
976
|
+
fill?: string
|
|
977
|
+
|
|
978
|
+
/** [MDN Reference](https://developer.mozilla.org/docs/Web/CSS/display) */
|
|
979
|
+
display?: string
|
|
980
|
+
transform?: string
|
|
981
|
+
"transform-origin"?: string
|
|
982
|
+
filter?: string
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
interface SvgStrokeAttributes {
|
|
986
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/color) */
|
|
987
|
+
color?: string
|
|
988
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke) */
|
|
989
|
+
stroke?: string
|
|
990
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dasharray) */
|
|
991
|
+
strokeDasharray?: string
|
|
992
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-dashoffset) */
|
|
993
|
+
strokeDashoffset?: string | number
|
|
994
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linecap) */
|
|
995
|
+
strokeLinecap?: "butt" | "round" | "square"
|
|
996
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-linejoin) */
|
|
997
|
+
strokeLinejoin?: "arcs" | "bevel" | "miter" | "miter-clip" | "round"
|
|
998
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit) */
|
|
999
|
+
strokeMiterlimit?: string | number
|
|
1000
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-opacity) */
|
|
1001
|
+
strokeOpacity?: string | number
|
|
1002
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-width) */
|
|
1003
|
+
strokeWidth?: string | number
|
|
1004
|
+
}
|
|
1005
|
+
|
|
1006
|
+
interface SvgColorInterpolationFilters {
|
|
1007
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/color-interpolation-filters) */
|
|
1008
|
+
colorInterpolationFilters?: "auto" | "sRGB" | "linearRGB"
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
interface SvgColorInterpolation {
|
|
1012
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/color-interpolation) */
|
|
1013
|
+
colorInterpolation?: "auto" | "sRGB" | "linearRGB"
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
/** [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/feFuncR) */
|
|
1017
|
+
interface FeFuncAttributes {
|
|
1018
|
+
type?: string
|
|
1019
|
+
tableValues?: string
|
|
1020
|
+
amplitude?: string | number
|
|
1021
|
+
exponent?: string | number
|
|
1022
|
+
offset?: string | number
|
|
1023
|
+
slope?: string | number
|
|
1024
|
+
intercept?: string | number
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
interface SvgElementAttributes {
|
|
1028
|
+
animateTransform: {
|
|
1029
|
+
begin?: string
|
|
1030
|
+
dur?: string
|
|
1031
|
+
end?: string
|
|
1032
|
+
min?: string
|
|
1033
|
+
max?: string
|
|
1034
|
+
restart?: "always" | "whenNotActive" | "never"
|
|
1035
|
+
repeatCount?: "indefinite" | number
|
|
1036
|
+
repeatDur?: string
|
|
1037
|
+
fill?: "freeze" | "remove" | "default"
|
|
1038
|
+
calcMode?: "linear" | "discrete" | "spline" | "paced"
|
|
1039
|
+
keyTimes?: string
|
|
1040
|
+
keySplines?: string
|
|
1041
|
+
from?: string
|
|
1042
|
+
to?: string
|
|
1043
|
+
by?: string
|
|
1044
|
+
attributeName?: string
|
|
1045
|
+
attributeType?: "CSS" | "XML"
|
|
1046
|
+
additive?: "replace" | "sum"
|
|
1047
|
+
accumulate?: "none" | "sum"
|
|
1048
|
+
}
|
|
1049
|
+
circle: SvgStrokeAttributes & {
|
|
1050
|
+
cx?: string | number
|
|
1051
|
+
cy?: string | number
|
|
1052
|
+
r?: string | number
|
|
1053
|
+
mask?: string
|
|
1054
|
+
opacity?: string | number
|
|
1055
|
+
pathLength?: string | number
|
|
1056
|
+
}
|
|
1057
|
+
clipPath: {
|
|
1058
|
+
clipPathUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1059
|
+
mask?: string
|
|
1060
|
+
}
|
|
1061
|
+
defs: {}
|
|
1062
|
+
ellipse: SvgStrokeAttributes & {
|
|
1063
|
+
cx?: string | number
|
|
1064
|
+
cy?: string | number
|
|
1065
|
+
rx?: string | number
|
|
1066
|
+
ry?: string | number
|
|
1067
|
+
mask?: string
|
|
1068
|
+
opacity?: string | number
|
|
1069
|
+
pathLength?: string | number
|
|
1070
|
+
}
|
|
1071
|
+
feComponentTransfer: {
|
|
1072
|
+
in?: string
|
|
1073
|
+
in2?: string
|
|
1074
|
+
result?: string
|
|
1075
|
+
}
|
|
1076
|
+
feFuncR: FeFuncAttributes
|
|
1077
|
+
feFuncG: FeFuncAttributes
|
|
1078
|
+
feFuncB: FeFuncAttributes
|
|
1079
|
+
feFuncA: FeFuncAttributes
|
|
1080
|
+
feSpotLight: SvgColorInterpolationFilters & {
|
|
1081
|
+
result?: string
|
|
1082
|
+
}
|
|
1083
|
+
feFlood: SvgColorInterpolationFilters & {
|
|
1084
|
+
floodColor?: string
|
|
1085
|
+
floodOpacity?: string
|
|
1086
|
+
result?: string
|
|
1087
|
+
}
|
|
1088
|
+
feBlend: SvgColorInterpolationFilters & {
|
|
1089
|
+
in?: string
|
|
1090
|
+
in2?: string
|
|
1091
|
+
mode?: "normal" | "multiply" | "screen" | "overlay" | "darken" | "lighten"
|
|
1092
|
+
result?: string
|
|
1093
|
+
}
|
|
1094
|
+
feDisplacementMap: SvgColorInterpolationFilters & {
|
|
1095
|
+
in?: string
|
|
1096
|
+
in2?: string
|
|
1097
|
+
scale?: string | number
|
|
1098
|
+
xChannelSelector?: "R" | "G" | "B" | "A"
|
|
1099
|
+
yChannelSelector?: "R" | "G" | "B" | "A"
|
|
1100
|
+
result?: string
|
|
1101
|
+
}
|
|
1102
|
+
feGaussianBlur: SvgColorInterpolationFilters & {
|
|
1103
|
+
in?: string
|
|
1104
|
+
stdDeviation?: string | number
|
|
1105
|
+
edgeMode?: "duplicate" | "wrap" | "none"
|
|
1106
|
+
result?: string
|
|
1107
|
+
}
|
|
1108
|
+
feTurbulence: SvgColorInterpolationFilters & {
|
|
1109
|
+
type: "fractalNoise" | "turbulence"
|
|
1110
|
+
baseFrequency?: string
|
|
1111
|
+
numOctaves?: string | number
|
|
1112
|
+
seed?: string | number
|
|
1113
|
+
stitchTiles?: "stitch" | "noStitch"
|
|
1114
|
+
result?: string
|
|
1115
|
+
}
|
|
1116
|
+
filter: SvgColorInterpolationFilters &
|
|
1117
|
+
SvgColorInterpolation & {
|
|
1118
|
+
x?: string | number
|
|
1119
|
+
y?: string | number
|
|
1120
|
+
width?: string | number
|
|
1121
|
+
height?: string | number
|
|
1122
|
+
filterUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1123
|
+
primitiveUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1124
|
+
}
|
|
1125
|
+
g: SvgStrokeAttributes & {
|
|
1126
|
+
clipPath?: string
|
|
1127
|
+
mask?: string
|
|
1128
|
+
opacity?: string | number
|
|
1129
|
+
}
|
|
1130
|
+
image: {
|
|
1131
|
+
x?: string | number
|
|
1132
|
+
y?: string | number
|
|
1133
|
+
width?: string | number
|
|
1134
|
+
height?: string | number
|
|
1135
|
+
mask?: string
|
|
1136
|
+
opacity?: string | number
|
|
1137
|
+
pathLength?: string | number
|
|
1138
|
+
preserveAspectRatio?: string
|
|
1139
|
+
href?: string
|
|
1140
|
+
filter?: string
|
|
1141
|
+
}
|
|
1142
|
+
line: SvgStrokeAttributes & {
|
|
1143
|
+
x1?: string | number
|
|
1144
|
+
y1?: string | number
|
|
1145
|
+
x2?: string | number
|
|
1146
|
+
y2?: string | number
|
|
1147
|
+
points?: string
|
|
1148
|
+
animatedPoints?: string
|
|
1149
|
+
mask?: string
|
|
1150
|
+
opacity?: string | number
|
|
1151
|
+
pathLength?: string | number
|
|
1152
|
+
}
|
|
1153
|
+
linearGradient: {
|
|
1154
|
+
x1?: string | number
|
|
1155
|
+
y1?: string | number
|
|
1156
|
+
x2?: string | number
|
|
1157
|
+
y2?: string | number
|
|
1158
|
+
gradientUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1159
|
+
gradientTransform?: string
|
|
1160
|
+
}
|
|
1161
|
+
mask: {
|
|
1162
|
+
x?: string | number
|
|
1163
|
+
y?: string | number
|
|
1164
|
+
width?: string | number
|
|
1165
|
+
height?: string | number
|
|
1166
|
+
maskUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1167
|
+
mask?: string
|
|
1168
|
+
}
|
|
1169
|
+
path: SvgStrokeAttributes & {
|
|
1170
|
+
d?: string
|
|
1171
|
+
mask?: string
|
|
1172
|
+
opacity?: string | number
|
|
1173
|
+
pathLength?: string | number
|
|
1174
|
+
}
|
|
1175
|
+
pattern: {
|
|
1176
|
+
x?: string | number
|
|
1177
|
+
y?: string | number
|
|
1178
|
+
width?: string | number
|
|
1179
|
+
height?: string | number
|
|
1180
|
+
patternUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1181
|
+
patternTransform?: string
|
|
1182
|
+
patternContentUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1183
|
+
}
|
|
1184
|
+
polygon: SvgStrokeAttributes & {
|
|
1185
|
+
points?: string
|
|
1186
|
+
animatedPoints?: string
|
|
1187
|
+
opacity?: string | number
|
|
1188
|
+
pathLength?: string | number
|
|
1189
|
+
}
|
|
1190
|
+
polyline: SvgStrokeAttributes & {
|
|
1191
|
+
points?: string
|
|
1192
|
+
animatedPoints?: string
|
|
1193
|
+
opacity?: string | number
|
|
1194
|
+
pathLength?: string | number
|
|
1195
|
+
}
|
|
1196
|
+
radialGradient: {
|
|
1197
|
+
cx?: string | number
|
|
1198
|
+
cy?: string | number
|
|
1199
|
+
r?: string | number
|
|
1200
|
+
gradientUnits?: "userSpaceOnUse" | "objectBoundingBox"
|
|
1201
|
+
gradientTransform?: string
|
|
1202
|
+
}
|
|
1203
|
+
rect: SvgStrokeAttributes & {
|
|
1204
|
+
x?: string | number
|
|
1205
|
+
y?: string | number
|
|
1206
|
+
rx?: string | number
|
|
1207
|
+
ry?: string | number
|
|
1208
|
+
width?: string | number
|
|
1209
|
+
height?: string | number
|
|
1210
|
+
mask?: string
|
|
1211
|
+
opacity?: string | number
|
|
1212
|
+
pathLength?: string | number
|
|
1213
|
+
}
|
|
1214
|
+
stop: {
|
|
1215
|
+
offset?: string
|
|
1216
|
+
stopColor?: string
|
|
1217
|
+
stopOpacity?: string
|
|
1218
|
+
}
|
|
1219
|
+
svg: SvgStrokeAttributes & {
|
|
1220
|
+
width?: string | number
|
|
1221
|
+
height?: string | number
|
|
1222
|
+
viewBox?: string
|
|
1223
|
+
preserveAspectRatio?: string
|
|
1224
|
+
xmlns?: string
|
|
1225
|
+
"xmlns:xlink"?: string
|
|
1226
|
+
version?: string
|
|
1227
|
+
mask?: string
|
|
1228
|
+
opacity?: string | number
|
|
1229
|
+
x?: string | number
|
|
1230
|
+
y?: string | number
|
|
1231
|
+
}
|
|
1232
|
+
text: SvgStrokeAttributes & {
|
|
1233
|
+
x?: string | number
|
|
1234
|
+
y?: string | number
|
|
1235
|
+
dx?: string | number
|
|
1236
|
+
dy?: string | number
|
|
1237
|
+
rotate?: "none" | (string & {})
|
|
1238
|
+
textLength?: string | number
|
|
1239
|
+
lengthAdjust?: "spacing" | "spacingAndGlyphs"
|
|
1240
|
+
mask?: string
|
|
1241
|
+
opacity?: string | number
|
|
1242
|
+
}
|
|
1243
|
+
textPath: SvgStrokeAttributes & {
|
|
1244
|
+
opacity?: string | number
|
|
1245
|
+
}
|
|
1246
|
+
tref: SvgStrokeAttributes & {}
|
|
1247
|
+
tspan: SvgStrokeAttributes & {
|
|
1248
|
+
opacity?: string | number
|
|
1249
|
+
}
|
|
1250
|
+
}
|