brumate 0.2.0 → 0.4.0

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.
Files changed (138) hide show
  1. package/README.md +2 -2
  2. package/check.d.ts +49 -0
  3. package/dist/{boot-D-IdPy7B.d.ts → boot-DLlRmD9z.d.ts} +11 -10
  4. package/dist/cli.js +275 -15
  5. package/dist/cli.js.map +1 -1
  6. package/dist/client-BvDsC6Qr.js +3463 -0
  7. package/dist/client-BvDsC6Qr.js.map +1 -0
  8. package/dist/client-DBwL2wKQ.d.ts +669 -0
  9. package/dist/{client-routes-JTbGtukf.js → client-routes-BtGpYCef.js} +60 -30
  10. package/dist/client-routes-BtGpYCef.js.map +1 -0
  11. package/dist/{cookies-Av5WFmcf.js → cookies-Cnbf4w-S.js} +15 -7
  12. package/dist/cookies-Cnbf4w-S.js.map +1 -0
  13. package/dist/{defer-D0bo1Gqx.js → defer-CKWZLv2K.js} +8 -4
  14. package/dist/defer-CKWZLv2K.js.map +1 -0
  15. package/dist/devtools-4uTPwR_v.js +597 -0
  16. package/dist/devtools-4uTPwR_v.js.map +1 -0
  17. package/dist/devtools-panel-Be9pxYgv.js +1994 -0
  18. package/dist/devtools-panel-Be9pxYgv.js.map +1 -0
  19. package/dist/events-LgLdp1R7.js +114 -0
  20. package/dist/events-LgLdp1R7.js.map +1 -0
  21. package/dist/features-CHY5Ekku.js +30 -0
  22. package/dist/features-CHY5Ekku.js.map +1 -0
  23. package/dist/files-WW4RlajL.js +506 -0
  24. package/dist/files-WW4RlajL.js.map +1 -0
  25. package/dist/forms-j1xPAR14.d.ts +281 -0
  26. package/dist/forms-nXK7-Lv_.js +440 -0
  27. package/dist/forms-nXK7-Lv_.js.map +1 -0
  28. package/dist/highlight.d.ts +17 -0
  29. package/dist/highlight.js +278 -0
  30. package/dist/highlight.js.map +1 -0
  31. package/dist/html-BtKRyi7g.js +305 -0
  32. package/dist/html-BtKRyi7g.js.map +1 -0
  33. package/dist/html-Bw9Qwu6F.d.ts +107 -0
  34. package/dist/index.d.ts +142 -11
  35. package/dist/index.js +641 -106
  36. package/dist/index.js.map +1 -1
  37. package/dist/{inspect-BJtACnQp.js → inspect-Y6y4uNZp.js} +4333 -681
  38. package/dist/inspect-Y6y4uNZp.js.map +1 -0
  39. package/dist/{loader-B18i3_-T.js → loader-BjKGJzLN.js} +21 -14
  40. package/dist/loader-BjKGJzLN.js.map +1 -0
  41. package/dist/logo-DQ_OYhBi.js +10 -0
  42. package/dist/logo-DQ_OYhBi.js.map +1 -0
  43. package/dist/{navigate-BwuZveDF.js → navigate-CfOr-TRF.js} +130 -24
  44. package/dist/navigate-CfOr-TRF.js.map +1 -0
  45. package/dist/nesting-DA5vJw9X.js +265 -0
  46. package/dist/nesting-DA5vJw9X.js.map +1 -0
  47. package/dist/produce-B7X9ori9.js +402 -0
  48. package/dist/produce-B7X9ori9.js.map +1 -0
  49. package/dist/produce-DIgHBVwL.d.ts +148 -0
  50. package/dist/{rpc-B-Zkn6Ch.js → rpc-Q-XkLwFh.js} +28 -13
  51. package/dist/rpc-Q-XkLwFh.js.map +1 -0
  52. package/dist/runtime/batch.js +9 -7
  53. package/dist/runtime/batch.js.map +1 -1
  54. package/dist/runtime/client.d.ts +4 -4
  55. package/dist/runtime/client.js +4 -4
  56. package/dist/runtime/devtools.d.ts +172 -5
  57. package/dist/runtime/devtools.js +3 -1
  58. package/dist/runtime/env.js +14 -2
  59. package/dist/runtime/env.js.map +1 -1
  60. package/dist/runtime/events.d.ts +38 -1
  61. package/dist/runtime/events.js +1 -1
  62. package/dist/runtime/forms.d.ts +2 -0
  63. package/dist/runtime/forms.js +1 -0
  64. package/dist/runtime/gather.d.ts +25 -0
  65. package/dist/runtime/gather.js +33 -0
  66. package/dist/runtime/gather.js.map +1 -0
  67. package/dist/runtime/hot.d.ts +1 -1
  68. package/dist/runtime/hot.js +5 -2
  69. package/dist/runtime/hot.js.map +1 -1
  70. package/dist/runtime/html.d.ts +2 -2
  71. package/dist/runtime/html.js +1 -1
  72. package/dist/runtime/loader.d.ts +2 -2
  73. package/dist/runtime/loader.js +2 -2
  74. package/dist/runtime/routes.js +4 -1
  75. package/dist/runtime/routes.js.map +1 -1
  76. package/dist/runtime/server.d.ts +5 -4
  77. package/dist/runtime/server.js +5 -5
  78. package/dist/runtime/signals.d.ts +75 -2
  79. package/dist/runtime/signals.js +44 -2
  80. package/dist/runtime/signals.js.map +1 -1
  81. package/dist/runtime/static-loader.d.ts +2 -2
  82. package/dist/runtime/static-loader.js +1 -1
  83. package/dist/runtime/testing.d.ts +18 -3
  84. package/dist/runtime/testing.js +150 -33
  85. package/dist/runtime/testing.js.map +1 -1
  86. package/dist/runtime/values.d.ts +2 -0
  87. package/dist/runtime/values.js +24 -0
  88. package/dist/runtime/values.js.map +1 -0
  89. package/dist/{server-BA9SJ2Vm.d.ts → server-BvPIg9pT.d.ts} +363 -32
  90. package/dist/{server-BqfM95r1.js → server-DjyOVJtJ.js} +1309 -220
  91. package/dist/server-DjyOVJtJ.js.map +1 -0
  92. package/dist/{static-loader-BzE9SRaj.d.ts → static-loader-BGgdp_Y5.d.ts} +2 -2
  93. package/dist/static-loader-BZR17hSw.js +312 -0
  94. package/dist/static-loader-BZR17hSw.js.map +1 -0
  95. package/dist/{stream-JaMHMdBD.js → stream-BP5AVmg5.js} +182 -17
  96. package/dist/stream-BP5AVmg5.js.map +1 -0
  97. package/dist/values-B8C7CLvG.d.ts +63 -0
  98. package/dist/vite.d.ts +20 -20
  99. package/dist/vite.js +2031 -539
  100. package/dist/vite.js.map +1 -1
  101. package/elements.d.ts +951 -0
  102. package/forms/forms.brm.ts +141 -0
  103. package/package.json +41 -3
  104. package/skills/brumate/SKILL.md +58 -0
  105. package/skills/brumate/references/errors.md +2078 -0
  106. package/skills/brumate/references/events.md +117 -0
  107. package/skills/brumate/references/signals.md +61 -0
  108. package/skills/brumate/references/state.md +235 -0
  109. package/skills/brumate/references/syntax.md +250 -0
  110. package/types.d.ts +4 -4
  111. package/dist/client-C0UCNL3J.js +0 -1643
  112. package/dist/client-C0UCNL3J.js.map +0 -1
  113. package/dist/client-MD0ZmcFR.d.ts +0 -354
  114. package/dist/client-routes-JTbGtukf.js.map +0 -1
  115. package/dist/cookies-Av5WFmcf.js.map +0 -1
  116. package/dist/defer-D0bo1Gqx.js.map +0 -1
  117. package/dist/devtools-C50VH8gZ.js +0 -113
  118. package/dist/devtools-C50VH8gZ.js.map +0 -1
  119. package/dist/devtools-panel-AYjfwPhj.js +0 -435
  120. package/dist/devtools-panel-AYjfwPhj.js.map +0 -1
  121. package/dist/events-BKWRqtMg.js +0 -52
  122. package/dist/events-BKWRqtMg.js.map +0 -1
  123. package/dist/files-Bnn1JqHx.js +0 -192
  124. package/dist/files-Bnn1JqHx.js.map +0 -1
  125. package/dist/html-bHZbkK-h.js +0 -170
  126. package/dist/html-bHZbkK-h.js.map +0 -1
  127. package/dist/html-y1q7-t7D.d.ts +0 -60
  128. package/dist/inspect-BJtACnQp.js.map +0 -1
  129. package/dist/loader-B18i3_-T.js.map +0 -1
  130. package/dist/navigate-BwuZveDF.js.map +0 -1
  131. package/dist/produce-CWfJ4byV.js +0 -167
  132. package/dist/produce-CWfJ4byV.js.map +0 -1
  133. package/dist/produce-D4K7qpaL.d.ts +0 -72
  134. package/dist/rpc-B-Zkn6Ch.js.map +0 -1
  135. package/dist/server-BqfM95r1.js.map +0 -1
  136. package/dist/static-loader-DOygOFj5.js +0 -216
  137. package/dist/static-loader-DOygOFj5.js.map +0 -1
  138. package/dist/stream-JaMHMdBD.js.map +0 -1
package/elements.d.ts ADDED
@@ -0,0 +1,951 @@
1
+ // The types of elements, markup and components of brumate, as `JSX.IntrinsicElements`,
2
+ // `JSX.Element` and the component types are in JSX. The names are as the markup writes them:
3
+ // `tabindex`, `for` and `viewBox`, not the fields of the DOM interfaces.
4
+
5
+ import type { BindableMark, WritableMark } from 'brumate/signals';
6
+
7
+ declare const MARKUP: unique symbol;
8
+
9
+ /**
10
+ * What children, a `#template` and a render give. A value of this type has no string at runtime
11
+ * that the code can read, so it is not a string and a string is not `Markup`.
12
+ */
13
+ export interface Markup {
14
+ readonly [MARKUP]: true;
15
+ }
16
+
17
+ /**
18
+ * A component of a `.brm` file with the props `P`. It renders on the server, so it answers a
19
+ * promise, and it has the `brumateId` that sends it to the client.
20
+ *
21
+ * The default `P` is `never`. A component of any props is assignable to `Component`, as a
22
+ * parameter or a constraint, but a call through it, or `PropsOf` of it, gives no props. Write
23
+ * `Component<any>` where the code must call a component of unknown props.
24
+ */
25
+ // oxlint-disable-next-line typescript/no-explicit-any -- The rest parameters are the context.
26
+ export type Component<P = never> = ((props: P, ...rest: any[]) => Promise<Markup>) & {
27
+ readonly brumateId: string;
28
+ };
29
+
30
+ /**
31
+ * A `#template`: markup as a value, with the arguments `A`. A template can await a memo, so it
32
+ * answers markup or a promise of it. `check.ts` types each `#template` as an async function
33
+ * that answers `Promise<Markup>`, which a `Template` takes.
34
+ */
35
+ export type Template<A extends unknown[] = []> = (...args: A) => Markup | Promise<Markup>;
36
+
37
+ /** The props of a component. */
38
+ export type PropsOf<C> = C extends (props: infer P, ...rest: any[]) => unknown ? P : never;
39
+
40
+ /** A value of an attribute: the value, `null` or `undefined` to leave the attribute out. */
41
+ type Attr<T> = T | null | undefined;
42
+
43
+ /**
44
+ * The events of an element, by the name of the event. An app that sends its own events from
45
+ * an element adds them: `interface ElementEvents { itemaction: CustomEvent<string> }`.
46
+ */
47
+ export interface ElementEvents extends HTMLElementEventMap {}
48
+
49
+ /** A value of an attribute that takes a number. A static attribute is a string, so `"0"` is one. */
50
+ type Num = number | `${number}`;
51
+
52
+ /**
53
+ * A handler of the event `Ev` on the element `E`, which is `event.currentTarget`. Use it to type
54
+ * a function that a handler prop takes: `EventHandler<HTMLButtonElement, MouseEvent>`.
55
+ */
56
+ export type EventHandler<E, Ev = Event> = (event: Ev & { currentTarget: E }) => unknown;
57
+
58
+ /**
59
+ * A value of `class`: a string, or an array or an object of them. An array holds class values,
60
+ * and `false`, `0`, `0n`, `null` and `undefined` add nothing, so `on && 'on'` and `count && 'x'` fit. An object adds the names
61
+ * with a true value. See `classValue` in runtime/html.ts.
62
+ */
63
+ export type ClassValue =
64
+ | string
65
+ | false
66
+ | 0
67
+ | 0n
68
+ | null
69
+ | undefined
70
+ | readonly ClassValue[]
71
+ | Readonly<Record<string, unknown>>;
72
+
73
+ // The names of the style properties that hold a string. `cssText` and `cssFloat` are not CSS
74
+ // names, and the runtime writes `webkitX` as `webkit-x`, which is not a property.
75
+ type StyleName = {
76
+ [K in keyof CSSStyleDeclaration]: K extends string
77
+ ? K extends 'cssText' | 'cssFloat' | `webkit${string}`
78
+ ? never
79
+ : CSSStyleDeclaration[K] extends string
80
+ ? K
81
+ : never
82
+ : never;
83
+ }[keyof CSSStyleDeclaration];
84
+
85
+ // The properties that take a bare number. The runtime prints a number as it is, with no unit, so
86
+ // any other property needs a string such as `'12px'`.
87
+ type UnitlessName = Extract<
88
+ StyleName,
89
+ | 'animationIterationCount'
90
+ | 'columnCount'
91
+ | 'fillOpacity'
92
+ | 'flex'
93
+ | 'flexGrow'
94
+ | 'flexShrink'
95
+ | 'floodOpacity'
96
+ | 'fontSizeAdjust'
97
+ | 'fontWeight'
98
+ | 'gridArea'
99
+ | 'gridColumn'
100
+ | 'gridColumnEnd'
101
+ | 'gridColumnStart'
102
+ | 'gridRow'
103
+ | 'gridRowEnd'
104
+ | 'gridRowStart'
105
+ | 'lineClamp'
106
+ | 'lineHeight'
107
+ | 'mathDepth'
108
+ | 'opacity'
109
+ | 'order'
110
+ | 'orphans'
111
+ | 'scale'
112
+ | 'shapeImageThreshold'
113
+ | 'stopOpacity'
114
+ | 'strokeMiterlimit'
115
+ | 'strokeOpacity'
116
+ | 'tabSize'
117
+ | 'widows'
118
+ | 'zIndex'
119
+ | 'zoom'
120
+ >;
121
+
122
+ /**
123
+ * A value of `style` as an object: camel-case names, or `--` variables. A value of `null`,
124
+ * `undefined` or `false` leaves the property out. A number is for the properties without a unit
125
+ * and for variables; the others take a string. See `styleValue` in runtime/html.ts.
126
+ */
127
+ export type StyleObject = {
128
+ [K in StyleName]?: K extends UnitlessName
129
+ ? string | number | false | null | undefined
130
+ : string | false | null | undefined;
131
+ } & {
132
+ [variable: `--${string}`]: string | number | false | null | undefined;
133
+ };
134
+
135
+ /**
136
+ * A server function, which a form posts to: `<form action=save>`. The server function of the
137
+ * file, or one that a `'use server'` file exports, is async. The types cannot tell it from
138
+ * another async function, and the compiler reports that.
139
+ */
140
+ // oxlint-disable-next-line typescript/no-explicit-any -- It takes the arguments of any function.
141
+ export type ServerFunction = (...args: any[]) => Promise<unknown>;
142
+
143
+ /** What `value=$bind(name)` takes: a binding that can hold the string the field writes. */
144
+ type BoundValue = BindableMark<unknown> & WritableMark<string>;
145
+ /** What `checked=$bind(name)` takes: a binding that can hold the boolean the field writes. */
146
+ type BoundChecked = BindableMark<unknown> & WritableMark<boolean>;
147
+
148
+ type Handler<Ev, E> = EventHandler<E, Ev>;
149
+
150
+ /**
151
+ * The camel-case name of each event whose name has more than one word, by the name of the event:
152
+ * `keydown` is `onKeyDown`. A handler is written in camel case only. An app that merges an event
153
+ * of several words into `ElementEvents` names it here: `interface ElementEventNames { itemaction:
154
+ * 'ItemAction' }`. An event with no entry here has the name of one word, `onItemaction`.
155
+ */
156
+ export interface ElementEventNames {
157
+ afterprint: 'AfterPrint';
158
+ animationcancel: 'AnimationCancel';
159
+ animationend: 'AnimationEnd';
160
+ animationiteration: 'AnimationIteration';
161
+ animationstart: 'AnimationStart';
162
+ auxclick: 'AuxClick';
163
+ beforeinput: 'BeforeInput';
164
+ beforematch: 'BeforeMatch';
165
+ beforeprint: 'BeforePrint';
166
+ beforetoggle: 'BeforeToggle';
167
+ beforeunload: 'BeforeUnload';
168
+ canplay: 'CanPlay';
169
+ canplaythrough: 'CanPlayThrough';
170
+ compositionend: 'CompositionEnd';
171
+ compositionstart: 'CompositionStart';
172
+ compositionupdate: 'CompositionUpdate';
173
+ contextlost: 'ContextLost';
174
+ contextmenu: 'ContextMenu';
175
+ contextrestored: 'ContextRestored';
176
+ cuechange: 'CueChange';
177
+ dblclick: 'DblClick';
178
+ devicemotion: 'DeviceMotion';
179
+ deviceorientation: 'DeviceOrientation';
180
+ deviceorientationabsolute: 'DeviceOrientationAbsolute';
181
+ dragend: 'DragEnd';
182
+ dragenter: 'DragEnter';
183
+ dragleave: 'DragLeave';
184
+ dragover: 'DragOver';
185
+ dragstart: 'DragStart';
186
+ durationchange: 'DurationChange';
187
+ focusin: 'FocusIn';
188
+ focusout: 'FocusOut';
189
+ formdata: 'FormData';
190
+ fullscreenchange: 'FullscreenChange';
191
+ fullscreenerror: 'FullscreenError';
192
+ gamepadconnected: 'GamepadConnected';
193
+ gamepaddisconnected: 'GamepadDisconnected';
194
+ gotpointercapture: 'GotPointerCapture';
195
+ hashchange: 'HashChange';
196
+ keydown: 'KeyDown';
197
+ keypress: 'KeyPress';
198
+ keyup: 'KeyUp';
199
+ languagechange: 'LanguageChange';
200
+ loadstart: 'LoadStart';
201
+ loadeddata: 'LoadedData';
202
+ loadedmetadata: 'LoadedMetadata';
203
+ lostpointercapture: 'LostPointerCapture';
204
+ messageerror: 'MessageError';
205
+ mousedown: 'MouseDown';
206
+ mouseenter: 'MouseEnter';
207
+ mouseleave: 'MouseLeave';
208
+ mousemove: 'MouseMove';
209
+ mouseout: 'MouseOut';
210
+ mouseover: 'MouseOver';
211
+ mouseup: 'MouseUp';
212
+ orientationchange: 'OrientationChange';
213
+ pagehide: 'PageHide';
214
+ pagereveal: 'PageReveal';
215
+ pageshow: 'PageShow';
216
+ pageswap: 'PageSwap';
217
+ pointercancel: 'PointerCancel';
218
+ pointerdown: 'PointerDown';
219
+ pointerenter: 'PointerEnter';
220
+ pointerleave: 'PointerLeave';
221
+ pointerlockchange: 'PointerLockChange';
222
+ pointerlockerror: 'PointerLockError';
223
+ pointermove: 'PointerMove';
224
+ pointerout: 'PointerOut';
225
+ pointerover: 'PointerOver';
226
+ pointerrawupdate: 'PointerRawUpdate';
227
+ pointerup: 'PointerUp';
228
+ popstate: 'PopState';
229
+ ratechange: 'RateChange';
230
+ readystatechange: 'ReadyStateChange';
231
+ rejectionhandled: 'RejectionHandled';
232
+ scrollend: 'ScrollEnd';
233
+ securitypolicyviolation: 'SecurityPolicyViolation';
234
+ selectstart: 'SelectStart';
235
+ selectionchange: 'SelectionChange';
236
+ slotchange: 'SlotChange';
237
+ timeupdate: 'TimeUpdate';
238
+ touchcancel: 'TouchCancel';
239
+ touchend: 'TouchEnd';
240
+ touchmove: 'TouchMove';
241
+ touchstart: 'TouchStart';
242
+ transitioncancel: 'TransitionCancel';
243
+ transitionend: 'TransitionEnd';
244
+ transitionrun: 'TransitionRun';
245
+ transitionstart: 'TransitionStart';
246
+ unhandledrejection: 'UnhandledRejection';
247
+ visibilitychange: 'VisibilityChange';
248
+ volumechange: 'VolumeChange';
249
+ }
250
+
251
+ /** The camel-case word of an event: its entry in `ElementEventNames`, or the name capitalized. */
252
+ type EventWord<K extends string> = K extends keyof ElementEventNames
253
+ ? ElementEventNames[K]
254
+ : Capitalize<K>;
255
+
256
+ /** The handlers of an element: `onClick` for `click`, and `onKeyDown` for `keydown`. */
257
+ export type Handlers<E> = {
258
+ [K in keyof ElementEvents & string as `on${EventWord<K>}`]?: Handler<ElementEvents[K], E>;
259
+ };
260
+
261
+ /**
262
+ * The attributes that every element takes: `class`, `style`, the handlers, `ref`, `data-*` and
263
+ * `aria-*`. `E` is the element, for the handlers and `ref`.
264
+ */
265
+ export type GlobalAttributes<E> = Handlers<E> & {
266
+ /**
267
+ * Binds the element to a name: `ref=$bind(name)`. The signal can hold the element, a supertype
268
+ * of it such as `HTMLElement | undefined`, or `null`. A signal of another element is an error.
269
+ */
270
+ ref?: BindableMark<unknown> & WritableMark<E>;
271
+ class?: Attr<ClassValue>;
272
+ style?: Attr<string | StyleObject>;
273
+ id?: Attr<string>;
274
+ slot?: Attr<string>;
275
+ part?: Attr<string>;
276
+ is?: Attr<string>;
277
+ role?: Attr<string>;
278
+ title?: Attr<string>;
279
+ lang?: Attr<string>;
280
+ dir?: Attr<'ltr' | 'rtl' | 'auto'>;
281
+ nonce?: Attr<string>;
282
+ accesskey?: Attr<string>;
283
+ autocapitalize?: Attr<'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters'>;
284
+ autofocus?: Attr<boolean>;
285
+ contenteditable?: Attr<boolean | 'true' | 'false' | 'plaintext-only'>;
286
+ draggable?: Attr<boolean | 'true' | 'false'>;
287
+ enterkeyhint?: Attr<'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'>;
288
+ hidden?: Attr<boolean | 'hidden' | 'until-found'>;
289
+ inert?: Attr<boolean>;
290
+ inputmode?: Attr<'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'>;
291
+ popover?: Attr<boolean | 'auto' | 'manual' | 'hint'>;
292
+ spellcheck?: Attr<boolean | 'true' | 'false'>;
293
+ tabindex?: Attr<Num>;
294
+ translate?: Attr<'yes' | 'no'>;
295
+ writingsuggestions?: Attr<boolean | 'true' | 'false'>;
296
+ autocorrect?: Attr<boolean | 'on' | 'off'>;
297
+ [attribute: `data-${string}`]: unknown;
298
+ [attribute: `aria-${string}`]: Attr<string | number | boolean>;
299
+ };
300
+
301
+ type Referrer =
302
+ | 'no-referrer'
303
+ | 'no-referrer-when-downgrade'
304
+ | 'origin'
305
+ | 'origin-when-cross-origin'
306
+ | 'same-origin'
307
+ | 'strict-origin'
308
+ | 'strict-origin-when-cross-origin'
309
+ | 'unsafe-url';
310
+ type CrossOrigin = boolean | 'anonymous' | 'use-credentials';
311
+ type Size = number | string;
312
+
313
+ /** An HTML element `E` with the attributes of its own. */
314
+ type Html<E extends keyof HTMLElementTagNameMap, Own = {}> = GlobalAttributes<
315
+ HTMLElementTagNameMap[E]
316
+ > &
317
+ Own;
318
+
319
+ // The attributes of the tags that have some besides the global ones.
320
+
321
+ interface AnchorOwn {
322
+ href?: Attr<string>;
323
+ target?: Attr<'_self' | '_blank' | '_parent' | '_top' | (string & {})>;
324
+ download?: Attr<boolean | string>;
325
+ rel?: Attr<string>;
326
+ hreflang?: Attr<string>;
327
+ type?: Attr<string>;
328
+ ping?: Attr<string>;
329
+ referrerpolicy?: Attr<Referrer>;
330
+ }
331
+
332
+ interface MediaOwn {
333
+ src?: Attr<string>;
334
+ controls?: Attr<boolean>;
335
+ autoplay?: Attr<boolean>;
336
+ loop?: Attr<boolean>;
337
+ muted?: Attr<boolean>;
338
+ preload?: Attr<'none' | 'metadata' | 'auto' | ''>;
339
+ crossorigin?: Attr<CrossOrigin>;
340
+ controlslist?: Attr<string>;
341
+ disableremoteplayback?: Attr<boolean>;
342
+ }
343
+
344
+ interface FormControlOwn {
345
+ name?: Attr<string>;
346
+ form?: Attr<string>;
347
+ disabled?: Attr<boolean>;
348
+ }
349
+
350
+ interface ButtonOwn extends FormControlOwn {
351
+ type?: Attr<'button' | 'submit' | 'reset'>;
352
+ value?: Attr<string | number>;
353
+ formaction?: Attr<string | ServerFunction>;
354
+ formenctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
355
+ formmethod?: Attr<'get' | 'post' | 'dialog'>;
356
+ formnovalidate?: Attr<boolean>;
357
+ formtarget?: Attr<string>;
358
+ popovertarget?: Attr<string>;
359
+ popovertargetaction?: Attr<'show' | 'hide' | 'toggle'>;
360
+ command?: Attr<string>;
361
+ commandfor?: Attr<string>;
362
+ }
363
+
364
+ interface InputOwn extends FormControlOwn {
365
+ type?: Attr<
366
+ | 'button'
367
+ | 'checkbox'
368
+ | 'color'
369
+ | 'date'
370
+ | 'datetime-local'
371
+ | 'email'
372
+ | 'file'
373
+ | 'hidden'
374
+ | 'image'
375
+ | 'month'
376
+ | 'number'
377
+ | 'password'
378
+ | 'radio'
379
+ | 'range'
380
+ | 'reset'
381
+ | 'search'
382
+ | 'submit'
383
+ | 'tel'
384
+ | 'text'
385
+ | 'time'
386
+ | 'url'
387
+ | 'week'
388
+ >;
389
+ value?: Attr<string | number | BoundValue>;
390
+ checked?: Attr<boolean | BoundChecked>;
391
+ accept?: Attr<string>;
392
+ alt?: Attr<string>;
393
+ autocomplete?: Attr<boolean | string>;
394
+ capture?: Attr<boolean | 'user' | 'environment'>;
395
+ dirname?: Attr<string>;
396
+ webkitdirectory?: Attr<boolean>;
397
+ list?: Attr<string>;
398
+ max?: Attr<number | string>;
399
+ maxlength?: Attr<Num>;
400
+ min?: Attr<number | string>;
401
+ minlength?: Attr<Num>;
402
+ multiple?: Attr<boolean>;
403
+ pattern?: Attr<string>;
404
+ placeholder?: Attr<string>;
405
+ readonly?: Attr<boolean>;
406
+ required?: Attr<boolean>;
407
+ size?: Attr<Num>;
408
+ src?: Attr<string>;
409
+ step?: Attr<number | string>;
410
+ width?: Attr<Size>;
411
+ height?: Attr<Size>;
412
+ formaction?: Attr<string | ServerFunction>;
413
+ formenctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
414
+ formmethod?: Attr<'get' | 'post' | 'dialog'>;
415
+ formnovalidate?: Attr<boolean>;
416
+ formtarget?: Attr<string>;
417
+ popovertarget?: Attr<string>;
418
+ popovertargetaction?: Attr<'show' | 'hide' | 'toggle'>;
419
+ }
420
+
421
+ interface TextareaOwn extends FormControlOwn {
422
+ autocomplete?: Attr<boolean | string>;
423
+ cols?: Attr<Num>;
424
+ dirname?: Attr<string>;
425
+ maxlength?: Attr<Num>;
426
+ minlength?: Attr<Num>;
427
+ placeholder?: Attr<string>;
428
+ readonly?: Attr<boolean>;
429
+ required?: Attr<boolean>;
430
+ rows?: Attr<Num>;
431
+ wrap?: Attr<'hard' | 'soft' | 'off'>;
432
+ value?: Attr<string | BoundValue>;
433
+ }
434
+
435
+ interface TableCellOwn {
436
+ colspan?: Attr<Num>;
437
+ rowspan?: Attr<Num>;
438
+ headers?: Attr<string>;
439
+ }
440
+
441
+ // The attributes of every SVG element. The elements share them: the SVG attributes are many, and
442
+ // most apply to most elements. Their values are a string or a number.
443
+ type SvgValue = Attr<string | number>;
444
+ type SvgAttributeNames =
445
+ | 'viewBox'
446
+ | 'preserveAspectRatio'
447
+ | 'xmlns'
448
+ | 'x'
449
+ | 'y'
450
+ | 'x1'
451
+ | 'x2'
452
+ | 'y1'
453
+ | 'y2'
454
+ | 'cx'
455
+ | 'cy'
456
+ | 'r'
457
+ | 'rx'
458
+ | 'ry'
459
+ | 'fx'
460
+ | 'fy'
461
+ | 'dx'
462
+ | 'dy'
463
+ | 'width'
464
+ | 'height'
465
+ | 'd'
466
+ | 'points'
467
+ | 'pathLength'
468
+ | 'transform'
469
+ | 'href'
470
+ | 'fill'
471
+ | 'fill-opacity'
472
+ | 'fill-rule'
473
+ | 'stroke'
474
+ | 'stroke-width'
475
+ | 'stroke-opacity'
476
+ | 'stroke-linecap'
477
+ | 'stroke-linejoin'
478
+ | 'stroke-dasharray'
479
+ | 'stroke-dashoffset'
480
+ | 'stroke-miterlimit'
481
+ | 'opacity'
482
+ | 'color'
483
+ | 'display'
484
+ | 'visibility'
485
+ | 'overflow'
486
+ | 'clip-path'
487
+ | 'clip-rule'
488
+ | 'mask'
489
+ | 'filter'
490
+ | 'flood-color'
491
+ | 'flood-opacity'
492
+ | 'lighting-color'
493
+ | 'stop-color'
494
+ | 'stop-opacity'
495
+ | 'offset'
496
+ | 'gradientUnits'
497
+ | 'gradientTransform'
498
+ | 'spreadMethod'
499
+ | 'clipPathUnits'
500
+ | 'maskUnits'
501
+ | 'maskContentUnits'
502
+ | 'patternUnits'
503
+ | 'patternContentUnits'
504
+ | 'patternTransform'
505
+ | 'markerUnits'
506
+ | 'markerWidth'
507
+ | 'markerHeight'
508
+ | 'refX'
509
+ | 'refY'
510
+ | 'orient'
511
+ | 'marker-start'
512
+ | 'marker-mid'
513
+ | 'marker-end'
514
+ | 'font-family'
515
+ | 'font-size'
516
+ | 'font-style'
517
+ | 'font-weight'
518
+ | 'text-anchor'
519
+ | 'text-decoration'
520
+ | 'dominant-baseline'
521
+ | 'alignment-baseline'
522
+ | 'letter-spacing'
523
+ | 'word-spacing'
524
+ | 'startOffset'
525
+ | 'textLength'
526
+ | 'lengthAdjust'
527
+ | 'rotate'
528
+ | 'vector-effect'
529
+ | 'shape-rendering'
530
+ | 'paint-order'
531
+ | 'pointer-events'
532
+ | 'cursor'
533
+ | 'preserveAlpha'
534
+ | 'in'
535
+ | 'in2'
536
+ | 'result'
537
+ | 'mode'
538
+ | 'type'
539
+ | 'values'
540
+ | 'operator'
541
+ | 'k1'
542
+ | 'k2'
543
+ | 'k3'
544
+ | 'k4'
545
+ | 'stdDeviation'
546
+ | 'radius'
547
+ | 'order'
548
+ | 'kernelMatrix'
549
+ | 'divisor'
550
+ | 'bias'
551
+ | 'targetX'
552
+ | 'targetY'
553
+ | 'edgeMode'
554
+ | 'tableValues'
555
+ | 'slope'
556
+ | 'intercept'
557
+ | 'amplitude'
558
+ | 'exponent'
559
+ | 'azimuth'
560
+ | 'elevation'
561
+ | 'surfaceScale'
562
+ | 'diffuseConstant'
563
+ | 'specularConstant'
564
+ | 'specularExponent'
565
+ | 'baseFrequency'
566
+ | 'numOctaves'
567
+ | 'seed'
568
+ | 'stitchTiles'
569
+ | 'scale'
570
+ | 'xChannelSelector'
571
+ | 'yChannelSelector'
572
+ | 'attributeName'
573
+ | 'from'
574
+ | 'to'
575
+ | 'by'
576
+ | 'begin'
577
+ | 'dur'
578
+ | 'end'
579
+ | 'repeatCount'
580
+ | 'repeatDur'
581
+ | 'calcMode'
582
+ | 'keyTimes'
583
+ | 'keySplines'
584
+ | 'keyPoints'
585
+ | 'path'
586
+ | 'additive'
587
+ | 'accumulate'
588
+ | 'restart'
589
+ | 'crossorigin';
590
+ type SvgPresentation = { [K in SvgAttributeNames]?: SvgValue };
591
+ type Svg<E extends keyof SVGElementTagNameMap> = GlobalAttributes<SVGElementTagNameMap[E]> &
592
+ SvgPresentation;
593
+
594
+ /**
595
+ * The attributes of each element, by tag. HTML elements have the attributes of HTML, and SVG
596
+ * elements the shared attributes of SVG. An app adds the tag of a custom element by merging into
597
+ * this interface.
598
+ */
599
+ export interface Elements {
600
+ a: Html<'a', AnchorOwn>;
601
+ abbr: Html<'abbr'>;
602
+ address: Html<'address'>;
603
+ area: Html<
604
+ 'area',
605
+ Omit<AnchorOwn, 'type' | 'hreflang'> & {
606
+ alt?: Attr<string>;
607
+ coords?: Attr<string>;
608
+ shape?: Attr<string>;
609
+ }
610
+ >;
611
+ article: Html<'article'>;
612
+ aside: Html<'aside'>;
613
+ audio: Html<'audio', MediaOwn>;
614
+ b: Html<'b'>;
615
+ base: Html<'base', { href?: Attr<string>; target?: Attr<string> }>;
616
+ bdi: Html<'bdi'>;
617
+ bdo: Html<'bdo'>;
618
+ blockquote: Html<'blockquote', { cite?: Attr<string> }>;
619
+ body: Html<'body'>;
620
+ br: Html<'br'>;
621
+ button: Html<'button', ButtonOwn>;
622
+ canvas: Html<'canvas', { width?: Attr<Size>; height?: Attr<Size> }>;
623
+ caption: Html<'caption'>;
624
+ cite: Html<'cite'>;
625
+ code: Html<'code'>;
626
+ col: Html<'col', { span?: Attr<Num> }>;
627
+ colgroup: Html<'colgroup', { span?: Attr<Num> }>;
628
+ data: Html<'data', { value?: Attr<string> }>;
629
+ datalist: Html<'datalist'>;
630
+ dd: Html<'dd'>;
631
+ del: Html<'del', { cite?: Attr<string>; datetime?: Attr<string> }>;
632
+ details: Html<'details', { open?: Attr<boolean>; name?: Attr<string> }>;
633
+ dfn: Html<'dfn'>;
634
+ dialog: Html<'dialog', { open?: Attr<boolean> }>;
635
+ div: Html<'div'>;
636
+ dl: Html<'dl'>;
637
+ dt: Html<'dt'>;
638
+ em: Html<'em'>;
639
+ embed: Html<
640
+ 'embed',
641
+ { src?: Attr<string>; type?: Attr<string>; width?: Attr<Size>; height?: Attr<Size> }
642
+ >;
643
+ fieldset: Html<'fieldset', FormControlOwn>;
644
+ figcaption: Html<'figcaption'>;
645
+ figure: Html<'figure'>;
646
+ footer: Html<'footer'>;
647
+ form: Html<
648
+ 'form',
649
+ {
650
+ action?: Attr<string | ServerFunction>;
651
+ method?: Attr<'get' | 'post' | 'dialog'>;
652
+ enctype?: Attr<'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain'>;
653
+ target?: Attr<string>;
654
+ novalidate?: Attr<boolean>;
655
+ autocomplete?: Attr<boolean | 'on' | 'off'>;
656
+ name?: Attr<string>;
657
+ rel?: Attr<string>;
658
+ 'accept-charset'?: Attr<string>;
659
+ }
660
+ >;
661
+ h1: Html<'h1'>;
662
+ h2: Html<'h2'>;
663
+ h3: Html<'h3'>;
664
+ h4: Html<'h4'>;
665
+ h5: Html<'h5'>;
666
+ h6: Html<'h6'>;
667
+ head: Html<'head'>;
668
+ header: Html<'header'>;
669
+ hgroup: Html<'hgroup'>;
670
+ hr: Html<'hr'>;
671
+ html: Html<'html', { xmlns?: Attr<string> }>;
672
+ i: Html<'i'>;
673
+ iframe: Html<
674
+ 'iframe',
675
+ {
676
+ src?: Attr<string>;
677
+ srcdoc?: Attr<string>;
678
+ name?: Attr<string>;
679
+ width?: Attr<Size>;
680
+ height?: Attr<Size>;
681
+ allow?: Attr<string>;
682
+ allowfullscreen?: Attr<boolean>;
683
+ loading?: Attr<'eager' | 'lazy'>;
684
+ referrerpolicy?: Attr<Referrer>;
685
+ sandbox?: Attr<string>;
686
+ }
687
+ >;
688
+ img: Html<
689
+ 'img',
690
+ {
691
+ src?: Attr<string>;
692
+ alt?: Attr<string>;
693
+ srcset?: Attr<string>;
694
+ sizes?: Attr<string>;
695
+ width?: Attr<Size>;
696
+ height?: Attr<Size>;
697
+ loading?: Attr<'eager' | 'lazy'>;
698
+ decoding?: Attr<'sync' | 'async' | 'auto'>;
699
+ crossorigin?: Attr<CrossOrigin>;
700
+ usemap?: Attr<string>;
701
+ ismap?: Attr<boolean>;
702
+ referrerpolicy?: Attr<Referrer>;
703
+ fetchpriority?: Attr<'high' | 'low' | 'auto'>;
704
+ }
705
+ >;
706
+ input: Html<'input', InputOwn>;
707
+ ins: Html<'ins', { cite?: Attr<string>; datetime?: Attr<string> }>;
708
+ kbd: Html<'kbd'>;
709
+ label: Html<'label', { for?: Attr<string>; form?: Attr<string> }>;
710
+ legend: Html<'legend'>;
711
+ li: Html<'li', { value?: Attr<Num> }>;
712
+ link: Html<
713
+ 'link',
714
+ {
715
+ href?: Attr<string>;
716
+ rel?: Attr<string>;
717
+ as?: Attr<string>;
718
+ type?: Attr<string>;
719
+ media?: Attr<string>;
720
+ crossorigin?: Attr<CrossOrigin>;
721
+ integrity?: Attr<string>;
722
+ sizes?: Attr<string>;
723
+ hreflang?: Attr<string>;
724
+ imagesrcset?: Attr<string>;
725
+ imagesizes?: Attr<string>;
726
+ referrerpolicy?: Attr<Referrer>;
727
+ fetchpriority?: Attr<'high' | 'low' | 'auto'>;
728
+ disabled?: Attr<boolean>;
729
+ blocking?: Attr<string>;
730
+ }
731
+ >;
732
+ main: Html<'main'>;
733
+ map: Html<'map', { name?: Attr<string> }>;
734
+ mark: Html<'mark'>;
735
+ menu: Html<'menu'>;
736
+ meta: Html<
737
+ 'meta',
738
+ {
739
+ name?: Attr<string>;
740
+ content?: Attr<string>;
741
+ charset?: Attr<string>;
742
+ property?: Attr<string>;
743
+ media?: Attr<string>;
744
+ 'http-equiv'?: Attr<string>;
745
+ }
746
+ >;
747
+ meter: Html<
748
+ 'meter',
749
+ {
750
+ value?: Attr<Num>;
751
+ min?: Attr<Num>;
752
+ max?: Attr<Num>;
753
+ low?: Attr<Num>;
754
+ high?: Attr<Num>;
755
+ optimum?: Attr<Num>;
756
+ }
757
+ >;
758
+ nav: Html<'nav'>;
759
+ noscript: Html<'noscript'>;
760
+ object: Html<
761
+ 'object',
762
+ {
763
+ data?: Attr<string>;
764
+ type?: Attr<string>;
765
+ name?: Attr<string>;
766
+ form?: Attr<string>;
767
+ width?: Attr<Size>;
768
+ height?: Attr<Size>;
769
+ }
770
+ >;
771
+ ol: Html<
772
+ 'ol',
773
+ { reversed?: Attr<boolean>; start?: Attr<Num>; type?: Attr<'1' | 'a' | 'A' | 'i' | 'I'> }
774
+ >;
775
+ optgroup: Html<'optgroup', { disabled?: Attr<boolean>; label?: Attr<string> }>;
776
+ option: Html<
777
+ 'option',
778
+ {
779
+ disabled?: Attr<boolean>;
780
+ label?: Attr<string>;
781
+ selected?: Attr<boolean>;
782
+ value?: Attr<string | number>;
783
+ }
784
+ >;
785
+ output: Html<'output', { for?: Attr<string>; form?: Attr<string>; name?: Attr<string> }>;
786
+ p: Html<'p'>;
787
+ picture: Html<'picture'>;
788
+ pre: Html<'pre'>;
789
+ progress: Html<'progress', { value?: Attr<Num>; max?: Attr<Num> }>;
790
+ q: Html<'q', { cite?: Attr<string> }>;
791
+ rp: Html<'rp'>;
792
+ rt: Html<'rt'>;
793
+ ruby: Html<'ruby'>;
794
+ s: Html<'s'>;
795
+ samp: Html<'samp'>;
796
+ script: Html<
797
+ 'script',
798
+ {
799
+ src?: Attr<string>;
800
+ type?: Attr<string>;
801
+ async?: Attr<boolean>;
802
+ defer?: Attr<boolean>;
803
+ nomodule?: Attr<boolean>;
804
+ crossorigin?: Attr<CrossOrigin>;
805
+ integrity?: Attr<string>;
806
+ referrerpolicy?: Attr<Referrer>;
807
+ fetchpriority?: Attr<'high' | 'low' | 'auto'>;
808
+ blocking?: Attr<string>;
809
+ }
810
+ >;
811
+ search: Html<'search'>;
812
+ section: Html<'section'>;
813
+ select: Html<
814
+ 'select',
815
+ FormControlOwn & {
816
+ autocomplete?: Attr<boolean | string>;
817
+ multiple?: Attr<boolean>;
818
+ required?: Attr<boolean>;
819
+ size?: Attr<Num>;
820
+ value?: Attr<string | number | BoundValue>;
821
+ }
822
+ >;
823
+ slot: Html<'slot', { name?: Attr<string> }>;
824
+ small: Html<'small'>;
825
+ source: Html<
826
+ 'source',
827
+ {
828
+ src?: Attr<string>;
829
+ srcset?: Attr<string>;
830
+ sizes?: Attr<string>;
831
+ type?: Attr<string>;
832
+ media?: Attr<string>;
833
+ width?: Attr<Size>;
834
+ height?: Attr<Size>;
835
+ }
836
+ >;
837
+ span: Html<'span'>;
838
+ strong: Html<'strong'>;
839
+ style: Html<'style', { media?: Attr<string>; blocking?: Attr<string> }>;
840
+ sub: Html<'sub'>;
841
+ summary: Html<'summary'>;
842
+ sup: Html<'sup'>;
843
+ table: Html<'table'>;
844
+ tbody: Html<'tbody'>;
845
+ td: Html<'td', TableCellOwn>;
846
+ template: Html<'template', { shadowrootmode?: Attr<'open' | 'closed'> }>;
847
+ textarea: Html<'textarea', TextareaOwn>;
848
+ tfoot: Html<'tfoot'>;
849
+ th: Html<
850
+ 'th',
851
+ TableCellOwn & { scope?: Attr<'row' | 'col' | 'rowgroup' | 'colgroup'>; abbr?: Attr<string> }
852
+ >;
853
+ thead: Html<'thead'>;
854
+ time: Html<'time', { datetime?: Attr<string> }>;
855
+ title: Html<'title'>;
856
+ tr: Html<'tr'>;
857
+ track: Html<
858
+ 'track',
859
+ {
860
+ default?: Attr<boolean>;
861
+ kind?: Attr<'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata'>;
862
+ label?: Attr<string>;
863
+ src?: Attr<string>;
864
+ srclang?: Attr<string>;
865
+ }
866
+ >;
867
+ u: Html<'u'>;
868
+ ul: Html<'ul'>;
869
+ var: Html<'var'>;
870
+ video: Html<
871
+ 'video',
872
+ MediaOwn & {
873
+ poster?: Attr<string>;
874
+ width?: Attr<Size>;
875
+ height?: Attr<Size>;
876
+ playsinline?: Attr<boolean>;
877
+ }
878
+ >;
879
+ wbr: Html<'wbr'>;
880
+
881
+ // SVG elements. `a`, `script`, `style` and `title` are the HTML ones, which SVG shares.
882
+ animate: Svg<'animate'>;
883
+ animateMotion: Svg<'animateMotion'>;
884
+ animateTransform: Svg<'animateTransform'>;
885
+ circle: Svg<'circle'>;
886
+ clipPath: Svg<'clipPath'>;
887
+ defs: Svg<'defs'>;
888
+ desc: Svg<'desc'>;
889
+ ellipse: Svg<'ellipse'>;
890
+ feBlend: Svg<'feBlend'>;
891
+ feColorMatrix: Svg<'feColorMatrix'>;
892
+ feComponentTransfer: Svg<'feComponentTransfer'>;
893
+ feComposite: Svg<'feComposite'>;
894
+ feConvolveMatrix: Svg<'feConvolveMatrix'>;
895
+ feDiffuseLighting: Svg<'feDiffuseLighting'>;
896
+ feDisplacementMap: Svg<'feDisplacementMap'>;
897
+ feDistantLight: Svg<'feDistantLight'>;
898
+ feDropShadow: Svg<'feDropShadow'>;
899
+ feFlood: Svg<'feFlood'>;
900
+ feFuncA: Svg<'feFuncA'>;
901
+ feFuncB: Svg<'feFuncB'>;
902
+ feFuncG: Svg<'feFuncG'>;
903
+ feFuncR: Svg<'feFuncR'>;
904
+ feGaussianBlur: Svg<'feGaussianBlur'>;
905
+ feImage: Svg<'feImage'>;
906
+ feMerge: Svg<'feMerge'>;
907
+ feMergeNode: Svg<'feMergeNode'>;
908
+ feMorphology: Svg<'feMorphology'>;
909
+ feOffset: Svg<'feOffset'>;
910
+ fePointLight: Svg<'fePointLight'>;
911
+ feSpecularLighting: Svg<'feSpecularLighting'>;
912
+ feSpotLight: Svg<'feSpotLight'>;
913
+ feTile: Svg<'feTile'>;
914
+ feTurbulence: Svg<'feTurbulence'>;
915
+ filter: Svg<'filter'>;
916
+ foreignObject: Svg<'foreignObject'>;
917
+ g: Svg<'g'>;
918
+ image: Svg<'image'>;
919
+ line: Svg<'line'>;
920
+ linearGradient: Svg<'linearGradient'>;
921
+ marker: Svg<'marker'>;
922
+ mask: Svg<'mask'>;
923
+ metadata: Svg<'metadata'>;
924
+ mpath: Svg<'mpath'>;
925
+ path: Svg<'path'>;
926
+ pattern: Svg<'pattern'>;
927
+ polygon: Svg<'polygon'>;
928
+ polyline: Svg<'polyline'>;
929
+ radialGradient: Svg<'radialGradient'>;
930
+ rect: Svg<'rect'>;
931
+ set: Svg<'set'>;
932
+ stop: Svg<'stop'>;
933
+ svg: Svg<'svg'>;
934
+ switch: Svg<'switch'>;
935
+ symbol: Svg<'symbol'>;
936
+ text: Svg<'text'>;
937
+ textPath: Svg<'textPath'>;
938
+ tspan: Svg<'tspan'>;
939
+ use: Svg<'use'>;
940
+ view: Svg<'view'>;
941
+ }
942
+
943
+ /** The attributes of an element by its tag. */
944
+ export type ElementProps<T extends keyof Elements> = Elements[T];
945
+
946
+ /** The element object of a tag, as a handler reads it from `event.currentTarget`. */
947
+ export type ElementOf<T extends keyof Elements> = T extends keyof HTMLElementTagNameMap
948
+ ? HTMLElementTagNameMap[T]
949
+ : T extends keyof SVGElementTagNameMap
950
+ ? SVGElementTagNameMap[T]
951
+ : HTMLElement;