marko
Version:
UI Components + streaming, async, high performance, HTML templating for Node.js and the browser.
1,291 lines (1,149 loc) • 147 kB
TypeScript
import * as csstype from "csstype";
/**
* Potential improvements:
* - Share properties between input interfaces
* - Add more interfaces of `Link` which restrict specific attributes based on type.
* - Isolate some event handlers to specific elements (eg media events).
* - Create more interface for individual aria roles.
*/
declare global {
namespace Marko {
interface NativeTags {
a: NativeTag<Marko.HTML.A, HTMLAnchorElement>;
abbr: NativeTag<Marko.HTML.Abbr, HTMLElement>;
address: NativeTag<Marko.HTML.Address, HTMLElement>;
area: NativeTag<Marko.HTML.Area, HTMLAreaElement>;
article: NativeTag<Marko.HTML.Article, HTMLElement>;
aside: NativeTag<Marko.HTML.Aside, HTMLElement>;
audio: NativeTag<Marko.HTML.Audio, HTMLAudioElement>;
b: NativeTag<Marko.HTML.B, HTMLElement>;
base: NativeTag<Marko.HTML.Base, HTMLBaseElement>;
bdi: NativeTag<Marko.HTML.BDI, HTMLElement>;
bdo: NativeTag<Marko.HTML.BDO, HTMLElement>;
blockquote: NativeTag<Marko.HTML.BlockQuote, HTMLQuoteElement>;
body: NativeTag<Marko.HTML.Body, HTMLBodyElement>;
br: NativeTag<Marko.HTML.Br, HTMLBRElement>;
button: NativeTag<Marko.HTML.Button, HTMLButtonElement>;
canvas: NativeTag<Marko.HTML.Canvas, HTMLCanvasElement>;
caption: NativeTag<Marko.HTML.Caption, HTMLTableCaptionElement>;
cite: NativeTag<Marko.HTML.Cite, HTMLElement>;
code: NativeTag<Marko.HTML.Code, HTMLElement>;
col: NativeTag<Marko.HTML.Col, HTMLTableColElement>;
colgroup: NativeTag<Marko.HTML.ColGroup, HTMLTableColElement>;
data: NativeTag<Marko.HTML.Data, HTMLDataElement>;
datalist: NativeTag<Marko.HTML.DataList, HTMLDataListElement>;
dd: NativeTag<Marko.HTML.DD, HTMLElement>;
del: NativeTag<Marko.HTML.Del, HTMLModElement>;
details: NativeTag<Marko.HTML.Details, HTMLDetailsElement>;
dfn: NativeTag<Marko.HTML.Dfn, HTMLElement>;
dialog: NativeTag<Marko.HTML.Dialog, HTMLDialogElement>;
div: NativeTag<Marko.HTML.Div, HTMLDivElement>;
dl: NativeTag<Marko.HTML.DL, HTMLDListElement>;
dt: NativeTag<Marko.HTML.DT, HTMLElement>;
em: NativeTag<Marko.HTML.Em, HTMLElement>;
embed: NativeTag<Marko.HTML.Embed, HTMLEmbedElement>;
fieldset: NativeTag<Marko.HTML.FieldSet, HTMLFieldSetElement>;
figcaption: NativeTag<Marko.HTML.FigCaption, HTMLElement>;
figure: NativeTag<Marko.HTML.Figure, HTMLElement>;
footer: NativeTag<Marko.HTML.Footer, HTMLElement>;
form: NativeTag<Marko.HTML.Form, HTMLFormElement>;
h1: NativeTag<Marko.HTML.H1, HTMLHeadingElement>;
h2: NativeTag<Marko.HTML.H2, HTMLHeadingElement>;
h3: NativeTag<Marko.HTML.H3, HTMLHeadingElement>;
h4: NativeTag<Marko.HTML.H4, HTMLHeadingElement>;
h5: NativeTag<Marko.HTML.H5, HTMLHeadingElement>;
h6: NativeTag<Marko.HTML.H6, HTMLHeadingElement>;
head: NativeTag<Marko.HTML.Head, HTMLHeadElement>;
header: NativeTag<Marko.HTML.Header, HTMLElement>;
hgroup: NativeTag<Marko.HTML.HGroup, HTMLElement>;
hr: NativeTag<Marko.HTML.HR, HTMLHRElement>;
html: NativeTag<Marko.HTML.HTML, HTMLHtmlElement>;
i: NativeTag<Marko.HTML.I, HTMLElement>;
iframe: NativeTag<Marko.HTML.IFrame, HTMLIFrameElement>;
img: NativeTag<Marko.HTML.Img, HTMLImageElement>;
input: NativeTag<Marko.HTML.Input, HTMLInputElement>;
ins: NativeTag<Marko.HTML.Ins, HTMLModElement>;
kbd: NativeTag<Marko.HTML.Kbd, HTMLElement>;
label: NativeTag<Marko.HTML.Label, HTMLLabelElement>;
legend: NativeTag<Marko.HTML.Legend, HTMLLegendElement>;
li: NativeTag<Marko.HTML.LI, HTMLLIElement>;
link: NativeTag<Marko.HTML.Link, HTMLLinkElement>;
main: NativeTag<Marko.HTML.Main, HTMLElement>;
map: NativeTag<Marko.HTML.Map, HTMLMapElement>;
mark: NativeTag<Marko.HTML.Mark, HTMLElement>;
menu: NativeTag<Marko.HTML.Menu, HTMLMenuElement>;
meta: NativeTag<Marko.HTML.Meta, HTMLMetaElement>;
meter: NativeTag<Marko.HTML.Meter, HTMLMeterElement>;
nav: NativeTag<Marko.HTML.Nav, HTMLElement>;
noscript: NativeTag<Marko.HTML.NoScript, HTMLElement>;
object: NativeTag<Marko.HTML.Object, HTMLObjectElement>;
ol: NativeTag<Marko.HTML.OL, HTMLOListElement>;
optgroup: NativeTag<Marko.HTML.OptGroup, HTMLOptGroupElement>;
option: NativeTag<Marko.HTML.Option, HTMLOptionElement>;
output: NativeTag<Marko.HTML.Output, HTMLOutputElement>;
p: NativeTag<Marko.HTML.P, HTMLParagraphElement>;
picture: NativeTag<Marko.HTML.Picture, HTMLPictureElement>;
pre: NativeTag<Marko.HTML.Pre, HTMLPreElement>;
progress: NativeTag<Marko.HTML.Progress, HTMLProgressElement>;
q: NativeTag<Marko.HTML.Q, HTMLQuoteElement>;
rp: NativeTag<Marko.HTML.RP, HTMLElement>;
rt: NativeTag<Marko.HTML.RT, HTMLElement>;
ruby: NativeTag<Marko.HTML.Ruby, HTMLElement>;
s: NativeTag<Marko.HTML.S, HTMLElement>;
samp: NativeTag<Marko.HTML.Samp, HTMLElement>;
script: NativeTag<Marko.HTML.Script, HTMLScriptElement>;
section: NativeTag<Marko.HTML.Section, HTMLElement>;
select: NativeTag<Marko.HTML.Select, HTMLSelectElement>;
slot: NativeTag<Marko.HTML.Slot, HTMLSlotElement>;
small: NativeTag<Marko.HTML.Small, HTMLElement>;
source: NativeTag<Marko.HTML.Source, HTMLSourceElement>;
span: NativeTag<Marko.HTML.Span, HTMLSpanElement>;
strong: NativeTag<Marko.HTML.Strong, HTMLElement>;
style: NativeTag<Marko.HTML.Style, HTMLStyleElement>;
sub: NativeTag<Marko.HTML.Sub, HTMLElement>;
summary: NativeTag<Marko.HTML.Summary, HTMLElement>;
sup: NativeTag<Marko.HTML.Sup, HTMLElement>;
table: NativeTag<Marko.HTML.Table, HTMLTableElement>;
tbody: NativeTag<Marko.HTML.TBody, HTMLTableSectionElement>;
td: NativeTag<Marko.HTML.TD, HTMLTableDataCellElement>;
template: NativeTag<Marko.HTML.Template, HTMLTemplateElement>;
textarea: NativeTag<Marko.HTML.TextArea, HTMLTextAreaElement>;
tfoot: NativeTag<Marko.HTML.TFoot, HTMLTableSectionElement>;
th: NativeTag<Marko.HTML.TH, HTMLTableHeaderCellElement>;
thead: NativeTag<Marko.HTML.THead, HTMLTableSectionElement>;
time: NativeTag<Marko.HTML.Time, HTMLTimeElement>;
title: NativeTag<Marko.HTML.Title, HTMLTitleElement>;
tr: NativeTag<Marko.HTML.TR, HTMLTableRowElement>;
track: NativeTag<Marko.HTML.Track, HTMLTrackElement>;
u: NativeTag<Marko.HTML.U, HTMLElement>;
ul: NativeTag<Marko.HTML.UL, HTMLUListElement>;
var: NativeTag<Marko.HTML.Var, HTMLElement>;
video: NativeTag<Marko.HTML.Video, HTMLVideoElement>;
wbr: NativeTag<Marko.HTML.WBr, HTMLElement>;
}
namespace CSS {
export interface Properties
extends csstype.PropertiesHyphen,
csstype.Properties {}
}
namespace HTML {
interface A extends HTMLAttributes<HTMLAnchorElement> {
/**
* Specifies whether to download the resource, or the name of the file to download.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download
*/
download?: AttrBooleanOrString;
/**
* Specifies the URL of the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-href
*/
href?: AttrString;
/**
* Specifies the language of the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-hreflang
*/
hreflang?: AttrString;
/**
* Specifies the intended media type for the linked resource.
* @see https://html.spec.whatwg.org/multipage/semantics.html#attr-link-media
*/
media?: AttrString;
/**
* Specifies a space-separated list of URLs to send a ping request to when the link is followed.
* @see https://html.spec.whatwg.org/multipage/links.html#ping
*/
ping?: AttrString;
/**
* Specifies the referrer policy for the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-referrerpolicy
*/
referrerpolicy?: AttrReferrerPolicy;
/**
* Specifies the relationship between the current document and the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#linkTypes
*/
rel?:
| AttrMissing
| "alternate"
| "author"
| "bookmark"
| "external"
| "help"
| "license"
| "next"
| "nofollow"
| "noopener"
| "noreferrer"
| "opener"
| "prev"
| "search"
| "tag"
| (string & {});
/**
* Specifies the browsing context for the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-target
*/
target?: AttrTarget;
/**
* Specifies the MIME type of the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-type
*/
type?: AttrString;
/** @deprecated */
charset?: AttrString;
/** @deprecated */
coords?: AttrString;
/** @deprecated */
name?: AttrString;
/** @deprecated */
rev?: AttrString;
/** @deprecated */
shape?: AttrString;
}
interface Abbr extends HTMLAttributes<HTMLElement> {}
interface Address extends HTMLAttributes<HTMLElement> {}
interface Area extends HTMLAttributes<HTMLAreaElement> {
/**
* Specifies an alternative text for the area.
* @see https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-alt
*/
alt?: AttrString;
/**
* Specifies the coordinates of the area's shape.
* @see https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-coords
*/
coords?: AttrString;
/**
* Specifies whether to download the resource, or the name of the file to download.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-download
*/
download?: A["download"];
/**
* Specifies the URL of the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-href
*/
href?: A["href"];
/**
* Specifies the language of the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-hreflang
*/
hreflang?: A["hreflang"];
/**
* Specifies a space-separated list of URLs to send a ping request to when the link is followed.
* @see https://html.spec.whatwg.org/multipage/links.html#ping
*/
ping?: A["ping"];
/**
* Specifies the referrer policy for the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-referrerpolicy
*/
referrerpolicy?: A["referrerpolicy"];
/**
* Specifies the relationship between the current document and the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#linkTypes
*/
rel?: A["rel"];
/**
* Specifies the shape of the clickable region on the area.
* @see https://html.spec.whatwg.org/multipage/image-maps.html#attr-area-shape
*/
shape?: AttrMissing | "rect" | "circle" | "poly" | "default";
/**
* Specifies the browsing context for the linked resource.
* @see https://html.spec.whatwg.org/multipage/links.html#attr-hyperlink-target
*/
target?: A["target"];
/** @deprecated */
name?: AttrString;
/** @deprecated */
nohref?: AttrString;
/** @deprecated */
type?: AttrString;
}
interface Article extends HTMLAttributes<HTMLElement> {}
interface Aside extends HTMLAttributes<HTMLElement> {}
interface Audio extends HTMLAttributes<HTMLAudioElement> {
/**
* Specifies whether the audio should start playing automatically.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-autoplay
*/
autoplay?: AttrBoolean;
/**
* Specifies whether the audio controls should be displayed.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-controls
*/
controls?: AttrBoolean;
/**
* Specifies the controls to be shown or hidden on the audio player.
* @see https://wicg.github.io/controls-list/explainer.html
*/
controlslist?:
| AttrMissing
| "nodownload"
| "nofullscreen"
| "noplaybackrate"
| "noremoteplayback"
| (string & {});
/**
* Specifies the CORS settings for the audio resource.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-crossorigin
*/
crossorigin?: AttrCrossOrigin;
/**
* Specifies whether to disable remote playback of the audio.
* @see https://www.w3.org/TR/remote-playback/#the-disableremoteplayback-attribute
*/
disableremoteplayback?: AttrBoolean;
/**
* Specifies whether the audio should start over again when finished.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-loop
*/
loop?: AttrBoolean;
/**
* Specifies whether the audio should be muted by default.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-muted
*/
muted?: AttrBoolean;
/**
* Specifies the type of preloading for the audio.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-preload
*/
preload?: AttrBoolean | "none" | "metadata" | "auto";
/**
* Specifies the URL of the audio resource.
* @see https://html.spec.whatwg.org/multipage/media.html#attr-media-src
*/
src?: AttrString;
}
interface B extends HTMLAttributes<HTMLElement> {}
interface Base extends HTMLAttributes<HTMLBaseElement> {
/**
* Specifies the base URL for resolving relative URLs within the document.
* @see https://html.spec.whatwg.org/multipage/semantics.html#attr-base-href
*/
href?: AttrString;
/**
* Specifies the default browsing context for links and forms in the document.
* @see https://html.spec.whatwg.org/multipage/semantics.html#attr-base-target
*/
target?: AttrTarget;
}
interface BDI extends HTMLAttributes<HTMLElement> {}
interface BDO extends HTMLAttributes<HTMLElement> {}
interface BlockQuote extends HTMLAttributes<HTMLQuoteElement> {
/**
* Specifies the URL of the source document or quoted content.
* @see https://html.spec.whatwg.org/multipage/grouping-content.html#attr-blockquote-cite
*/
cite?: AttrString;
}
interface Body extends HTMLAttributes<HTMLBodyElement> {
/**
* Fires after printing the document.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-afterprint
*/
onAfterprint?: AttrEventHandler<Event, HTMLBodyElement>;
"on-afterprint"?: this["onAfterprint"];
/**
* Fires before printing the document.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-beforeprint
*/
onBeforeprint?: AttrEventHandler<Event, HTMLBodyElement>;
"on-beforeprint"?: this["onBeforeprint"];
/**
* Fired when the page is about to be unloaded, in case the page would like to show a warning prompt.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-beforeunload
*/
onBeforeunload?: AttrEventHandler<BeforeUnloadEvent, HTMLBodyElement>;
"on-beforeunload"?: this["onBeforeunload"];
/**
* Fired when the fragment part of the document's URL changes.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-hashchange
*/
onHashchange?: AttrEventHandler<HashChangeEvent, HTMLBodyElement>;
"on-hashchange"?: this["onHashchange"];
/**
* Fired when the user's preferred languages change.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-languagechange
*/
onLanguagechange?: AttrEventHandler<Event, HTMLBodyElement>;
"on-languagechange"?: this["onLanguagechange"];
/**
* Fired when the window receives a message.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-message
*/
onMessage?: AttrEventHandler<MessageEvent, HTMLBodyElement>;
"on-message"?: this["onMessage"];
/**
* Fired when the window receives an error message.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-messageerror
*/
onMessageerror?: AttrEventHandler<MessageEvent, HTMLBodyElement>;
"on-messageerror"?: this["onMessageerror"];
/**
* Fired when the network connection is lost.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-offline
*/
onOffline?: AttrEventHandler<Event, HTMLBodyElement>;
"on-offline"?: this["onOffline"];
/**
* Fired when the network connection is recovered.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-online
*/
onOnline?: AttrEventHandler<Event, HTMLBodyElement>;
"on-online"?: this["onOnline"];
/**
* Fired when the page's session history entry stops being the active entry.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-pagehide
*/
onPagehide?: AttrEventHandler<PageTransitionEvent, HTMLBodyElement>;
"on-pagehide"?: this["onPagehide"];
/**
* Fired when the page's session history entry becomes the active entry.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-pageshow
*/
onPageshow?: AttrEventHandler<PageTransitionEvent, HTMLBodyElement>;
"on-pageshow"?: this["onPageshow"];
/**
* Fired when the window's session history is popped.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-popstate
*/
onPopstate?: AttrEventHandler<PopStateEvent, HTMLBodyElement>;
"on-popstate"?: this["onPopstate"];
/**
* Fires when a previously-unhandled promise rejection becomes handled.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-rejectionhandled
*/
onRejectionhandled?: AttrEventHandler<Event, HTMLBodyElement>;
"on-rejectionhandled"?: this["onRejectionhandled"];
/**
* Fired when the corresponding localStorage or sessionStorage storage areas change.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-storage
*/
onStorage?: AttrEventHandler<StorageEvent, HTMLBodyElement>;
"on-storage"?: this["onStorage"];
/**
* Fired when a promise rejection goes unhandled.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-unhandledrejection
*/
onUnhandledRejection?: AttrEventHandler<
PromiseRejectionEvent,
HTMLBodyElement
>;
"on-unhandledrejection"?: this["onUnhandledRejection"];
/**
* Fired when the page is going away.
* @see https://html.spec.whatwg.org/multipage/indices.html#event-unload
*/
onUnload?: AttrEventHandler<Event, HTMLBodyElement>;
"on-unload"?: this["onUnload"];
/** @deprecated */
alink?: AttrString;
/** @deprecated */
background?: AttrString;
/** @deprecated */
bgcolor?: AttrString;
/** @deprecated */
link?: AttrString;
/** @deprecated */
text?: AttrString;
/** @deprecated */
vlink?: AttrString;
/** @deprecated */
bottommargin?: AttrStringOrNumber;
/** @deprecated */
leftmargin?: AttrStringOrNumber;
/** @deprecated */
rightmargin?: AttrStringOrNumber;
/** @deprecated */
topmargin?: AttrStringOrNumber;
}
interface Br extends HTMLAttributes<HTMLBRElement> {
/** @deprecated */
clear?: AttrString;
}
interface Button extends HTMLAttributes<HTMLButtonElement> {
/**
* Specifies whether the button should be disabled.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-disabled
*/
disabled?: AttrBoolean;
/**
* Specifies the form element associated with the button.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fae-form
*/
form?: AttrString;
/**
* Specifies the URL of the form's action when the button is clicked.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fs-formaction
*/
formaction?: Form["action"];
/**
* Specifies the enctype attribute for the form when the button is clicked.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fs-formenctype
*/
formenctype?: Form["enctype"];
/**
* Specifies the method attribute for the form when the button is clicked.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fs-formmethod
*/
formmethod?: Form["method"];
/**
* Specifies whether the form should not validate when the button is clicked.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fs-formnovalidate
*/
formnovalidate?: Form["novalidate"];
/**
* Specifies the target attribute for the form when the button is clicked.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fs-formtarget
*/
formtarget?: Form["target"];
/**
* Specifies the name of the button.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-name
*/
name?: AttrString;
/**
* Specifies the type of the button.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-type
*/
type?: AttrMissing | "submit" | "reset" | "button";
/**
* Specifies the value of the button.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-button-value
*/
value?: AttrString;
/**
* Specifies the target element for the popover.
* @see https://developer.chrome.com/docs/web-platform/popover-api/popovertargetaction-toggle-attribute
*/
popovertarget?: AttrString;
/**
* Specifies the action to perform on the popover target.
* @see https://developer.chrome.com/docs/web-platform/popover-api/popovertargetaction-toggle-attribute
*/
popovertargetaction?: AttrMissing | "toggle" | "show" | "hide";
}
interface Canvas extends HTMLAttributes<HTMLCanvasElement> {
/**
* Specifies the height of the canvas element.
* @see https://html.spec.whatwg.org/multipage/canvas.html#attr-canvas-height
*/
height?: AttrStringOrNumber;
/**
* Specifies the width of the canvas element.
* @see https://html.spec.whatwg.org/multipage/canvas.html#attr-canvas-width
*/
width?: AttrStringOrNumber;
}
interface Caption extends HTMLAttributes<HTMLTableCaptionElement> {
/** @deprecated */
align?: AttrString;
}
interface Cite extends HTMLAttributes<HTMLElement> {}
interface Code extends HTMLAttributes<HTMLElement> {}
interface Col extends HTMLAttributes<HTMLTableColElement> {
/**
* Specifies how many columns in the table the `<col>` element spans.
* @see https://html.spec.whatwg.org/multipage/tables.html#attr-col-span
*/
span?: AttrStringOrNumber;
/** @deprecated */
align?: AttrString;
/** @deprecated */
char?: AttrString;
/** @deprecated */
charoff?: AttrStringOrNumber;
/** @deprecated */
valign?: AttrString;
/** @deprecated */
width?: AttrStringOrNumber;
}
interface ColGroup extends HTMLAttributes<HTMLTableColElement> {
/**
* Specifies how many columns in the table the `<colgroup>` element spans.
* @see https://html.spec.whatwg.org/multipage/tables.html#attr-colgroup-span
*/
span?: AttrStringOrNumber;
/** @deprecated */
align?: AttrString;
/** @deprecated */
bgcolor?: AttrString;
/** @deprecated */
char?: AttrString;
/** @deprecated */
charoff?: AttrStringOrNumber;
/** @deprecated */
valign?: AttrString;
}
interface Data extends HTMLAttributes<HTMLDataElement> {
/**
* Specifies the machine-readable value of the `<data>` element.
* @see https://html.spec.whatwg.org/multipage/text-level-semantics.html#attr-data-value
*/
value?: AttrStringOrNumber;
}
interface DataList extends HTMLAttributes<HTMLDataListElement> {}
interface DD extends HTMLAttributes<HTMLElement> {
/** @deprecated */
nowrap?: AttrYesNoString;
}
interface Del extends HTMLAttributes<HTMLModElement> {
/**
* Specifies the URL of the source of the quote or change.
* @see https://html.spec.whatwg.org/multipage/edits.html#attr-mod-cite
*/
cite?: AttrString;
/**
* Specifies the date and time of the quote or change.
* @see https://html.spec.whatwg.org/multipage/edits.html#attr-mod-datetime
*/
datetime?: AttrString;
}
interface Details extends HTMLAttributes<HTMLDetailsElement> {
/**
* Specifies whether the `<details>` element is open.
* @see https://html.spec.whatwg.org/multipage/interactive-elements.html#attr-details-open
*/
open?: AttrBoolean;
}
interface Dfn extends HTMLAttributes<HTMLElement> {}
interface Dialog extends HTMLAttributes<HTMLDialogElement> {
/**
* Specifies whether the `<dialog>` element is open.
* @see https://html.spec.whatwg.org/multipage/interactive-elements.html#attr-dialog-open
*/
open?: AttrBoolean;
}
interface Div extends HTMLAttributes<HTMLDivElement> {}
interface DL extends HTMLAttributes<HTMLDListElement> {}
interface DT extends HTMLAttributes<HTMLElement> {}
interface Em extends HTMLAttributes<HTMLElement> {}
interface Embed extends HTMLAttributes<HTMLEmbedElement> {
/**
* Specifies the height of the embedded content.
* @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-height
*/
height?: AttrStringOrNumber;
/**
* Specifies the URL of the resource to embed.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-embed-src
*/
src?: AttrString;
/**
* Specifies the MIME type of the embedded content.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-embed-type
*/
type?: AttrString;
/**
* Specifies the width of the embedded content.
* @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-width
*/
width?: AttrStringOrNumber;
}
interface FieldSet extends HTMLAttributes<HTMLFieldSetElement> {
/**
* Specifies whether the `<fieldset>` element is disabled.
* @see https://html.spec.whatwg.org/multipage/form-elements.html#attr-fieldset-disabled
*/
disabled?: AttrBoolean;
/**
* Specifies associated form for the `<fieldset>`.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form
*/
form?: AttrString;
/**
* Specifies the name of the `<fieldset>` on the form.elements api.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-name
* @see HTMLFormElement.elements
*/
name?: AttrString;
}
interface FigCaption extends HTMLAttributes<HTMLElement> {}
interface Figure extends HTMLAttributes<HTMLElement> {}
interface Form extends HTMLAttributes<HTMLFormElement> {
/**
* Specifies the character encodings that are to be used for the form submission.
* @see https://html.spec.whatwg.org/multipage/forms.html#attr-form-accept-charset
*/
"accept-charset"?: AttrString;
/**
* Specifies the URL which the form data will be submitted to.
* @see https://html.spec.whatwg.org/multipage/forms.html#attr-fs-action
*/
action?: AttrString;
/**
* Controls whether the browser should automatically complete form input values.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete
*/
autocomplete?: AttrOnOff;
/**
* Specifies the content type used to submit the form to the server.
* @see https://html.spec.whatwg.org/multipage/forms.html#attr-form-enctype
*/
enctype?:
| AttrMissing
| "application/x-www-form-urlencoded"
| "multipart/form-data"
| "text/plain";
/**
* Specifies the HTTP method used to submit the form to the server.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-method
*/
method?:
| AttrMissing
| "POST"
| "post"
| "GET"
| "get"
| "dialog"
| "DIALOG";
/**
* The name attribute represents the form's name within the forms collection.
* @see https://html.spec.whatwg.org/multipage/forms.html#attr-form-name
* @see Document.forms
*/
name?: AttrString;
/**
* Indicates that the form should not be validated when submitted.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-novalidate
*/
novalidate?: AttrBoolean;
/**
* Specifies the relationship between the current document and the linked document.
* @see https://html.spec.whatwg.org/multipage/links.html#linkTypes
*/
rel?:
| AttrMissing
| "external"
| "help"
| "license"
| "next"
| "nofollow"
| "noopener"
| "noreferrer"
| "opener"
| "prev"
| "search"
| (string & {});
/**
* Specifies the browsing context in which the linked resource will be opened.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-target
*/
target?: AttrTarget;
/** @deprecated */
accept?: AttrString;
/**
* Fired at a form element when it is constructing the entry list
* @see https://html.spec.whatwg.org/multipage/indices.html#event-formdata
*/
onFormdata?: AttrEventHandler<FormDataEvent, HTMLFormElement>;
"on-formdata"?: this["onFormdata"];
/**
* Fired when a form is submitted, either by user interaction or through a script.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#event-submit
*/
onSubmit?: AttrEventHandler<SubmitEvent, HTMLFormElement>;
"on-submit"?: this["onSubmit"];
}
interface H1 extends HTMLAttributes<HTMLHeadingElement> {}
interface H2 extends HTMLAttributes<HTMLHeadingElement> {}
interface H3 extends HTMLAttributes<HTMLHeadingElement> {}
interface H4 extends HTMLAttributes<HTMLHeadingElement> {}
interface H5 extends HTMLAttributes<HTMLHeadingElement> {}
interface H6 extends HTMLAttributes<HTMLHeadingElement> {}
interface Footer extends HTMLAttributes<HTMLElement> {}
interface Head extends HTMLAttributes<HTMLHeadElement> {
/** @deprecated */
profile?: AttrString;
/** @see https://ogp.me/ */
prefix?: AttrString;
}
interface Header extends HTMLAttributes<HTMLElement> {}
interface HGroup extends HTMLAttributes<HTMLElement> {}
interface HR extends HTMLAttributes<HTMLHRElement> {
/** @deprecated */
align?: AttrMissing | "left" | "center" | "right";
/** @deprecated */
color?: AttrString;
/** @deprecated */
noshade?: AttrBoolean;
/** @deprecated */
size?: AttrStringOrNumber;
/** @deprecated */
width?: AttrStringOrNumber;
}
interface HTML extends HTMLAttributes<HTMLHtmlElement> {
/** @deprecated */
xmlns?: AttrString;
/** @deprecated */
manifest?: AttrString;
/** @deprecated */
version?: AttrString;
/** @see https://ogp.me/ */
prefix?: AttrString;
}
interface I extends HTMLAttributes<HTMLElement> {}
interface IFrame extends HTMLAttributes<HTMLIFrameElement> {
/**
* A space-separated list of permissions that are granted to the content inside the frame.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-allow
*/
allow?: AttrString;
/**
* Indicates whether the iframe can be displayed in fullscreen mode.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-allowfullscreen
*/
allowfullscreen?: AttrBoolean;
/**
* The height of the iframe.
* @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-height
*/
height?: AttrStringOrNumber;
/**
* Indicates whether the browser should eagerly load the frame's contents or not.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-loading
*/
loading?: AttrMissing | "eager" | "lazy";
/**
* A name or keyword that can be used to refer to the iframe from elsewhere in the document.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-name
*/
name?: AttrString;
/**
* Specifies the referrer policy for the iframe.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-referrerpolicy
*/
referrerpolicy?: AttrReferrerPolicy;
/**
* A set of sandbox flags that are applied to the iframe.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-sandbox
*/
sandbox?:
| AttrMissing
| "allow-downloads-without-user-activation"
| "allow-downloads"
| "allow-forms"
| "allow-modals"
| "allow-orientation-lock"
| "allow-pointer-lock"
| "allow-popups-to-escape-sandbox"
| "allow-popups"
| "allow-presentation"
| "allow-same-origin"
| "allow-scripts"
| "allow-storage-access-by-user-activation"
| "allow-top-navigation-by-user-activation"
| "allow-top-navigation-to-custom-protocols"
| "allow-top-navigation"
| (string & {});
/**
* The URL of the page to embed in the iframe.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-src
*/
src?: AttrString;
/**
* A document to render inside the iframe.
* @see https://html.spec.whatwg.org/multipage/iframe-embed-object.html#attr-iframe-srcdoc
*/
srcdoc?: AttrString;
/**
* The width of the iframe.
* @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-width
*/
width?: AttrStringOrNumber;
/** @deprecated */
align?: AttrString;
/** @deprecated */
frameborder?: AttrStringOrNumber;
/** @deprecated */
longdesc?: AttrString;
/** @deprecated */
marginheight?: AttrStringOrNumber;
/** @deprecated */
marginwidth?: AttrStringOrNumber;
/** @deprecated */
scrolling?: AttrYesNoString | "auto";
}
interface Img extends HTMLAttributes<HTMLImageElement> {
/**
* The alternative text for the image, displayed when the image cannot be loaded or
* rendered. This is useful for accessibility purposes.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-alt
*/
alt?: AttrString;
/**
* A CORS setting attribute that determines if the image should be fetched with CORS or not.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-crossorigin
*/
crossorigin?: AttrCrossOrigin;
/**
* Specifies the decoding mode for the image, which can be "sync", "async", or "auto".
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-decoding
*/
decoding?: AttrMissing | "sync" | "async" | "auto";
/**
* Sets the fetch priority of the image, which can be "auto", "high", or "low".
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-fetchpriority
*/
fetchpriority?: AttrMissing | "auto" | "high" | "low";
/**
* The height of the image, either as a string (CSS length value) or a number (pixels).
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-dim-height
*/
height?: AttrStringOrNumber;
/**
* Indicates that the image is part of a server-side image map.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-ismap
*/
ismap?: AttrBoolean;
/**
* Specifies the loading behavior of the image, which can be "eager" or "lazy".
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-loading
*/
loading?: AttrMissing | "eager" | "lazy";
/**
* Sets the referrer policy for the image request.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-referrerpolicy
*/
referrerpolicy?: AttrReferrerPolicy;
/**
* A string containing size descriptors for responsive images.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-sizes
*/
sizes?: AttrString;
/**
* The URL of the image to display.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-src
*/
src?: AttrString;
/**
* A string containing URL and size descriptor pairs for responsive images.
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-img-srcset
*/
srcset?: AttrString;
/**
* The URL of a client-side image map to associate with the image.
* @see https://html.spec.whatwg.org/multipage/image-maps.html#attr-hyperlink-usemap
*/
usemap?: AttrString;
/**
* The width of the image, either as a string (CSS length value) or a number (pixels
* @see https://html.spec.whatwg.org/multipage/embedded-content.html#attr-dim-width
*/
width?: AttrStringOrNumber;
/** @deprecated */
align?: AttrMissing | "left" | "center" | "right" | "justify" | "char";
/** @deprecated */
border?: AttrStringOrNumber;
/** @deprecated */
hspace?: AttrStringOrNumber;
/** @deprecated */
longdesc?: AttrString;
/** @deprecated */
name?: AttrString;
/** @deprecated */
vspace?: AttrStringOrNumber;
}
interface Input extends HTMLAttributes<HTMLInputElement> {
/**
* A comma-separated list of file types that a file input should accept.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-accept
*/
accept?: AttrString;
/**
* The alternate text for an image input, displayed if the image cannot be loaded.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-alt
*/
alt?: AttrString;
/**
* Specifies whether the input field should have autocomplete enabled or disabled.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-autocomplete
*/
autocomplete?: AttrAutoComplete;
/**
* Indicates whether a file input should use a specific capture method.
* "user" indicates the front camera, "environment" indicates the rear camera.
* @see https://w3c.github.io/html-media-capture/#dfn-capture
*/
capture?: AttrBoolean | "user" | "environment";
/**
* Indicates whether a checkbox should be checked or not.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-checked
*/
checked?: AttrBoolean;
/**
* Enables the submission of the directionality of a text input.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-dirname
*/
dirname?: AttrString;
/**
* Indicates whether the input should be disabled or not. When disabled,
* the input will not be interactable or submitted with the form.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-disabled
*/
disabled?: AttrBoolean;
/**
* The ID of the form element that this input is associated with.
* This allows the input to be associated with a form even if it is
* not a direct descendant of the form element.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fae-form
*/
form?: AttrString;
/**
* The URL of the form processing endpoint when the input image is used for form submission.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formaction
*/
formaction?: Form["action"];
/**
* The encoding type for the form data when the input image is used for form submission.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formenctype
*/
formenctype?: Form["enctype"];
/**
* The HTTP method to use when the input image is used for form submission.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formmethod
*/
formmethod?: Form["method"];
/**
* Indicates whether form validation should be skipped when the input image is used for form submission.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formnovalidate
*/
formnovalidate?: Form["novalidate"];
/**
* The browsing context for displaying the response after form submission when the input image is used.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-formtarget
*/
formtarget?: Form["target"];
/**
* The height of of an image input in pixels.
* @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-height
*/
height?: AttrStringOrNumber;
/**
* The ID of a <datalist> element that provides a list of suggested values for the input.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-list
*/
list?: AttrString;
/**
* The maximum allowed value for the input.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-max
*/
max?: AttrStringOrNumber;
/**
* The maximum number of characters allowed in the input.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-maxlength
*/
maxlength?: AttrStringOrNumber;
/**
* The minimum allowed value for the input.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-min
*/
min?: AttrStringOrNumber;
/**
* The minimum number of characters required in the input.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-minlength
*/
minlength?: AttrStringOrNumber;
/**
* Indicates whether the input should allow more than one value.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-multiple
*/
multiple?: AttrBoolean;
/**
* Used as a key when submitting the forms data. Also the name used in the form.elements api.
* @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-name
* @see HTMLFormElement.elements
*/
name?: AttrString;
/**
* A regular expression pattern to be validated against the input value.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-pattern
*/
pattern?: AttrString;
/**
* A short hint to display in the input field before the user enters a value.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-placeholder
*/
placeholder?: AttrStringOrNumber;
/**
* Specifies the target element for the popover.
* @see https://developer.chrome.com/docs/web-platform/popover-api/popovertargetaction-toggle-attribute
*/
popovertarget?: AttrString;
/**
* Specifies the action to perform on the popover target.
* @see https://developer.chrome.com/docs/web-platform/popover-api/popovertargetaction-toggle-attribute
*/
popovertargetaction?: AttrMissing | "toggle" | "show" | "hide";
/**
* Indicates whether the input should be read-only or not. Read-only inputs cannot be edited.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-readonly
*/
readonly?: AttrBoolean;
/**
* Indicates whether the input is required to have a value for the form to be submitted.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-required
*/
required?: AttrBoolean;
/**
* The number of characters wide a text input field should be displayed.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-size
*/
size?: AttrStringOrNumber;
/**
* The URL of the image file.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-src
*/
src?: AttrString;
/**
* Specifies the allowed number intervals for the input value.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-step
*/
step?: AttrStringOrNumber;
/**
* Controls the data type (and associated control) of the element.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-type
*/
type?:
| AttrMissing
| "button"
| "checkbox"
| "color"
| "date"
| "datetime-local"
| "email"
| "file"
| "hidden"
| "image"
| "month"
| "number"
| "password"
| "radio"
| "range"
| "reset"
| "search"
| "submit"
| "tel"
| "text"
| "time"
| "url"
| "week";
/**
* Specifies the string value you want to pass back to the server.
* @see https://html.spec.whatwg.org/multipage/input.html#attr-input-value
*/
value?: AttrStringOrNumber;
/**
* The width of an image input in pixels.
* @see https://html.spec.whatwg.org/multipage/embedded-content-other.html#attr-dim-width
*/
width?: AttrStringOrNumber;
}
interface Ins extends HTMLAttributes<HTMLModElement> {
/**
* A URI for a resource that explains the reason for the insertion.
* @see https://html.spec.whatwg.org/multipage/edits.html#attr-mod-cite
*/
cite?: AttrString;
/*