@cossackframework/renderer 0.9.0 → 0.9.1

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.
@@ -0,0 +1,824 @@
1
+ /**
2
+ * Native attribute types for templates and component props.
3
+ *
4
+ * Template diagnostics check every attribute binding of an `html` or `svg`
5
+ * template against these maps, and UI components declare their native props
6
+ * with the same types. Attribute names are the HTML names (`tabindex`,
7
+ * `readonly`), lowercase for HTML and as written for SVG (`viewBox`).
8
+ */
9
+ import type { BindResult, IfDefinedResult, LiveResult, PreventDefaultResult } from './directives.js';
10
+ import type { nothing } from './cossack-html.js';
11
+ import type { CossackElement } from './cossack-element.js';
12
+ /** Native listener event. currentTarget is the control; target can be a descendant. */
13
+ export type ControlEvent<Element extends HTMLElement | SVGElement, EventType extends Event = Event> = EventType & {
14
+ readonly currentTarget: Element;
15
+ };
16
+ /** Renderer spread listeners use @event, not onEvent attributes. */
17
+ export type NativeEvents<Element extends HTMLElement | SVGElement> = {
18
+ [Name in keyof HTMLElementEventMap as `@${Name}`]?: ((event: ControlEvent<Element, HTMLElementEventMap[Name]>) => unknown) | PreventDefaultResult | null | typeof nothing;
19
+ };
20
+ /** Attribute omission follows renderer semantics. Property bindings use their own contracts. */
21
+ export type Attribute<Value> = Value | IfDefinedResult | null | typeof nothing;
22
+ /** Attribute types for a shape of attribute values, with `?name` for boolean attributes. */
23
+ export type Attributes<Shape> = {
24
+ [Key in keyof Shape]?: Attribute<Shape[Key]>;
25
+ } & {
26
+ [Key in keyof Shape as NonNullable<Shape[Key]> extends boolean ? `?${Key & string}` : never]?: boolean | null | typeof nothing;
27
+ };
28
+ /** ARIA names come from the DOM library. Boolean/number values serialize as text. */
29
+ export type AriaAttributes = {
30
+ [Name in keyof ARIAMixin as ARIAMixin[Name] extends string | null ? Name extends `aria${infer Suffix}` ? `aria-${Lowercase<Suffix>}` : never : never]?: Attribute<string | boolean | number>;
31
+ } & {
32
+ [Name in keyof ARIAMixin as Name extends `aria${infer Suffix}Elements` ? `aria-${Lowercase<Suffix>}` : Name extends `aria${infer Suffix}Element` ? `aria-${Lowercase<Suffix>}` : never]?: Attribute<string>;
33
+ };
34
+ type InputMode = 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url';
35
+ type EnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
36
+ type CrossOrigin = 'anonymous' | 'use-credentials' | '';
37
+ type FetchPriority = 'high' | 'low' | 'auto';
38
+ /** Attributes every HTML element accepts. */
39
+ export type GlobalAttributes<Element extends HTMLElement = HTMLElement> = NativeEvents<Element> & AriaAttributes & Attributes<{
40
+ id: string;
41
+ class: string;
42
+ style: string;
43
+ title: string;
44
+ role: string;
45
+ lang: string;
46
+ dir: 'ltr' | 'rtl' | 'auto';
47
+ tabindex: number;
48
+ hidden: boolean | 'until-found';
49
+ inert: boolean;
50
+ autofocus: boolean;
51
+ slot: string;
52
+ part: string;
53
+ exportparts: string;
54
+ accesskey: string;
55
+ draggable: boolean | 'true' | 'false';
56
+ spellcheck: boolean | 'true' | 'false';
57
+ contenteditable: boolean | 'true' | 'false' | 'plaintext-only';
58
+ translate: 'yes' | 'no';
59
+ autocapitalize: 'off' | 'none' | 'on' | 'sentences' | 'words' | 'characters';
60
+ autocorrect: 'on' | 'off';
61
+ writingsuggestions: boolean | 'true' | 'false';
62
+ inputmode: InputMode;
63
+ enterkeyhint: EnterKeyHint;
64
+ popover: boolean | 'auto' | 'manual' | 'hint';
65
+ is: string;
66
+ nonce: string;
67
+ itemscope: boolean;
68
+ itemtype: string;
69
+ itemprop: string;
70
+ itemid: string;
71
+ itemref: string;
72
+ }> & {
73
+ [Name: `data-${string}`]: Attribute<string | number | boolean> | undefined;
74
+ };
75
+ type ValueBinding<Value> = Value | BindResult | LiveResult | null | typeof nothing;
76
+ export type ButtonAttributes = GlobalAttributes<HTMLButtonElement> & Attributes<{
77
+ type: 'button' | 'submit' | 'reset';
78
+ disabled: boolean;
79
+ name: string;
80
+ value: string | number;
81
+ form: string;
82
+ formaction: string;
83
+ formenctype: string;
84
+ formmethod: 'get' | 'post' | 'dialog';
85
+ formnovalidate: boolean;
86
+ formtarget: string;
87
+ popovertarget: string;
88
+ popovertargetaction: 'hide' | 'show' | 'toggle';
89
+ command: string;
90
+ commandfor: string;
91
+ }>;
92
+ /** Native links retain browser navigation, download and modifier-key behavior. */
93
+ export type AnchorAttributes = GlobalAttributes<HTMLAnchorElement> & Attributes<{
94
+ href: string;
95
+ target: string;
96
+ rel: string;
97
+ download: string | boolean;
98
+ hreflang: string;
99
+ type: string;
100
+ referrerpolicy: ReferrerPolicy;
101
+ ping: string;
102
+ }>;
103
+ export type InputAttributes = GlobalAttributes<HTMLInputElement> & Attributes<{
104
+ type: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
105
+ name: string;
106
+ value: string | number;
107
+ placeholder: string;
108
+ disabled: boolean;
109
+ readonly: boolean;
110
+ required: boolean;
111
+ multiple: boolean;
112
+ checked: boolean;
113
+ autocomplete: string;
114
+ inputmode: InputMode;
115
+ enterkeyhint: EnterKeyHint;
116
+ min: string | number;
117
+ max: string | number;
118
+ step: number | 'any';
119
+ minlength: number;
120
+ maxlength: number;
121
+ pattern: string;
122
+ accept: string;
123
+ capture: 'user' | 'environment';
124
+ list: string;
125
+ dirname: string;
126
+ form: string;
127
+ formaction: string;
128
+ formenctype: string;
129
+ formmethod: 'get' | 'post' | 'dialog';
130
+ formnovalidate: boolean;
131
+ formtarget: string;
132
+ src: string;
133
+ alt: string;
134
+ width: number;
135
+ height: number;
136
+ popovertarget: string;
137
+ popovertargetaction: 'hide' | 'show' | 'toggle';
138
+ }> & {
139
+ /** Use .value for reactive DOM values, including bind()/live(). */
140
+ '.value'?: ValueBinding<string | number>;
141
+ '.checked'?: ValueBinding<boolean>;
142
+ '.indeterminate'?: ValueBinding<boolean>;
143
+ };
144
+ /** Checked state is owned by the component's checked prop, not a competing spread. */
145
+ export type CheckControlAttributes = Omit<GlobalAttributes<HTMLInputElement>, 'role' | 'aria-checked'> & Attributes<{
146
+ name: string;
147
+ value: string | number;
148
+ disabled: boolean;
149
+ required: boolean;
150
+ form: string;
151
+ }> & {
152
+ '.value'?: ValueBinding<string | number>;
153
+ };
154
+ export type LabelAttributes = GlobalAttributes<HTMLLabelElement> & Attributes<{
155
+ for: string;
156
+ }>;
157
+ export type FormAttributes = GlobalAttributes<HTMLFormElement> & Attributes<{
158
+ action: string;
159
+ method: 'get' | 'post' | 'dialog';
160
+ enctype: string;
161
+ target: string;
162
+ name: string;
163
+ autocomplete: 'on' | 'off';
164
+ 'accept-charset': string;
165
+ rel: string;
166
+ novalidate: boolean;
167
+ }>;
168
+ /** Native range attributes; numeric state and disabled behavior belong to Slider. */
169
+ export type RangeAttributes = Omit<GlobalAttributes<HTMLInputElement>, 'role' | 'aria-valuemin' | 'aria-valuemax' | 'aria-valuenow'> & Attributes<{
170
+ name: string;
171
+ form: string;
172
+ list: string;
173
+ }>;
174
+ /** Multiline text uses .value; HTML has no textarea value attribute. */
175
+ export type TextareaAttributes = GlobalAttributes<HTMLTextAreaElement> & Attributes<{
176
+ name: string;
177
+ form: string;
178
+ placeholder: string;
179
+ disabled: boolean;
180
+ readonly: boolean;
181
+ required: boolean;
182
+ autocomplete: string;
183
+ cols: number;
184
+ rows: number;
185
+ minlength: number;
186
+ maxlength: number;
187
+ wrap: 'soft' | 'hard';
188
+ dirname: string;
189
+ inputmode: InputMode;
190
+ enterkeyhint: EnterKeyHint;
191
+ }> & {
192
+ '.value'?: ValueBinding<string>;
193
+ };
194
+ /** Selection uses .value or selected option children; HTML has no select value attribute. */
195
+ export type SelectAttributes = GlobalAttributes<HTMLSelectElement> & Attributes<{
196
+ name: string;
197
+ form: string;
198
+ disabled: boolean;
199
+ required: boolean;
200
+ multiple: boolean;
201
+ autocomplete: string;
202
+ }> & {
203
+ '.value'?: ValueBinding<string>;
204
+ };
205
+ /** PasswordInput owns value, type and disabled state across its input and reveal button. */
206
+ export type PasswordAttributes = Pick<InputAttributes, keyof GlobalAttributes<HTMLInputElement> | 'name' | 'form' | 'placeholder' | 'readonly' | '?readonly' | 'required' | '?required' | 'autocomplete' | 'minlength' | 'maxlength' | 'pattern' | 'inputmode' | 'enterkeyhint'>;
207
+ /** Native SVG root attributes. HTML form and editable attributes do not apply. */
208
+ export type SvgAttributes = NativeEvents<SVGSVGElement> & AriaAttributes & Attributes<{
209
+ id: string;
210
+ class: string;
211
+ style: string;
212
+ role: string;
213
+ lang: string;
214
+ tabindex: number;
215
+ focusable: 'true' | 'false';
216
+ width: number | string;
217
+ height: number | string;
218
+ viewBox: string;
219
+ fill: string;
220
+ stroke: string;
221
+ 'stroke-width': number | string;
222
+ }> & {
223
+ [Name: `data-${string}`]: Attribute<string | number | boolean> | undefined;
224
+ };
225
+ export type QuoteAttributes = GlobalAttributes<HTMLQuoteElement> & Attributes<{
226
+ cite: string;
227
+ }>;
228
+ export type OrderedListAttributes = GlobalAttributes<HTMLOListElement> & Attributes<{
229
+ start: number;
230
+ reversed: boolean;
231
+ type: '1' | 'a' | 'A' | 'i' | 'I';
232
+ }>;
233
+ /** Attributes shared by native data and header cells. */
234
+ export type TableCellAttributes = GlobalAttributes<HTMLTableCellElement> & Attributes<{
235
+ colspan: number;
236
+ rowspan: number;
237
+ headers: string;
238
+ }>;
239
+ export type TableHeadAttributes = TableCellAttributes & Attributes<{
240
+ scope: 'row' | 'col' | 'rowgroup' | 'colgroup';
241
+ abbr: string;
242
+ }>;
243
+ type InputElementAttributes = InputAttributes & Attributes<{
244
+ size: number;
245
+ }>;
246
+ type SelectElementAttributes = SelectAttributes & Attributes<{
247
+ size: number;
248
+ }>;
249
+ type Media = Attributes<{
250
+ src: string;
251
+ crossorigin: CrossOrigin;
252
+ preload: 'none' | 'metadata' | 'auto' | '';
253
+ autoplay: boolean;
254
+ loop: boolean;
255
+ muted: boolean;
256
+ controls: boolean;
257
+ controlslist: string;
258
+ disableremoteplayback: boolean;
259
+ }>;
260
+ export type AudioAttributes = GlobalAttributes<HTMLAudioElement> & Media;
261
+ export type VideoAttributes = GlobalAttributes<HTMLVideoElement> & Media & Attributes<{
262
+ poster: string;
263
+ playsinline: boolean;
264
+ width: number;
265
+ height: number;
266
+ disablepictureinpicture: boolean;
267
+ }>;
268
+ export type AreaAttributes = GlobalAttributes<HTMLAreaElement> & Attributes<{
269
+ alt: string;
270
+ coords: string;
271
+ shape: 'circle' | 'default' | 'poly' | 'rect';
272
+ href: string;
273
+ target: string;
274
+ download: string | boolean;
275
+ ping: string;
276
+ rel: string;
277
+ referrerpolicy: ReferrerPolicy;
278
+ }>;
279
+ export type BaseAttributes = GlobalAttributes<HTMLBaseElement> & Attributes<{
280
+ href: string;
281
+ target: string;
282
+ }>;
283
+ export type CanvasAttributes = GlobalAttributes<HTMLCanvasElement> & Attributes<{
284
+ width: number;
285
+ height: number;
286
+ }>;
287
+ export type ColAttributes = GlobalAttributes<HTMLTableColElement> & Attributes<{
288
+ span: number;
289
+ }>;
290
+ export type DataAttributes = GlobalAttributes<HTMLDataElement> & Attributes<{
291
+ value: string | number;
292
+ }>;
293
+ export type ModAttributes = GlobalAttributes<HTMLModElement> & Attributes<{
294
+ cite: string;
295
+ datetime: string;
296
+ }>;
297
+ export type DetailsAttributes = GlobalAttributes<HTMLDetailsElement> & Attributes<{
298
+ open: boolean;
299
+ name: string;
300
+ }>;
301
+ export type DialogAttributes = GlobalAttributes<HTMLDialogElement> & Attributes<{
302
+ open: boolean;
303
+ closedby: 'any' | 'closerequest' | 'none';
304
+ }>;
305
+ export type EmbedAttributes = GlobalAttributes<HTMLEmbedElement> & Attributes<{
306
+ src: string;
307
+ type: string;
308
+ width: number | string;
309
+ height: number | string;
310
+ }>;
311
+ export type FieldsetAttributes = GlobalAttributes<HTMLFieldSetElement> & Attributes<{
312
+ disabled: boolean;
313
+ form: string;
314
+ name: string;
315
+ }>;
316
+ export type HtmlAttributes = GlobalAttributes<HTMLHtmlElement> & Attributes<{
317
+ xmlns: string;
318
+ }>;
319
+ export type IframeAttributes = GlobalAttributes<HTMLIFrameElement> & Attributes<{
320
+ src: string;
321
+ srcdoc: string;
322
+ name: string;
323
+ sandbox: string;
324
+ allow: string;
325
+ allowfullscreen: boolean;
326
+ width: number | string;
327
+ height: number | string;
328
+ referrerpolicy: ReferrerPolicy;
329
+ loading: 'eager' | 'lazy';
330
+ }>;
331
+ export type ImageAttributes = GlobalAttributes<HTMLImageElement> & Attributes<{
332
+ alt: string;
333
+ src: string;
334
+ srcset: string;
335
+ sizes: string;
336
+ crossorigin: CrossOrigin;
337
+ usemap: string;
338
+ ismap: boolean;
339
+ width: number | string;
340
+ height: number | string;
341
+ referrerpolicy: ReferrerPolicy;
342
+ decoding: 'sync' | 'async' | 'auto';
343
+ loading: 'eager' | 'lazy';
344
+ fetchpriority: FetchPriority;
345
+ }>;
346
+ export type ListItemAttributes = GlobalAttributes<HTMLLIElement> & Attributes<{
347
+ value: number;
348
+ }>;
349
+ export type LinkAttributes = GlobalAttributes<HTMLLinkElement> & Attributes<{
350
+ href: string;
351
+ crossorigin: CrossOrigin;
352
+ rel: string;
353
+ as: string;
354
+ media: string;
355
+ hreflang: string;
356
+ type: string;
357
+ sizes: string;
358
+ imagesrcset: string;
359
+ imagesizes: string;
360
+ referrerpolicy: ReferrerPolicy;
361
+ integrity: string;
362
+ blocking: string;
363
+ color: string;
364
+ disabled: boolean;
365
+ fetchpriority: FetchPriority;
366
+ }>;
367
+ export type MapAttributes = GlobalAttributes<HTMLMapElement> & Attributes<{
368
+ name: string;
369
+ }>;
370
+ export type MetaAttributes = GlobalAttributes<HTMLMetaElement> & Attributes<{
371
+ name: string;
372
+ 'http-equiv': string;
373
+ content: string;
374
+ charset: string;
375
+ media: string;
376
+ }>;
377
+ export type MeterAttributes = GlobalAttributes<HTMLMeterElement> & Attributes<{
378
+ value: number;
379
+ min: number;
380
+ max: number;
381
+ low: number;
382
+ high: number;
383
+ optimum: number;
384
+ }>;
385
+ export type ObjectAttributes = GlobalAttributes<HTMLObjectElement> & Attributes<{
386
+ data: string;
387
+ type: string;
388
+ name: string;
389
+ form: string;
390
+ width: number | string;
391
+ height: number | string;
392
+ }>;
393
+ export type OptgroupAttributes = GlobalAttributes<HTMLOptGroupElement> & Attributes<{
394
+ disabled: boolean;
395
+ label: string;
396
+ }>;
397
+ export type OptionAttributes = GlobalAttributes<HTMLOptionElement> & Attributes<{
398
+ disabled: boolean;
399
+ label: string;
400
+ selected: boolean;
401
+ value: string | number;
402
+ }>;
403
+ export type OutputAttributes = GlobalAttributes<HTMLOutputElement> & Attributes<{
404
+ for: string;
405
+ form: string;
406
+ name: string;
407
+ }>;
408
+ export type ProgressAttributes = GlobalAttributes<HTMLProgressElement> & Attributes<{
409
+ value: number;
410
+ max: number;
411
+ }>;
412
+ export type ScriptAttributes = GlobalAttributes<HTMLScriptElement> & Attributes<{
413
+ src: string;
414
+ type: string;
415
+ nomodule: boolean;
416
+ async: boolean;
417
+ defer: boolean;
418
+ crossorigin: CrossOrigin;
419
+ integrity: string;
420
+ referrerpolicy: ReferrerPolicy;
421
+ blocking: string;
422
+ fetchpriority: FetchPriority;
423
+ }>;
424
+ export type SlotAttributes = GlobalAttributes<HTMLSlotElement> & Attributes<{
425
+ name: string;
426
+ }>;
427
+ export type SourceAttributes = GlobalAttributes<HTMLSourceElement> & Attributes<{
428
+ type: string;
429
+ media: string;
430
+ src: string;
431
+ srcset: string;
432
+ sizes: string;
433
+ width: number;
434
+ height: number;
435
+ }>;
436
+ export type StyleAttributes = GlobalAttributes<HTMLStyleElement> & Attributes<{
437
+ media: string;
438
+ blocking: string;
439
+ }>;
440
+ export type TemplateElementAttributes = GlobalAttributes<HTMLTemplateElement> & Attributes<{
441
+ shadowrootmode: 'open' | 'closed';
442
+ shadowrootdelegatesfocus: boolean;
443
+ shadowrootclonable: boolean;
444
+ shadowrootserializable: boolean;
445
+ }>;
446
+ export type TimeAttributes = GlobalAttributes<HTMLTimeElement> & Attributes<{
447
+ datetime: string;
448
+ }>;
449
+ export type TrackAttributes = GlobalAttributes<HTMLTrackElement> & Attributes<{
450
+ default: boolean;
451
+ kind: 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata';
452
+ label: string;
453
+ src: string;
454
+ srclang: string;
455
+ }>;
456
+ /**
457
+ * The attributes each HTML element accepts, by lowercase tag name. Reached
458
+ * through TemplateTypeMap; not exported, since its expanded form is large.
459
+ */
460
+ interface HTMLElementAttributeMap {
461
+ a: AnchorAttributes;
462
+ abbr: GlobalAttributes;
463
+ address: GlobalAttributes;
464
+ area: AreaAttributes;
465
+ article: GlobalAttributes;
466
+ aside: GlobalAttributes;
467
+ audio: AudioAttributes;
468
+ b: GlobalAttributes;
469
+ base: BaseAttributes;
470
+ bdi: GlobalAttributes;
471
+ bdo: GlobalAttributes;
472
+ blockquote: QuoteAttributes;
473
+ body: GlobalAttributes<HTMLBodyElement>;
474
+ br: GlobalAttributes<HTMLBRElement>;
475
+ button: ButtonAttributes;
476
+ canvas: CanvasAttributes;
477
+ caption: GlobalAttributes<HTMLTableCaptionElement>;
478
+ cite: GlobalAttributes;
479
+ code: GlobalAttributes;
480
+ col: ColAttributes;
481
+ colgroup: ColAttributes;
482
+ data: DataAttributes;
483
+ datalist: GlobalAttributes<HTMLDataListElement>;
484
+ dd: GlobalAttributes;
485
+ del: ModAttributes;
486
+ details: DetailsAttributes;
487
+ dfn: GlobalAttributes;
488
+ dialog: DialogAttributes;
489
+ div: GlobalAttributes<HTMLDivElement>;
490
+ dl: GlobalAttributes<HTMLDListElement>;
491
+ dt: GlobalAttributes;
492
+ em: GlobalAttributes;
493
+ embed: EmbedAttributes;
494
+ fieldset: FieldsetAttributes;
495
+ figcaption: GlobalAttributes;
496
+ figure: GlobalAttributes;
497
+ footer: GlobalAttributes;
498
+ form: FormAttributes;
499
+ h1: GlobalAttributes<HTMLHeadingElement>;
500
+ h2: GlobalAttributes<HTMLHeadingElement>;
501
+ h3: GlobalAttributes<HTMLHeadingElement>;
502
+ h4: GlobalAttributes<HTMLHeadingElement>;
503
+ h5: GlobalAttributes<HTMLHeadingElement>;
504
+ h6: GlobalAttributes<HTMLHeadingElement>;
505
+ head: GlobalAttributes<HTMLHeadElement>;
506
+ header: GlobalAttributes;
507
+ hgroup: GlobalAttributes;
508
+ hr: GlobalAttributes<HTMLHRElement>;
509
+ html: HtmlAttributes;
510
+ i: GlobalAttributes;
511
+ iframe: IframeAttributes;
512
+ img: ImageAttributes;
513
+ input: InputElementAttributes;
514
+ ins: ModAttributes;
515
+ kbd: GlobalAttributes;
516
+ label: LabelAttributes;
517
+ legend: GlobalAttributes<HTMLLegendElement>;
518
+ li: ListItemAttributes;
519
+ link: LinkAttributes;
520
+ main: GlobalAttributes;
521
+ map: MapAttributes;
522
+ mark: GlobalAttributes;
523
+ menu: GlobalAttributes<HTMLMenuElement>;
524
+ meta: MetaAttributes;
525
+ meter: MeterAttributes;
526
+ nav: GlobalAttributes;
527
+ noscript: GlobalAttributes;
528
+ object: ObjectAttributes;
529
+ ol: OrderedListAttributes;
530
+ optgroup: OptgroupAttributes;
531
+ option: OptionAttributes;
532
+ output: OutputAttributes;
533
+ p: GlobalAttributes<HTMLParagraphElement>;
534
+ picture: GlobalAttributes<HTMLPictureElement>;
535
+ pre: GlobalAttributes<HTMLPreElement>;
536
+ progress: ProgressAttributes;
537
+ q: QuoteAttributes;
538
+ rp: GlobalAttributes;
539
+ rt: GlobalAttributes;
540
+ ruby: GlobalAttributes;
541
+ s: GlobalAttributes;
542
+ samp: GlobalAttributes;
543
+ script: ScriptAttributes;
544
+ search: GlobalAttributes;
545
+ section: GlobalAttributes;
546
+ select: SelectElementAttributes;
547
+ slot: SlotAttributes;
548
+ small: GlobalAttributes;
549
+ source: SourceAttributes;
550
+ span: GlobalAttributes<HTMLSpanElement>;
551
+ strong: GlobalAttributes;
552
+ style: StyleAttributes;
553
+ sub: GlobalAttributes;
554
+ summary: GlobalAttributes;
555
+ sup: GlobalAttributes;
556
+ table: GlobalAttributes<HTMLTableElement>;
557
+ tbody: GlobalAttributes<HTMLTableSectionElement>;
558
+ td: TableCellAttributes;
559
+ template: TemplateElementAttributes;
560
+ textarea: TextareaAttributes;
561
+ tfoot: GlobalAttributes<HTMLTableSectionElement>;
562
+ th: TableHeadAttributes;
563
+ thead: GlobalAttributes<HTMLTableSectionElement>;
564
+ time: TimeAttributes;
565
+ title: GlobalAttributes<HTMLTitleElement>;
566
+ tr: GlobalAttributes<HTMLTableRowElement>;
567
+ track: TrackAttributes;
568
+ u: GlobalAttributes;
569
+ ul: GlobalAttributes<HTMLUListElement>;
570
+ var: GlobalAttributes;
571
+ video: VideoAttributes;
572
+ wbr: GlobalAttributes;
573
+ }
574
+ type SvgValue = string | number;
575
+ /**
576
+ * Attributes of SVG elements: core, presentation, geometry, paint server,
577
+ * filter and animation attributes. One shape covers every SVG element.
578
+ */
579
+ export type SVGElementAttributes<Element extends SVGElement = SVGElement> = NativeEvents<Element> & AriaAttributes & Attributes<{
580
+ id: string;
581
+ class: string;
582
+ style: string;
583
+ lang: string;
584
+ 'xml:lang': string;
585
+ 'xml:space': string;
586
+ tabindex: number;
587
+ role: string;
588
+ autofocus: boolean;
589
+ nonce: string;
590
+ focusable: 'true' | 'false';
591
+ xmlns: string;
592
+ 'xmlns:xlink': string;
593
+ version: string;
594
+ requiredExtensions: string;
595
+ systemLanguage: string;
596
+ 'alignment-baseline': string;
597
+ 'baseline-shift': SvgValue;
598
+ clip: string;
599
+ 'clip-path': string;
600
+ 'clip-rule': 'nonzero' | 'evenodd' | 'inherit';
601
+ color: string;
602
+ 'color-interpolation': string;
603
+ 'color-interpolation-filters': string;
604
+ cursor: string;
605
+ direction: string;
606
+ display: string;
607
+ 'dominant-baseline': string;
608
+ fill: string;
609
+ 'fill-opacity': SvgValue;
610
+ 'fill-rule': 'nonzero' | 'evenodd' | 'inherit';
611
+ filter: string;
612
+ 'flood-color': string;
613
+ 'flood-opacity': SvgValue;
614
+ font: string;
615
+ 'font-family': string;
616
+ 'font-size': SvgValue;
617
+ 'font-size-adjust': SvgValue;
618
+ 'font-stretch': string;
619
+ 'font-style': string;
620
+ 'font-variant': string;
621
+ 'font-weight': SvgValue;
622
+ 'image-rendering': string;
623
+ 'letter-spacing': SvgValue;
624
+ 'lighting-color': string;
625
+ marker: string;
626
+ 'marker-end': string;
627
+ 'marker-mid': string;
628
+ 'marker-start': string;
629
+ mask: string;
630
+ 'mask-type': string;
631
+ opacity: SvgValue;
632
+ overflow: string;
633
+ 'paint-order': string;
634
+ 'pointer-events': string;
635
+ 'shape-rendering': string;
636
+ 'stop-color': string;
637
+ 'stop-opacity': SvgValue;
638
+ stroke: string;
639
+ 'stroke-dasharray': SvgValue;
640
+ 'stroke-dashoffset': SvgValue;
641
+ 'stroke-linecap': 'butt' | 'round' | 'square' | 'inherit';
642
+ 'stroke-linejoin': 'arcs' | 'bevel' | 'miter' | 'miter-clip' | 'round' | 'inherit';
643
+ 'stroke-miterlimit': SvgValue;
644
+ 'stroke-opacity': SvgValue;
645
+ 'stroke-width': SvgValue;
646
+ 'text-anchor': 'start' | 'middle' | 'end' | 'inherit';
647
+ 'text-decoration': string;
648
+ 'text-overflow': string;
649
+ 'text-rendering': string;
650
+ transform: string;
651
+ 'transform-box': string;
652
+ 'transform-origin': string;
653
+ 'unicode-bidi': string;
654
+ 'vector-effect': string;
655
+ visibility: string;
656
+ 'white-space': string;
657
+ 'word-spacing': SvgValue;
658
+ 'writing-mode': string;
659
+ 'mix-blend-mode': string;
660
+ isolation: string;
661
+ x: SvgValue;
662
+ y: SvgValue;
663
+ width: SvgValue;
664
+ height: SvgValue;
665
+ cx: SvgValue;
666
+ cy: SvgValue;
667
+ r: SvgValue;
668
+ rx: SvgValue;
669
+ ry: SvgValue;
670
+ x1: SvgValue;
671
+ y1: SvgValue;
672
+ x2: SvgValue;
673
+ y2: SvgValue;
674
+ d: string;
675
+ points: string;
676
+ pathLength: SvgValue;
677
+ viewBox: string;
678
+ preserveAspectRatio: string;
679
+ href: string;
680
+ 'xlink:href': string;
681
+ 'xlink:title': string;
682
+ dx: SvgValue;
683
+ dy: SvgValue;
684
+ rotate: SvgValue;
685
+ textLength: SvgValue;
686
+ lengthAdjust: 'spacing' | 'spacingAndGlyphs';
687
+ startOffset: SvgValue;
688
+ method: 'align' | 'stretch';
689
+ spacing: 'auto' | 'exact';
690
+ side: 'left' | 'right';
691
+ path: string;
692
+ gradientUnits: 'userSpaceOnUse' | 'objectBoundingBox';
693
+ gradientTransform: string;
694
+ spreadMethod: 'pad' | 'reflect' | 'repeat';
695
+ fx: SvgValue;
696
+ fy: SvgValue;
697
+ fr: SvgValue;
698
+ offset: SvgValue;
699
+ patternUnits: 'userSpaceOnUse' | 'objectBoundingBox';
700
+ patternContentUnits: 'userSpaceOnUse' | 'objectBoundingBox';
701
+ patternTransform: string;
702
+ markerWidth: SvgValue;
703
+ markerHeight: SvgValue;
704
+ markerUnits: 'strokeWidth' | 'userSpaceOnUse';
705
+ refX: SvgValue;
706
+ refY: SvgValue;
707
+ orient: SvgValue;
708
+ maskUnits: 'userSpaceOnUse' | 'objectBoundingBox';
709
+ maskContentUnits: 'userSpaceOnUse' | 'objectBoundingBox';
710
+ clipPathUnits: 'userSpaceOnUse' | 'objectBoundingBox';
711
+ filterUnits: 'userSpaceOnUse' | 'objectBoundingBox';
712
+ primitiveUnits: 'userSpaceOnUse' | 'objectBoundingBox';
713
+ in: string;
714
+ in2: string;
715
+ result: string;
716
+ stdDeviation: SvgValue;
717
+ mode: string;
718
+ operator: string;
719
+ values: string;
720
+ type: string;
721
+ k: SvgValue;
722
+ k1: SvgValue;
723
+ k2: SvgValue;
724
+ k3: SvgValue;
725
+ k4: SvgValue;
726
+ kernelMatrix: string;
727
+ order: SvgValue;
728
+ divisor: SvgValue;
729
+ bias: SvgValue;
730
+ targetX: SvgValue;
731
+ targetY: SvgValue;
732
+ edgeMode: string;
733
+ preserveAlpha: 'true' | 'false';
734
+ surfaceScale: SvgValue;
735
+ diffuseConstant: SvgValue;
736
+ specularConstant: SvgValue;
737
+ specularExponent: SvgValue;
738
+ kernelUnitLength: SvgValue;
739
+ azimuth: SvgValue;
740
+ elevation: SvgValue;
741
+ pointsAtX: SvgValue;
742
+ pointsAtY: SvgValue;
743
+ pointsAtZ: SvgValue;
744
+ limitingConeAngle: SvgValue;
745
+ baseFrequency: SvgValue;
746
+ numOctaves: SvgValue;
747
+ seed: SvgValue;
748
+ stitchTiles: 'stitch' | 'noStitch';
749
+ scale: SvgValue;
750
+ xChannelSelector: 'R' | 'G' | 'B' | 'A';
751
+ yChannelSelector: 'R' | 'G' | 'B' | 'A';
752
+ radius: SvgValue;
753
+ tableValues: string;
754
+ slope: SvgValue;
755
+ intercept: SvgValue;
756
+ amplitude: SvgValue;
757
+ exponent: SvgValue;
758
+ attributeName: string;
759
+ attributeType: string;
760
+ begin: string;
761
+ dur: string;
762
+ end: string;
763
+ min: string;
764
+ max: string;
765
+ repeatCount: SvgValue;
766
+ repeatDur: string;
767
+ restart: 'always' | 'whenNotActive' | 'never';
768
+ from: SvgValue;
769
+ to: SvgValue;
770
+ by: SvgValue;
771
+ additive: 'replace' | 'sum';
772
+ accumulate: 'none' | 'sum';
773
+ calcMode: 'discrete' | 'linear' | 'paced' | 'spline';
774
+ keyTimes: string;
775
+ keySplines: string;
776
+ keyPoints: string;
777
+ target: string;
778
+ download: string | boolean;
779
+ hreflang: string;
780
+ ping: string;
781
+ rel: string;
782
+ referrerpolicy: ReferrerPolicy;
783
+ crossorigin: CrossOrigin;
784
+ decoding: 'sync' | 'async' | 'auto';
785
+ media: string;
786
+ }> & {
787
+ [Name: `data-${string}`]: Attribute<string | number | boolean> | undefined;
788
+ };
789
+ /** The attributes each SVG element accepts, by tag name as written. Reached through TemplateTypeMap. */
790
+ type SVGElementAttributeMap = {
791
+ [Tag in keyof SVGElementTagNameMap]: SVGElementAttributes<SVGElementTagNameMap[Tag]>;
792
+ };
793
+ /** A `ref=${...}` value: a ref object or a callback that receives the element. */
794
+ export type RefValue = {
795
+ value?: unknown;
796
+ } | ((element: any) => unknown) | null | undefined | typeof nothing;
797
+ /**
798
+ * The types template diagnostics check bindings against. Exported with
799
+ * `html` so a program that uses templates already contains them.
800
+ */
801
+ export interface TemplateTypeMap {
802
+ html: HTMLElementAttributeMap;
803
+ svg: SVGElementAttributeMap;
804
+ /** Attributes of unknown and custom HTML elements. */
805
+ global: GlobalAttributes;
806
+ /** Attributes of unknown SVG elements. */
807
+ svgGlobal: SVGElementAttributes;
808
+ htmlElements: HTMLElementTagNameMap;
809
+ svgElements: SVGElementTagNameMap;
810
+ /** Values that remove an attribute or leave it to the renderer. */
811
+ omitted: null | undefined | typeof nothing;
812
+ ifDefined: IfDefinedResult;
813
+ live: LiveResult;
814
+ bind: BindResult;
815
+ preventDefault: PreventDefaultResult;
816
+ /** Values a `?name=${...}` binding takes. */
817
+ boolean: boolean | null | undefined | typeof nothing;
818
+ /** Values an `@event=${...}` binding takes for an event the maps do not name. */
819
+ listener: ((event: any) => unknown) | PreventDefaultResult | null | undefined | typeof nothing;
820
+ ref: RefValue;
821
+ /** The instance type of a class a component tag may bind. */
822
+ component: CossackElement;
823
+ }
824
+ export {};