@mpen/jsxhtml 0.3.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.
- package/dist/classnames.d.ts +11 -0
- package/dist/custom/C.d.ts +6 -0
- package/dist/custom/Checkbox.d.ts +5 -0
- package/dist/custom/ColorInput.d.ts +5 -0
- package/dist/custom/DateInput.d.ts +5 -0
- package/dist/custom/DocType.d.ts +6 -0
- package/dist/custom/EmailInput.d.ts +5 -0
- package/dist/custom/Empty.d.ts +4 -0
- package/dist/custom/FileInput.d.ts +5 -0
- package/dist/custom/HtmlDocument.d.ts +5 -0
- package/dist/custom/NumberInput.d.ts +5 -0
- package/dist/custom/PasswordInput.d.ts +5 -0
- package/dist/custom/RadioButton.d.ts +5 -0
- package/dist/custom/RangeInput.d.ts +5 -0
- package/dist/custom/RawHtml.d.ts +6 -0
- package/dist/custom/SearchInput.d.ts +5 -0
- package/dist/custom/TelephoneInput.d.ts +5 -0
- package/dist/custom/TextInput.d.ts +5 -0
- package/dist/custom/TimeInput.d.ts +5 -0
- package/dist/custom/UrlInput.d.ts +5 -0
- package/dist/custom/WeekInput.d.ts +5 -0
- package/dist/custom/index.d.ts +20 -0
- package/dist/custom-components.d.ts +1 -23
- package/dist/htmlspec/IntrinsicElements.d.ts +240 -398
- package/dist/htmlspec/attributes/AriaAttributes.d.ts +11 -0
- package/dist/htmlspec/attributes/ElementAttributes.d.ts +28 -0
- package/dist/htmlspec/attributes/EventHandlers.d.ts +102 -0
- package/dist/htmlspec/attributes/GlobalAttributes.d.ts +11 -0
- package/dist/htmlspec/{GlobalAttributes.d.ts → attributes/StandardGlobalAttributes.d.ts} +26 -107
- package/dist/htmlspec/attributes/index.d.ts +7 -0
- package/dist/htmlspec/elements/a.d.ts +71 -0
- package/dist/htmlspec/elements/abbr.d.ts +4 -0
- package/dist/htmlspec/elements/address.d.ts +4 -0
- package/dist/htmlspec/elements/area.d.ts +66 -0
- package/dist/htmlspec/elements/article.d.ts +4 -0
- package/dist/htmlspec/elements/aside.d.ts +4 -0
- package/dist/htmlspec/elements/audio.d.ts +45 -0
- package/dist/htmlspec/elements/b.d.ts +4 -0
- package/dist/htmlspec/elements/base.d.ts +18 -0
- package/dist/htmlspec/elements/bdi.d.ts +4 -0
- package/dist/htmlspec/elements/bdo.d.ts +4 -0
- package/dist/htmlspec/elements/blockquote.d.ts +8 -0
- package/dist/htmlspec/elements/body.d.ts +92 -0
- package/dist/htmlspec/elements/br.d.ts +4 -0
- package/dist/htmlspec/elements/button.d.ts +103 -0
- package/dist/htmlspec/elements/canvas.d.ts +13 -0
- package/dist/htmlspec/elements/caption.d.ts +4 -0
- package/dist/htmlspec/elements/cite.d.ts +4 -0
- package/dist/htmlspec/elements/code.d.ts +4 -0
- package/dist/htmlspec/elements/col.d.ts +9 -0
- package/dist/htmlspec/elements/colgroup.d.ts +9 -0
- package/dist/htmlspec/elements/data.d.ts +9 -0
- package/dist/htmlspec/elements/datalist.d.ts +4 -0
- package/dist/htmlspec/elements/dd.d.ts +4 -0
- package/dist/htmlspec/elements/del.d.ts +12 -0
- package/dist/htmlspec/elements/details.d.ts +12 -0
- package/dist/htmlspec/elements/dfn.d.ts +4 -0
- package/dist/htmlspec/elements/dialog.d.ts +17 -0
- package/dist/htmlspec/elements/div.d.ts +4 -0
- package/dist/htmlspec/elements/dl.d.ts +4 -0
- package/dist/htmlspec/elements/dt.d.ts +4 -0
- package/dist/htmlspec/elements/element-types.d.ts +1 -0
- package/dist/htmlspec/elements/em.d.ts +4 -0
- package/dist/htmlspec/elements/embed.d.ts +21 -0
- package/dist/htmlspec/elements/fencedframe.d.ts +23 -0
- package/dist/htmlspec/elements/fieldset.d.ts +16 -0
- package/dist/htmlspec/elements/figcaption.d.ts +4 -0
- package/dist/htmlspec/elements/figure.d.ts +4 -0
- package/dist/htmlspec/elements/footer.d.ts +4 -0
- package/dist/htmlspec/elements/form.d.ts +61 -0
- package/dist/htmlspec/elements/h1.d.ts +4 -0
- package/dist/htmlspec/elements/h2.d.ts +4 -0
- package/dist/htmlspec/elements/h3.d.ts +4 -0
- package/dist/htmlspec/elements/h4.d.ts +4 -0
- package/dist/htmlspec/elements/h5.d.ts +4 -0
- package/dist/htmlspec/elements/h6.d.ts +4 -0
- package/dist/htmlspec/elements/head.d.ts +4 -0
- package/dist/htmlspec/elements/header.d.ts +4 -0
- package/dist/htmlspec/elements/hgroup.d.ts +4 -0
- package/dist/htmlspec/elements/hr.d.ts +4 -0
- package/dist/htmlspec/elements/html.d.ts +8 -0
- package/dist/htmlspec/elements/i.d.ts +4 -0
- package/dist/htmlspec/elements/iframe.d.ts +82 -0
- package/dist/htmlspec/elements/img.d.ts +90 -0
- package/dist/htmlspec/elements/index.d.ts +114 -0
- package/dist/htmlspec/elements/input.d.ts +189 -0
- package/dist/htmlspec/elements/ins.d.ts +12 -0
- package/dist/htmlspec/elements/kbd.d.ts +4 -0
- package/dist/htmlspec/elements/label.d.ts +8 -0
- package/dist/htmlspec/elements/legend.d.ts +4 -0
- package/dist/htmlspec/elements/li.d.ts +19 -0
- package/dist/htmlspec/elements/link.d.ts +77 -0
- package/dist/htmlspec/elements/main.d.ts +4 -0
- package/dist/htmlspec/elements/map.d.ts +8 -0
- package/dist/htmlspec/elements/mark.d.ts +4 -0
- package/dist/htmlspec/elements/menu.d.ts +4 -0
- package/dist/htmlspec/elements/meta.d.ts +24 -0
- package/dist/htmlspec/elements/meter.d.ts +29 -0
- package/dist/htmlspec/elements/nav.d.ts +4 -0
- package/dist/htmlspec/elements/noscript.d.ts +4 -0
- package/dist/htmlspec/elements/object.d.ts +29 -0
- package/dist/htmlspec/elements/ol.d.ts +24 -0
- package/dist/htmlspec/elements/optgroup.d.ts +12 -0
- package/dist/htmlspec/elements/option.d.ts +21 -0
- package/dist/htmlspec/elements/output.d.ts +16 -0
- package/dist/htmlspec/elements/p.d.ts +4 -0
- package/dist/htmlspec/elements/picture.d.ts +4 -0
- package/dist/htmlspec/elements/pre.d.ts +4 -0
- package/dist/htmlspec/elements/progress.d.ts +13 -0
- package/dist/htmlspec/elements/q.d.ts +8 -0
- package/dist/htmlspec/elements/rp.d.ts +4 -0
- package/dist/htmlspec/elements/rt.d.ts +4 -0
- package/dist/htmlspec/elements/ruby.d.ts +4 -0
- package/dist/htmlspec/elements/s.d.ts +4 -0
- package/dist/htmlspec/elements/samp.d.ts +4 -0
- package/dist/htmlspec/elements/script.d.ts +57 -0
- package/dist/htmlspec/elements/search.d.ts +4 -0
- package/dist/htmlspec/elements/section.d.ts +4 -0
- package/dist/htmlspec/elements/select.d.ts +37 -0
- package/dist/htmlspec/elements/selectedcontent.d.ts +7 -0
- package/dist/htmlspec/elements/slot.d.ts +8 -0
- package/dist/htmlspec/elements/small.d.ts +4 -0
- package/dist/htmlspec/elements/source.d.ts +33 -0
- package/dist/htmlspec/elements/span.d.ts +4 -0
- package/dist/htmlspec/elements/strong.d.ts +4 -0
- package/dist/htmlspec/elements/style.d.ts +21 -0
- package/dist/htmlspec/elements/sub.d.ts +4 -0
- package/dist/htmlspec/elements/summary.d.ts +4 -0
- package/dist/htmlspec/elements/sup.d.ts +4 -0
- package/dist/htmlspec/elements/table.d.ts +4 -0
- package/dist/htmlspec/elements/tbody.d.ts +4 -0
- package/dist/htmlspec/elements/td.d.ts +17 -0
- package/dist/htmlspec/elements/template.d.ts +29 -0
- package/dist/htmlspec/elements/textarea.d.ts +66 -0
- package/dist/htmlspec/elements/tfoot.d.ts +4 -0
- package/dist/htmlspec/elements/th.d.ts +31 -0
- package/dist/htmlspec/elements/thead.d.ts +4 -0
- package/dist/htmlspec/elements/time.d.ts +8 -0
- package/dist/htmlspec/elements/title.d.ts +4 -0
- package/dist/htmlspec/elements/tr.d.ts +4 -0
- package/dist/htmlspec/elements/track.d.ts +31 -0
- package/dist/htmlspec/elements/u.d.ts +4 -0
- package/dist/htmlspec/elements/ul.d.ts +12 -0
- package/dist/htmlspec/elements/var.d.ts +4 -0
- package/dist/htmlspec/elements/video.d.ts +66 -0
- package/dist/htmlspec/elements/wbr.d.ts +4 -0
- package/dist/index.cjs +142 -7
- package/dist/index.mjs +114 -9
- package/dist/internal/dev.d.ts +1 -0
- package/dist/internal/kitchen-sink-dev.d.ts +7 -0
- package/dist/internal/kitchen-sink.d.ts +2 -0
- package/dist/internal/type-assert.d.ts +39 -0
- package/dist/jsx-dev-runtime.cjs +1 -2
- package/dist/jsx-dev-runtime.mjs +2 -3
- package/dist/{jsx-runtime-cimCxEOU.js → jsx-runtime-BQPDXeiv.js} +27 -13
- package/dist/{jsx-runtime-Dh9PxNQe.js → jsx-runtime-DlHYwToA.js} +28 -14
- package/dist/jsx-runtime.cjs +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/jsx-types.d.ts +6 -26
- package/package.json +93 -86
- package/dist/htmlspec/AnchorElement.d.ts +0 -83
- package/dist/htmlspec/ButtonElement.d.ts +0 -55
- package/dist/htmlspec/InputAttributes.d.ts +0 -221
- package/dist/htmlspec/ScriptElement.d.ts +0 -38
- package/dist/htmlspec/StyleAttributes.d.ts +0 -19
- /package/dist/{dev.d.ts → classnames.test.d.ts} +0 -0
- /package/dist/{log.d.ts → internal/log.d.ts} +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
import type { Numeric } from '../attributes/StandardGlobalAttributes';
|
|
4
|
+
export interface IframeAttributes extends CommonAttributes<ElementForTag<'iframe'>> {
|
|
5
|
+
/**
|
|
6
|
+
* Specifies a Permissions Policy for the `<iframe `. The policy defines what features are available to the `<iframe ` (for example, access to the microphone, camera, battery, web-share, etc.) based on the origin of the request. See iframes in the `Permissions-Policy` topic for examples.
|
|
7
|
+
*/
|
|
8
|
+
allow?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Set to `true` if the `<iframe ` can activate fullscreen mode by calling the requestFullscreen() method.
|
|
11
|
+
*/
|
|
12
|
+
allowfullscreen?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Set to `true` to make the `<iframe ` credentialless, meaning that its content will be loaded in a new, ephemeral context. It doesn't have access to the network, cookies, and storage data associated with its origin. It uses a new context local to the top-level document lifetime. In return, the Cross-Origin-Embedder-Policy (COEP) embedding rules can be lifted, so documents with COEP set can embed third-party documents that do not. See IFrame credentialless for more details.
|
|
15
|
+
* @experimental
|
|
16
|
+
*/
|
|
17
|
+
credentialless?: string;
|
|
18
|
+
/**
|
|
19
|
+
* A Content Security Policy enforced for the embedded resource. See HTMLIFrameElement.csp for details.
|
|
20
|
+
* @experimental
|
|
21
|
+
*/
|
|
22
|
+
csp?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The height of the frame in CSS pixels. Default is `150`.
|
|
25
|
+
*/
|
|
26
|
+
height?: Numeric;
|
|
27
|
+
/**
|
|
28
|
+
* Indicates when the browser should load the iframe: Load the iframe immediately on page load (this is the default value). Defer loading of the iframe until it reaches a calculated distance from the visual viewport, as defined by the browser. The intent is to avoid using the network and storage bandwidth required to fetch the frame until the browser is reasonably certain that it will be needed. This improves the performance and cost in most typical use cases, in particular by reducing initial page load times.
|
|
29
|
+
*
|
|
30
|
+
* Possible values:
|
|
31
|
+
* - eager
|
|
32
|
+
* - lazy
|
|
33
|
+
*/
|
|
34
|
+
loading?: 'eager' | 'lazy';
|
|
35
|
+
/**
|
|
36
|
+
* A targetable name for the embedded browsing context. This can be used in the `target` attribute of the a, form, or base elements; the `formtarget` attribute of the input or button elements; or the `windowName` parameter in the window.open() method. In addition, the name becomes a property of the Window and Document objects, containing a reference to the embedded window or the element itself.
|
|
37
|
+
*/
|
|
38
|
+
name?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Contains a string representation of an options object representing a private state token operation; this object has the same structure as the `RequestInit` dictionary's `privateToken` property. IFrames containing this attribute can initiate operations such as issuing or redeeming tokens when their embedded content is loaded.
|
|
41
|
+
* @experimental
|
|
42
|
+
*/
|
|
43
|
+
privateToken?: string;
|
|
44
|
+
/**
|
|
45
|
+
* Indicates which referrer to send when fetching the frame's resource: The Referer header will not be sent. The Referer header will not be sent to origins without TLS (HTTPS). The sent referrer will be limited to the origin of the referring page: its scheme, host, and port. The referrer sent to other origins will be limited to the scheme, the host, and the port. Navigations on the same origin will still include the path. A referrer will be sent for same origin, but cross-origin requests will contain no referrer information. Only send the origin of the document as the referrer when the protocol security level stays the same (HTTPS→HTTPS), but don't send it to a less secure destination (HTTPS→HTTP). Send a full URL when performing a same-origin request, only send the origin when the protocol security level stays the same (HTTPS→HTTPS), and send no header to a less secure destination (HTTPS→HTTP). The referrer will include the origin _and_ the path (but not the fragment, password, or username). **This value is unsafe**, because it leaks origins and paths from TLS-protected resources to insecure origins.
|
|
46
|
+
*
|
|
47
|
+
* Possible values:
|
|
48
|
+
* - no-referrer
|
|
49
|
+
* - no-referrer-when-downgrade
|
|
50
|
+
* - origin
|
|
51
|
+
* - origin-when-cross-origin
|
|
52
|
+
* - same-origin
|
|
53
|
+
* - strict-origin
|
|
54
|
+
* - strict-origin-when-cross-origin
|
|
55
|
+
* - unsafe-url
|
|
56
|
+
*/
|
|
57
|
+
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
58
|
+
/**
|
|
59
|
+
* Controls the restrictions applied to the content embedded in the `<iframe `. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions: Allows downloading files through an a or area element with the download attribute, as well as through the navigation that leads to a download of a file. This works regardless of whether the user clicked on the link, or JS code initiated it without user interaction. Allows the page to submit forms. If this keyword is not used, a form will be displayed as normal, but submitting it will not trigger input validation, send data to a web server, or close a dialog. Allows the page to open modal windows by Window.alert(), Window.confirm(), Window.print() and Window.prompt(), while opening a dialog is allowed regardless of this keyword. It also allows the page to receive BeforeUnloadEvent event. Lets the resource lock the screen orientation. Allows the page to use the Pointer Lock API. Allows popups (created, for example, by Window.open() or `target="_blank"`). If this keyword is not used, such functionality will silently fail. Allows a sandboxed document to open a new browsing context without forcing the sandboxing flags upon it. This will allow, for example, a third-party advertisement to be safely sandboxed without forcing the same restrictions upon the page the ad links to. If this flag is not included, a redirected page, popup window, or new tab will be subject to the same sandbox restrictions as the originating `<iframe `. Allows embedders to have control over whether an iframe can start a presentation session. If this token is not used, the resource is treated as being from a special origin that always fails the same-origin policy (potentially preventing access to data storage/cookies and some JavaScript APIs). Allows the page to run scripts (but not create pop-up windows). If this keyword is not used, this operation is not allowed. Allows a document loaded in the `<iframe ` to use the Storage Access API to request access to unpartitioned cookies. Lets the resource navigate the top-level browsing context (the one named `_top`). Lets the resource navigate the top-level browsing context, but only if initiated by a user gesture. Allows navigations to non-`http` protocols built into browser or registered by a website. This feature is also activated by `allow-popups` or `allow-top-navigation` keyword.
|
|
60
|
+
*/
|
|
61
|
+
sandbox?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The URL of the page to embed. Use a value of `about:blank` to embed an empty page that conforms to the same-origin policy. Also note that programmatically removing an `<iframe `'s src attribute (e.g., via Element.removeAttribute()) causes `about:blank` to be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS.
|
|
64
|
+
*/
|
|
65
|
+
src?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Inline HTML to embed, overriding the `src` attribute. Its content should follow the syntax of a full HTML document, which includes the doctype directive, `<html `, `<body ` tags, etc., although most of them can be omitted, leaving only the body content. This doc will have `about:srcdoc` as its location. If a browser does not support the `srcdoc` attribute, it will fall back to the URL in the `src` attribute.
|
|
68
|
+
*/
|
|
69
|
+
srcdoc?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The width of the frame in CSS pixels. Default is `300`. These attributes are deprecated and may no longer be supported by all user agents. You should not use them in new content, and try to remove them from existing content.
|
|
72
|
+
*/
|
|
73
|
+
width?: Numeric;
|
|
74
|
+
/**
|
|
75
|
+
* Only when the frame's content is larger than its dimensions. Always show a scrollbar. Never show a scrollbar.
|
|
76
|
+
*
|
|
77
|
+
* Possible values:
|
|
78
|
+
* - yes
|
|
79
|
+
* - no
|
|
80
|
+
*/
|
|
81
|
+
auto?: 'yes' | 'no';
|
|
82
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
import type { Numeric } from '../attributes/StandardGlobalAttributes';
|
|
4
|
+
export interface ImgAttributes extends CommonAttributes<ElementForTag<'img'>> {
|
|
5
|
+
/**
|
|
6
|
+
* Defines text that can replace the image in the page. Setting this attribute to an empty string (`alt=""`) indicates that this image is _not_ a key part of the content (it's decoration or a tracking pixel), and that non-visual browsers may omit it from rendering. Visual browsers will also hide the broken image icon if the `alt` attribute is empty and the image failed to display. This attribute is also used when copying and pasting the image to text, or saving a linked image to a bookmark.
|
|
7
|
+
*/
|
|
8
|
+
alt?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The **`crossorigin`** attribute, valid on the audio, img, link, script, and video elements, provides support for CORS, defining how the element handles cross-origin requests, thereby enabling the configuration of the CORS requests for the element's fetched data. Depending on the element, the attribute can be a CORS settings attribute.
|
|
11
|
+
*/
|
|
12
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
13
|
+
/**
|
|
14
|
+
* This attribute provides a hint to the browser as to whether it should perform image decoding along with rendering the other DOM content in a single presentation step that looks more "correct" (`sync`), or render and present the other DOM content first and then decode the image and present it later (`async`). In practice, `async` means that the next paint does not wait for the image to decode. It is often difficult to perceive any noticeable effect when using `decoding` on static `<img ` elements. They'll likely be initially rendered as empty images while the image files are fetched (either from the network or from the cache) and then handled independently anyway, so the "syncing" of content updates is less apparent. However, the blocking of rendering while decoding happens, while often quite small, _can_ be measured - even if it is difficult to observe with the human eye. See What does the image decoding attribute actually do? for a more detailed analysis (tunetheweb.com, 2023). Using different `decoding` types can result in more noticeable differences when dynamically inserting `<img ` elements into the DOM via JavaScript - see HTMLImageElement.decoding for more details. Allowed values: Decode the image synchronously along with rendering the other DOM content, and present everything together. Decode the image asynchronously, after rendering and presenting the other DOM content. No preference for the decoding mode; the browser decides what is best for the user. This is the default value.
|
|
15
|
+
*
|
|
16
|
+
* Possible values:
|
|
17
|
+
* - sync
|
|
18
|
+
* - async
|
|
19
|
+
* - auto
|
|
20
|
+
*/
|
|
21
|
+
decoding?: 'sync' | 'async' | 'auto';
|
|
22
|
+
/**
|
|
23
|
+
* The **`elementtiming`** attribute is used to indicate that an element is flagged for tracking by PerformanceObserver objects using the `"element"` type. For more details, see the PerformanceElementTiming interface.
|
|
24
|
+
*/
|
|
25
|
+
elementtiming?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The **`fetchpriority`** attribute allows a developer to signal that fetching a particular image early in the loading process has more or less impact on user experience than a browser can reasonably infer when assigning an internal priority. This in turn allows the browser to increase or decrease the priority, and potentially load the image earlier or later than it would otherwise.
|
|
28
|
+
*/
|
|
29
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
30
|
+
/**
|
|
31
|
+
* The intrinsic height of the image, in pixels. Must be an integer without a unit.
|
|
32
|
+
*/
|
|
33
|
+
height?: Numeric;
|
|
34
|
+
/**
|
|
35
|
+
* This Boolean attribute indicates that the image is part of a server-side map. If so, the coordinates where the user clicked on the image are sent to the server.
|
|
36
|
+
*/
|
|
37
|
+
ismap?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates how the browser should load the image: Loads the image immediately, regardless of whether or not the image is currently within the visible viewport (this is the default value). Defers loading the image until it reaches a calculated distance from the viewport, as defined by the browser. The intent is to avoid the network and storage bandwidth needed to handle the image until it's reasonably certain that it will be needed. This generally improves the performance of the content in most typical use cases. While explicit `width` and `height` attributes are recommended for all images to avoid layout shift, they are especially important for lazy-loaded ones. Lazy-loaded images will never be loaded if they do not intersect a visible part of an element, even if loading them would change that, because unloaded images have a `width` and `height` of `0`. It creates an even more disruptive user experience when the content visible in the viewport reflows in the middle of reading it. The load event is fired after eager-loaded images have been fetched and processed, but before lazy-laded ones are, even if the lazy-loaded images are located within the visual viewport immediately upon initial page load. These images are still loaded as soon as layout completes; they just don't affect the timing of the `load` event. That means that when `load` fires, it's possible that any lazy-loaded images located in the visual viewport may not yet be visible. Loading is only deferred when JavaScript is enabled. This is an anti-tracking measure, because if a user agent supported lazy loading when scripting is disabled, it would still be possible for a site to track a user's approximate scroll position throughout a session, by strategically placing images in a page's markup such that a server can track how many images are requested and when.
|
|
40
|
+
*
|
|
41
|
+
* Possible values:
|
|
42
|
+
* - eager
|
|
43
|
+
* - lazy
|
|
44
|
+
*/
|
|
45
|
+
loading?: 'eager' | 'lazy';
|
|
46
|
+
/**
|
|
47
|
+
* A string indicating which referrer to use when fetching the resource:
|
|
48
|
+
*
|
|
49
|
+
* Possible values:
|
|
50
|
+
* - no-referrer
|
|
51
|
+
* - no-referrer-when-downgrade
|
|
52
|
+
* - origin
|
|
53
|
+
* - origin-when-cross-origin
|
|
54
|
+
* - same-origin
|
|
55
|
+
* - strict-origin
|
|
56
|
+
* - strict-origin-when-cross-origin
|
|
57
|
+
* - unsafe-url
|
|
58
|
+
*/
|
|
59
|
+
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
|
|
60
|
+
/**
|
|
61
|
+
* One or more values separated by commas, which can be source sizes or the `auto` keyword. The spec requires that the `sizes` attribute to only be present when `srcset` uses width descriptors. A **source size** consists of: 1. A media condition, omitted for the last item in the list. 2. A source size value. Media conditions describe properties of the _viewport_, not the _image_. For example, `(height <= 500px) 1000px` proposes using an image source of 1000px width if the _viewport_ height is 500px or less. Because a source size descriptor specifies the width to use for the image during layout, the media condition is typically (but not necessarily) based on the @media/width. Source size values specify the intended display size of the image. User agents use the current source size to select one of the sources supplied by the `srcset` attribute, when those sources are described using width (`w`) descriptors. The selected source size affects the intrinsic size of the image (the image's display size if no CSS styling is applied). A source size value can be any non-negative length. It must not use CSS functions other than the math functions. Units are interpreted in the same way as media queries, meaning that all relative length units are relative to the document root rather than the `<img ` element. For example, an `em` value is relative to the root font size, not the font size of the image. Percentage values are not allowed. If the `sizes` attribute is not provided, it has a default value of `100vw` (the viewport width). The `auto` keyword can replace the whole list of sizes or the first entry in the list. It is only valid when combined with `loading="lazy"`, and resolves to the concrete size of the image. Since the intrinsic size of the image is not yet known, `width` and `height` attributes (or CSS equivalents) should also be specified to prevent the browser from assuming the default image width of 300px. For better backward compatibility with browsers that do not support `auto`, you can include fallback sizes after `auto` in the `sizes` attribute:
|
|
62
|
+
*/
|
|
63
|
+
sizes?: string;
|
|
64
|
+
/**
|
|
65
|
+
* One or more strings separated by commas, indicating possible image sources for the user agent to use. Each string is composed of: 1. A URL to an image 2. Optionally, whitespace followed by one of: If no descriptor is specified, the source is assigned the default descriptor of `1x`. It is incorrect to mix width descriptors and pixel density descriptors in the same `srcset` attribute. Duplicate descriptors (for instance, two sources in the same `srcset` which are both described with `2x`) are also invalid. Space characters, other than the whitespace separating the URL and the corresponding condition descriptor, are ignored; this includes both leading and trailing space, as well as space before or after each comma. However, if an image candidate string contains no descriptors and no whitespace after the URL, the following image candidate string, if there is one, must begin with one or more whitespace, or the comma will be considered part of the URL. When the `<img ` element's `srcset` uses `x` descriptors, browsers also consider the URL in the `src` attribute (if present) as a candidate, and assign it a default descriptor of `1x`. On the other hand, if the `srcset` attribute uses width descriptors, `src` is not considered, and the `sizes` attribute is used instead. The user agent selects any of the available sources at its discretion. This provides them with significant leeway to tailor their selection based on things like user preferences or bandwidth conditions. See our Responsive images tutorial for an example.
|
|
66
|
+
*/
|
|
67
|
+
srcset?: string;
|
|
68
|
+
/**
|
|
69
|
+
* The image URL. At least one of `src` and `srcset` is required for an `<img ` element. If `srcset` is specified, `src` is used in one of two ways:
|
|
70
|
+
*/
|
|
71
|
+
src?: string;
|
|
72
|
+
/**
|
|
73
|
+
* The intrinsic width of the image in pixels. Must be an integer without a unit.
|
|
74
|
+
*/
|
|
75
|
+
width?: Numeric;
|
|
76
|
+
/**
|
|
77
|
+
* The partial URL (starting with `#`) of an image map associated with the element.
|
|
78
|
+
*/
|
|
79
|
+
usemap?: string;
|
|
80
|
+
/**
|
|
81
|
+
* Equivalent to `vertical-align: top` or `vertical-align: text-top` Equivalent to `vertical-align: -moz-middle-with-baseline` The default, equivalent to `vertical-align: unset` or `vertical-align: initial` Equivalent to `float: left` Equivalent to `float: right`
|
|
82
|
+
*
|
|
83
|
+
* Possible values:
|
|
84
|
+
* - middle
|
|
85
|
+
* - bottom
|
|
86
|
+
* - left
|
|
87
|
+
* - right
|
|
88
|
+
*/
|
|
89
|
+
top?: 'middle' | 'bottom' | 'left' | 'right';
|
|
90
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
export type { AAttributes } from './a';
|
|
2
|
+
export type { AbbrAttributes } from './abbr';
|
|
3
|
+
export type { AddressAttributes } from './address';
|
|
4
|
+
export type { AreaAttributes } from './area';
|
|
5
|
+
export type { ArticleAttributes } from './article';
|
|
6
|
+
export type { AsideAttributes } from './aside';
|
|
7
|
+
export type { AudioAttributes } from './audio';
|
|
8
|
+
export type { BAttributes } from './b';
|
|
9
|
+
export type { BaseAttributes } from './base';
|
|
10
|
+
export type { BdiAttributes } from './bdi';
|
|
11
|
+
export type { BdoAttributes } from './bdo';
|
|
12
|
+
export type { BlockquoteAttributes } from './blockquote';
|
|
13
|
+
export type { BodyAttributes } from './body';
|
|
14
|
+
export type { BrAttributes } from './br';
|
|
15
|
+
export type { ButtonAttributes } from './button';
|
|
16
|
+
export type { CanvasAttributes } from './canvas';
|
|
17
|
+
export type { CaptionAttributes } from './caption';
|
|
18
|
+
export type { CiteAttributes } from './cite';
|
|
19
|
+
export type { CodeAttributes } from './code';
|
|
20
|
+
export type { ColAttributes } from './col';
|
|
21
|
+
export type { ColgroupAttributes } from './colgroup';
|
|
22
|
+
export type { DataAttributes } from './data';
|
|
23
|
+
export type { DatalistAttributes } from './datalist';
|
|
24
|
+
export type { DdAttributes } from './dd';
|
|
25
|
+
export type { DelAttributes } from './del';
|
|
26
|
+
export type { DetailsAttributes } from './details';
|
|
27
|
+
export type { DfnAttributes } from './dfn';
|
|
28
|
+
export type { DialogAttributes } from './dialog';
|
|
29
|
+
export type { DivAttributes } from './div';
|
|
30
|
+
export type { DlAttributes } from './dl';
|
|
31
|
+
export type { DtAttributes } from './dt';
|
|
32
|
+
export type { EmAttributes } from './em';
|
|
33
|
+
export type { EmbedAttributes } from './embed';
|
|
34
|
+
export type { FencedframeAttributes } from './fencedframe';
|
|
35
|
+
export type { FieldsetAttributes } from './fieldset';
|
|
36
|
+
export type { FigcaptionAttributes } from './figcaption';
|
|
37
|
+
export type { FigureAttributes } from './figure';
|
|
38
|
+
export type { FooterAttributes } from './footer';
|
|
39
|
+
export type { FormAttributes } from './form';
|
|
40
|
+
export type { H1Attributes } from './h1';
|
|
41
|
+
export type { H2Attributes } from './h2';
|
|
42
|
+
export type { H3Attributes } from './h3';
|
|
43
|
+
export type { H4Attributes } from './h4';
|
|
44
|
+
export type { H5Attributes } from './h5';
|
|
45
|
+
export type { H6Attributes } from './h6';
|
|
46
|
+
export type { HeadAttributes } from './head';
|
|
47
|
+
export type { HeaderAttributes } from './header';
|
|
48
|
+
export type { HgroupAttributes } from './hgroup';
|
|
49
|
+
export type { HrAttributes } from './hr';
|
|
50
|
+
export type { HtmlAttributes } from './html';
|
|
51
|
+
export type { IAttributes } from './i';
|
|
52
|
+
export type { IframeAttributes } from './iframe';
|
|
53
|
+
export type { ImgAttributes } from './img';
|
|
54
|
+
export type { InputAttributes } from './input';
|
|
55
|
+
export type { InsAttributes } from './ins';
|
|
56
|
+
export type { KbdAttributes } from './kbd';
|
|
57
|
+
export type { LabelAttributes } from './label';
|
|
58
|
+
export type { LegendAttributes } from './legend';
|
|
59
|
+
export type { LiAttributes } from './li';
|
|
60
|
+
export type { LinkAttributes } from './link';
|
|
61
|
+
export type { MainAttributes } from './main';
|
|
62
|
+
export type { MapAttributes } from './map';
|
|
63
|
+
export type { MarkAttributes } from './mark';
|
|
64
|
+
export type { MenuAttributes } from './menu';
|
|
65
|
+
export type { MetaAttributes } from './meta';
|
|
66
|
+
export type { MeterAttributes } from './meter';
|
|
67
|
+
export type { NavAttributes } from './nav';
|
|
68
|
+
export type { NoscriptAttributes } from './noscript';
|
|
69
|
+
export type { ObjectAttributes } from './object';
|
|
70
|
+
export type { OlAttributes } from './ol';
|
|
71
|
+
export type { OptgroupAttributes } from './optgroup';
|
|
72
|
+
export type { OptionAttributes } from './option';
|
|
73
|
+
export type { OutputAttributes } from './output';
|
|
74
|
+
export type { PAttributes } from './p';
|
|
75
|
+
export type { PictureAttributes } from './picture';
|
|
76
|
+
export type { PreAttributes } from './pre';
|
|
77
|
+
export type { ProgressAttributes } from './progress';
|
|
78
|
+
export type { QAttributes } from './q';
|
|
79
|
+
export type { RpAttributes } from './rp';
|
|
80
|
+
export type { RtAttributes } from './rt';
|
|
81
|
+
export type { RubyAttributes } from './ruby';
|
|
82
|
+
export type { SAttributes } from './s';
|
|
83
|
+
export type { SampAttributes } from './samp';
|
|
84
|
+
export type { ScriptAttributes } from './script';
|
|
85
|
+
export type { SearchAttributes } from './search';
|
|
86
|
+
export type { SectionAttributes } from './section';
|
|
87
|
+
export type { SelectAttributes } from './select';
|
|
88
|
+
export type { SelectedcontentAttributes } from './selectedcontent';
|
|
89
|
+
export type { SlotAttributes } from './slot';
|
|
90
|
+
export type { SmallAttributes } from './small';
|
|
91
|
+
export type { SourceAttributes } from './source';
|
|
92
|
+
export type { SpanAttributes } from './span';
|
|
93
|
+
export type { StrongAttributes } from './strong';
|
|
94
|
+
export type { StyleAttributes } from './style';
|
|
95
|
+
export type { SubAttributes } from './sub';
|
|
96
|
+
export type { SummaryAttributes } from './summary';
|
|
97
|
+
export type { SupAttributes } from './sup';
|
|
98
|
+
export type { TableAttributes } from './table';
|
|
99
|
+
export type { TbodyAttributes } from './tbody';
|
|
100
|
+
export type { TdAttributes } from './td';
|
|
101
|
+
export type { TemplateAttributes } from './template';
|
|
102
|
+
export type { TextareaAttributes } from './textarea';
|
|
103
|
+
export type { TfootAttributes } from './tfoot';
|
|
104
|
+
export type { ThAttributes } from './th';
|
|
105
|
+
export type { TheadAttributes } from './thead';
|
|
106
|
+
export type { TimeAttributes } from './time';
|
|
107
|
+
export type { TitleAttributes } from './title';
|
|
108
|
+
export type { TrAttributes } from './tr';
|
|
109
|
+
export type { TrackAttributes } from './track';
|
|
110
|
+
export type { UAttributes } from './u';
|
|
111
|
+
export type { UlAttributes } from './ul';
|
|
112
|
+
export type { VarAttributes } from './var';
|
|
113
|
+
export type { VideoAttributes } from './video';
|
|
114
|
+
export type { WbrAttributes } from './wbr';
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
import type { Numeric } from '../attributes/StandardGlobalAttributes';
|
|
4
|
+
/**
|
|
5
|
+
* A union of all possible 'type' attribute values for the <input> element.
|
|
6
|
+
*/
|
|
7
|
+
export type InputType = 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
8
|
+
/**
|
|
9
|
+
* Type definition for the attributes of the HTML <input> element, excluding global attributes.
|
|
10
|
+
* The <input> element is used to create interactive controls for web-based forms to accept data from the user.
|
|
11
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input
|
|
12
|
+
*/
|
|
13
|
+
export interface InputAttributes extends CommonAttributes<ElementForTag<'input'>> {
|
|
14
|
+
/**
|
|
15
|
+
* The **`accept`** attribute takes as its value a comma-separated list of one or more file types, or unique file type specifiers, describing which file types to allow.
|
|
16
|
+
*/
|
|
17
|
+
accept?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Valid for the `image` button only, the `alt` attribute provides alternative text for the image, displaying the value of the attribute if the image `src` is missing or otherwise fails to load. See the image input type.
|
|
20
|
+
*/
|
|
21
|
+
alt?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Controls whether the browser may automatically complete the value and provides guidance about the type of information expected in the field.
|
|
24
|
+
*
|
|
25
|
+
* Possible values:
|
|
26
|
+
* - off
|
|
27
|
+
* - on
|
|
28
|
+
*/
|
|
29
|
+
autocomplete?: 'on' | 'off' | string;
|
|
30
|
+
/**
|
|
31
|
+
* The **`capture`** attribute specifies that, optionally, a new file should be captured, and which device should be used to capture that new media of a type defined by the `accept` attribute.
|
|
32
|
+
*/
|
|
33
|
+
capture?: boolean | 'user' | 'environment';
|
|
34
|
+
/**
|
|
35
|
+
* Valid for both `radio` and `checkbox` types, `checked` is a Boolean attribute. If present on a `radio` type, it indicates that the radio button is the currently selected one in the group of same-named radio buttons. If present on a `checkbox` type, it indicates that the checkbox is checked by default (when the page loads). It does _not_ indicate whether this checkbox is currently checked: if the checkbox's state is changed, this content attribute does not reflect the change. (Only the `HTMLInputElement`'s `checked` IDL attribute is updated.)
|
|
36
|
+
*/
|
|
37
|
+
checked?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The **`dirname`** attribute can be used on the textarea element and several input types and describes the directionality of the element's text content during form submission. The browser uses this attribute's value to determine whether text the user has entered is left-to-right or right-to-left oriented. When used, the element's text directionality value is included in form submission data along with the `dirname` attribute's value as the name of the field.
|
|
40
|
+
*/
|
|
41
|
+
dirname?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The Boolean **`disabled`** attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants.
|
|
44
|
+
*/
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* The `form` HTML attribute associates a form-associated element with a form element within the same document. This attribute applies to the button, fieldset, input, object, output, select, and textarea elements.
|
|
48
|
+
*/
|
|
49
|
+
form?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Valid for the `image` and `submit` input types only. See the submit input type for more information.
|
|
52
|
+
*/
|
|
53
|
+
formaction?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Valid for the `image` and `submit` input types only. See the submit input type for more information.
|
|
56
|
+
*/
|
|
57
|
+
formenctype?: 'application/x-www-form-urlencoded' | 'multipart/form-data' | 'text/plain';
|
|
58
|
+
/**
|
|
59
|
+
* Valid for the `image` and `submit` input types only. See the submit input type for more information.
|
|
60
|
+
*/
|
|
61
|
+
formmethod?: 'get' | 'post';
|
|
62
|
+
/**
|
|
63
|
+
* Valid for the `image` and `submit` input types only. See the submit input type for more information.
|
|
64
|
+
*/
|
|
65
|
+
formnovalidate?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Valid for the `image` and `submit` input types only. See the submit input type for more information.
|
|
68
|
+
*/
|
|
69
|
+
formtarget?: string;
|
|
70
|
+
/**
|
|
71
|
+
* Valid for the `image` input button only, the `height` is the height of the image file to display to represent the graphical submit button. See the image input type.
|
|
72
|
+
*/
|
|
73
|
+
height?: Numeric;
|
|
74
|
+
/**
|
|
75
|
+
* The value given to the `list` attribute should be the id of a datalist element located in the same document. The `<datalist ` provides a list of predefined values to suggest to the user for this input. Any values in the list that are not compatible with the `type` are not included in the suggested options. The values provided are suggestions, not requirements: users can select from this predefined list or provide a different value. It is valid on `text`, `search`, `url`, `tel`, `email`, `date`, `month`, `week`, `time`, `datetime-local`, `number`, `range`, and `color`. Per the specifications, the `list` attribute is not supported by the `hidden`, `password`, `checkbox`, `radio`, `file`, or any of the button types. Depending on the browser, the user may see a custom color palette suggested, tic marks along a range, or even an input that opens like a select but allows for non-listed values. Check out the browser compatibility table for the other input types. See the datalist element.
|
|
76
|
+
*/
|
|
77
|
+
list?: string;
|
|
78
|
+
/**
|
|
79
|
+
* The **`max`** attribute defines the maximum value that is acceptable and valid for the input containing the attribute. If the `value` of the element is greater than this, the element fails validation. This value must be greater than or equal to the value of the `min` attribute. If the `max` attribute is present but is not specified or is invalid, no `max` value is applied. If the `max` attribute is valid and a non-empty value is greater than the maximum allowed by the `max` attribute, constraint validation will prevent form submission.
|
|
80
|
+
*/
|
|
81
|
+
max?: string | Numeric;
|
|
82
|
+
/**
|
|
83
|
+
* The **`maxlength`** attribute defines the maximum string length that the user can enter into an input or textarea. The attribute must have an integer value of 0 or higher.
|
|
84
|
+
*/
|
|
85
|
+
maxlength?: Numeric;
|
|
86
|
+
/**
|
|
87
|
+
* The **`min`** attribute defines the minimum value that is acceptable and valid for the input containing the attribute. If the `value` of the element is less than this, the element fails validation. This value must be less than or equal to the value of the `max` attribute.
|
|
88
|
+
*/
|
|
89
|
+
min?: string | Numeric;
|
|
90
|
+
/**
|
|
91
|
+
* The **`minlength`** attribute defines the minimum string length that the user can enter into an input or textarea. The attribute must have an integer value of 0 or higher.
|
|
92
|
+
*/
|
|
93
|
+
minlength?: Numeric;
|
|
94
|
+
/**
|
|
95
|
+
* The Boolean **`multiple`** attribute, if set, means the form control accepts one or more values. The attribute is valid for the email and file input types and the select. The manner by which the user opts for multiple values depends on the form control.
|
|
96
|
+
*/
|
|
97
|
+
multiple?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* A string specifying a name for the input control. This name is submitted along with the control's value when the form data is submitted. Consider the `name` a required attribute (even though it's not). If an input has no `name` specified, or `name` is empty, the input's value is not submitted with the form! (Disabled controls, unchecked radio buttons, unchecked checkboxes, and reset buttons are also not sent.) There are two special cases: 1. `_charset_` : If used as the name of an `<input ` element of type hidden, the input's `value` is automatically set by the user agent to the character encoding being used to submit the form. 2. `isindex`: For historical reasons, the name `isindex` is not allowed. The `name` attribute creates a unique behavior for radio buttons. Only one radio button in a same-named group of radio buttons can be checked at a time. Selecting any radio button in that group automatically deselects any currently-selected radio button in the same group. The value of that one checked radio button is sent along with the name if the form is submitted, When tabbing into a series of same-named group of radio buttons, if one is checked, that one will receive focus. If they aren't grouped together in source order, if one of the group is checked, tabbing into the group starts when the first one in the group is encountered, skipping all those that aren't checked. In other words, if one is checked, tabbing skips the unchecked radio buttons in the group. If none are checked, the radio button group receives focus when the first button in the same name group is reached. Once one of the radio buttons in a group has focus, using the arrow keys will navigate through all the radio buttons of the same name, even if the radio buttons are not grouped together in the source order. When an input element is given a `name`, that name becomes a property of the owning form element's HTMLFormElement.elements property. If you have an input whose `name` is set to `guest` and another whose `name` is `hat-size`, the following code can be used:
|
|
100
|
+
*/
|
|
101
|
+
name?: string;
|
|
102
|
+
/**
|
|
103
|
+
* The **`pattern`** attribute specifies a regular expression the form control's value should match. If a non-`null` value doesn't conform to the constraints set by the `pattern` value, the ValidityState object's read-only patternMismatch property will be true.
|
|
104
|
+
*/
|
|
105
|
+
pattern?: string;
|
|
106
|
+
/**
|
|
107
|
+
* The **`placeholder`** attribute defines the text displayed in a form control when the control has no value. The placeholder text should provide a brief hint to the user as to the expected type of data that should be entered into the control.
|
|
108
|
+
*/
|
|
109
|
+
placeholder?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Turns an `<input type="button" ` element into a popover control button; takes the ID of the popover element to control as its value. See the Popover API landing page for more details. Establishing a relationship between a popover and its invoker button using the `popovertarget` attribute has two additional useful effects:
|
|
112
|
+
*/
|
|
113
|
+
popovertarget?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Specifies the action to be performed on a popover element being controlled by a control `<input type="button" `. Possible values are: The button will hide a shown popover. If you try to hide an already hidden popover, no action will be taken. The button will show a hidden popover. If you try to show an already showing popover, no action will be taken. The button will toggle a popover between showing and hidden. If the popover is hidden, it will be shown; if the popover is showing, it will be hidden. If `popovertargetaction` is omitted, `"toggle"` is the default action that will be performed by the control button.
|
|
116
|
+
*
|
|
117
|
+
* Possible values:
|
|
118
|
+
* - hide
|
|
119
|
+
* - show
|
|
120
|
+
* - toggle
|
|
121
|
+
*/
|
|
122
|
+
popovertargetaction?: 'hide' | 'show' | 'toggle';
|
|
123
|
+
/**
|
|
124
|
+
* The Boolean **`readonly`** attribute, when present, makes the element not mutable, meaning the user can not edit the control.
|
|
125
|
+
*/
|
|
126
|
+
readonly?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* The Boolean **`required`** attribute, if present, indicates that the user must specify a value for the input before the owning form can be submitted.
|
|
129
|
+
*/
|
|
130
|
+
required?: boolean;
|
|
131
|
+
/**
|
|
132
|
+
* The **`size`** attribute defines the width of the input and the height of the select element. For an `input` element, it defines the number of characters that the user agent allows the user to see when editing the value. For a `select` element, it defines the number of options that should be shown to the user. This must be a valid non-negative integer greater than zero.
|
|
133
|
+
*/
|
|
134
|
+
size?: Numeric;
|
|
135
|
+
/**
|
|
136
|
+
* Valid for the `image` input button only, the `src` is string specifying the URL of the image file to display to represent the graphical submit button. See the image input type.
|
|
137
|
+
*/
|
|
138
|
+
src?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The **`step`** attribute is a number that specifies the granularity that the value must adhere to or the keyword `any`. It is valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types.
|
|
141
|
+
*/
|
|
142
|
+
step?: Numeric | 'any';
|
|
143
|
+
/**
|
|
144
|
+
* A string specifying the type of control to render. For example, to create a checkbox, a value of `checkbox` is used. If omitted (or an unknown value is specified), the input type `text` is used, creating a plaintext input field. Permitted values are listed in Input types above.
|
|
145
|
+
*/
|
|
146
|
+
type?: InputType;
|
|
147
|
+
/**
|
|
148
|
+
* The input control's value. When specified in the HTML, this is the initial value, and from then on it can be altered or retrieved at any time using JavaScript to access the respective HTMLInputElement object's `value` property. The `value` attribute is always optional, though should be considered mandatory for `checkbox`, `radio`, and `hidden`.
|
|
149
|
+
*/
|
|
150
|
+
value?: string | Numeric;
|
|
151
|
+
/**
|
|
152
|
+
* Valid for the `image` input button only, the `width` is the width of the image file to display to represent the graphical submit button. See the image input type.
|
|
153
|
+
*/
|
|
154
|
+
width?: Numeric;
|
|
155
|
+
/**
|
|
156
|
+
* The Boolean attribute `incremental` is a WebKit and Blink extension (so supported by Safari, Opera, Chrome, etc.) which, if present, tells the user agent to process the input as a live search. As the user edits the value of the field, the user agent sends search events to the HTMLInputElement object representing the search box. This allows your code to update the search results in real time as the user edits the search. If `incremental` is not specified, the search event is only sent when the user explicitly initiates a search (such as by pressing the <kbd Enter</kbd or <kbd Return</kbd key while editing the field). The `search` event is rate-limited so that it is not sent more frequently than an implementation-defined interval.
|
|
157
|
+
* @experimental
|
|
158
|
+
*/
|
|
159
|
+
incremental?: boolean;
|
|
160
|
+
/**
|
|
161
|
+
* Similar to the -moz-orient non-standard CSS property impacting the progress and meter elements, the `orient` attribute defines the orientation of the range slider. Values include `horizontal`, meaning the range is rendered horizontally, and `vertical`, where the range is rendered vertically. See Creating vertical form controls for a modern approach to creating vertical form controls.
|
|
162
|
+
* @experimental
|
|
163
|
+
*/
|
|
164
|
+
orient?: 'horizontal' | 'vertical';
|
|
165
|
+
/**
|
|
166
|
+
* The `results` attribute-supported only by Safari-is a numeric value that lets you override the maximum number of entries to be displayed in the `<input ` element's natively-provided drop-down menu of previous search queries. The value must be a non-negative decimal number. If not provided, or an invalid value is given, the browser's default maximum number of entries is used.
|
|
167
|
+
* @experimental
|
|
168
|
+
*/
|
|
169
|
+
results?: Numeric;
|
|
170
|
+
/**
|
|
171
|
+
* The Boolean `webkitdirectory` attribute, if present, indicates that only directories should be available to be selected by the user in the file picker interface. See HTMLInputElement.webkitdirectory for additional details and examples. Though originally implemented only for WebKit-based browsers, `webkitdirectory` is also usable in Microsoft Edge as well as Firefox 50 and later. However, even though it has relatively broad support, it is still not standard and should not be used unless you have no alternative.
|
|
172
|
+
* @experimental
|
|
173
|
+
*/
|
|
174
|
+
webkitdirectory?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Valid for the `color` input type only, the `alpha` attribute provides the end user with the ability to set the opacity of the color being selected.
|
|
177
|
+
* @experimental
|
|
178
|
+
*/
|
|
179
|
+
alpha?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* Valid for the `color` input type only, the `colorspace` attribute specifies the color space that is used by the `type="color"` input. Possible enumerated values are:
|
|
182
|
+
*
|
|
183
|
+
* Possible values:
|
|
184
|
+
* - limited-srgb
|
|
185
|
+
* - display-p3
|
|
186
|
+
* @experimental
|
|
187
|
+
*/
|
|
188
|
+
colorspace?: 'limited-srgb' | 'display-p3';
|
|
189
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
export interface InsAttributes extends CommonAttributes<ElementForTag<'ins'>> {
|
|
4
|
+
/**
|
|
5
|
+
* This attribute defines the URI of a resource that explains the change, such as a link to meeting minutes or a ticket in a troubleshooting system.
|
|
6
|
+
*/
|
|
7
|
+
cite?: string;
|
|
8
|
+
/**
|
|
9
|
+
* This attribute indicates the time and date of the change and must be a valid date with an optional time string. If the value cannot be parsed as a date with an optional time string, the element does not have an associated timestamp. For the format of the string without a time, see Format of a valid date string. The format of the string if it includes both date and time is covered in Format of a valid local date and time string.
|
|
10
|
+
*/
|
|
11
|
+
datetime?: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
export interface LabelAttributes extends CommonAttributes<ElementForTag<'label'>> {
|
|
4
|
+
/**
|
|
5
|
+
* The **`for`** attribute is an allowed attribute for label and output. When used on a `<label ` element it indicates the form element that this label describes. When used on an `<output ` element it allows for an explicit relationship between the elements that represent values which are used in the output.
|
|
6
|
+
*/
|
|
7
|
+
for?: string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
import type { Numeric } from '../attributes/StandardGlobalAttributes';
|
|
4
|
+
export interface LiAttributes extends CommonAttributes<ElementForTag<'li'>> {
|
|
5
|
+
/**
|
|
6
|
+
* This integer attribute indicates the current ordinal value of the list item as defined by the ol element. The only allowed value for this attribute is a number, even if the list is displayed with Roman numerals or letters. List items that follow this one continue numbering from the value set. This attribute has no meaning for unordered lists (ul) or for menus (menu).
|
|
7
|
+
*/
|
|
8
|
+
value?: string | Numeric;
|
|
9
|
+
/**
|
|
10
|
+
* This type overrides the one used by its parent ol element, if any.
|
|
11
|
+
*
|
|
12
|
+
* Possible values:
|
|
13
|
+
* - A
|
|
14
|
+
* - i
|
|
15
|
+
* - I
|
|
16
|
+
* - 1
|
|
17
|
+
*/
|
|
18
|
+
a?: 'A' | 'i' | 'I' | '1';
|
|
19
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { CommonAttributes } from '../attributes/ElementAttributes';
|
|
2
|
+
import type { ElementForTag } from './element-types';
|
|
3
|
+
export interface LinkAttributes extends CommonAttributes<ElementForTag<'link'>> {
|
|
4
|
+
/**
|
|
5
|
+
* This attribute is required when `rel="preload"` has been set on the `<link ` element, optional when `rel="modulepreload"` has been set, and otherwise should not be used. It specifies the type of content being loaded by the `<link `, which is necessary for request matching, application of correct content security policy, and setting of correct Accept request header. Furthermore, `rel="preload"` uses this as a signal for request prioritization. The table below lists the valid values for this attribute and the elements or resources they apply to.
|
|
6
|
+
*/
|
|
7
|
+
as?: string;
|
|
8
|
+
/**
|
|
9
|
+
* This attribute explicitly indicates that certain operations should be blocked until specific conditions are met. It must only be used when the `rel` attribute contains the `expect` or `stylesheet` keywords. With `rel="expect"`, it indicates that operations should be blocked until a specific DOM node has been parsed. With `rel="stylesheet"`, it indicates that operations should be blocked until an external stylesheet and its critical subresources have been fetched and applied to the document. The operations that are to be blocked must be a space-separated list of blocking tokens listed below. Currently there is only one token:
|
|
10
|
+
*
|
|
11
|
+
* Possible values:
|
|
12
|
+
* - render
|
|
13
|
+
*/
|
|
14
|
+
blocking?: 'render';
|
|
15
|
+
/**
|
|
16
|
+
* The **`crossorigin`** attribute, valid on the audio, img, link, script, and video elements, provides support for CORS, defining how the element handles cross-origin requests, thereby enabling the configuration of the CORS requests for the element's fetched data. Depending on the element, the attribute can be a CORS settings attribute.
|
|
17
|
+
*/
|
|
18
|
+
crossorigin?: 'anonymous' | 'use-credentials';
|
|
19
|
+
/**
|
|
20
|
+
* The Boolean **`disabled`** attribute, when present, makes the element not mutable, focusable, or even submitted with the form. The user can neither edit nor focus on the control, nor its form control descendants.
|
|
21
|
+
*/
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* The **`fetchpriority`** attribute allows a developer to signal that fetching a particular image early in the loading process has more or less impact on user experience than a browser can reasonably infer when assigning an internal priority. This in turn allows the browser to increase or decrease the priority, and potentially load the image earlier or later than it would otherwise.
|
|
25
|
+
*/
|
|
26
|
+
fetchpriority?: 'high' | 'low' | 'auto';
|
|
27
|
+
/**
|
|
28
|
+
* This attribute specifies the URL of the linked resource. A URL can be absolute or relative.
|
|
29
|
+
*/
|
|
30
|
+
href?: string;
|
|
31
|
+
/**
|
|
32
|
+
* This attribute indicates the language of the linked resource. It is purely advisory. Values should be valid BCP 47 language tags. Use this attribute only if the `href` attribute is present.
|
|
33
|
+
*/
|
|
34
|
+
hreflang?: string;
|
|
35
|
+
/**
|
|
36
|
+
* For `rel="preload"` and `as="image"` only, the `imagesizes` attribute has similar syntax and semantics as the `sizes` attribute that indicates to preload the appropriate resource used by an `img` element with corresponding values for its `srcset` and `sizes` attributes.
|
|
37
|
+
*/
|
|
38
|
+
imagesizes?: string;
|
|
39
|
+
/**
|
|
40
|
+
* For `rel="preload"` and `as="image"` only, the `imagesrcset` attribute has similar syntax and semantics as the `srcset` attribute that indicates to preload the appropriate resource used by an `img` element with corresponding values for its `srcset` and `sizes` attributes.
|
|
41
|
+
*/
|
|
42
|
+
imagesrcset?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Contains inline metadata - a base64-encoded cryptographic hash of the resource (file) you're telling the browser to fetch. The browser can use this to verify that the fetched resource has been delivered without unexpected manipulation. The attribute must only be specified when the `rel` attribute is specified to `stylesheet`, `preload`, or `modulepreload`. See Subresource Integrity.
|
|
45
|
+
*/
|
|
46
|
+
integrity?: string;
|
|
47
|
+
/**
|
|
48
|
+
* This attribute specifies the media that the linked resource applies to. Its value must be a media type / media query. This attribute is mainly useful when linking to external stylesheets - it allows the user agent to pick the best adapted one for the device it runs on.
|
|
49
|
+
*/
|
|
50
|
+
media?: string;
|
|
51
|
+
/**
|
|
52
|
+
* A string indicating which referrer to use when fetching the resource: This is a user agent's default behavior, if no policy is otherwise specified. This case is unsafe because it can leak origins and paths from TLS-protected resources to insecure origins.
|
|
53
|
+
*
|
|
54
|
+
* Possible values:
|
|
55
|
+
* - no-referrer
|
|
56
|
+
* - no-referrer-when-downgrade
|
|
57
|
+
* - origin
|
|
58
|
+
* - origin-when-cross-origin
|
|
59
|
+
* - unsafe-url
|
|
60
|
+
*/
|
|
61
|
+
referrerpolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'unsafe-url';
|
|
62
|
+
/**
|
|
63
|
+
* The **`rel`** attribute defines the relationship between a linked resource and the current document. Valid on link, a, area, and form, the supported values depend on the element on which the attribute is found.
|
|
64
|
+
*/
|
|
65
|
+
rel?: string;
|
|
66
|
+
/**
|
|
67
|
+
* This attribute defines the sizes of the icons for visual media contained in the resource. It must be present only if the `rel` contains a value of `icon` or a non-standard type such as Apple's `apple-touch-icon`. It may have the following values:
|
|
68
|
+
*
|
|
69
|
+
* Possible values:
|
|
70
|
+
* - any
|
|
71
|
+
*/
|
|
72
|
+
sizes?: 'any';
|
|
73
|
+
/**
|
|
74
|
+
* This attribute is used to define the type of the content linked to. The value of the attribute should be a MIME type such as **text/html**, **text/css**, and so on. The common use of this attribute is to define the type of stylesheet being referenced (such as **text/css**), but given that CSS is the only stylesheet language used on the web, not only is it possible to omit the `type` attribute, but is actually now recommended practice. It is also used on `rel="preload"` link types, to make sure the browser only downloads file types that it supports.
|
|
75
|
+
*/
|
|
76
|
+
type?: string;
|
|
77
|
+
}
|