Skip to content

Commit

Permalink
Add input element support (#9)
Browse files Browse the repository at this point in the history
* wip

* add types of input element interfaces

* add value property to input element props

* element prop attributes: add `[at]see` jsdoc tag

* remove base input element type

* update InputElementType, props interface
  • Loading branch information
EthanThatOneKid authored Nov 4, 2024
1 parent 1b0f7d9 commit aaa7c3a
Show file tree
Hide file tree
Showing 69 changed files with 1,323 additions and 376 deletions.
46 changes: 38 additions & 8 deletions a.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,49 +13,79 @@ import { renderElement } from "./lib/mod.ts";
export interface AElementProps extends GlobalAttributes {
/**
* `attributionsrc` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#attributionsrc>
* @experimental
*/
attributionsrc?: string | undefined;
/**
* `charset` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#charset>
* @deprecated
*/
charset?: string | undefined;
/**
* `coords` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#coords>
* @deprecated
*/
coords?: string | undefined;
/** `download` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `download` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#download>
*/
download?: string | undefined;
/** `href` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `href` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#href>
*/
href?: string | undefined;
/** `hreflang` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `hreflang` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#hreflang>
*/
hreflang?: string | undefined;
/**
* `name` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#name>
* @deprecated
*/
name?: string | undefined;
/** `ping` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `ping` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#ping>
*/
ping?: string | undefined;
/** `referrerpolicy` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `referrerpolicy` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#referrerpolicy>
*/
referrerpolicy?: string | undefined;
/** `rel` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `rel` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#rel>
*/
rel?: string | undefined;
/**
* `rev` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#rev>
* @deprecated
*/
rev?: string | undefined;
/**
* `shape` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#shape>
* @deprecated
*/
shape?: string | undefined;
/** `target` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `target` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#target>
*/
target?: string | undefined;
/** `type` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element. */
/**
* `type` is an attribute of the [`a`](https://developer.mozilla.org/docs/Web/HTML/Element/a) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/a#type>
*/
type?: string | undefined;
}

Expand Down
47 changes: 38 additions & 9 deletions area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,62 @@ import { renderElement } from "./lib/mod.ts";
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area>
*/
export interface AreaElementProps extends GlobalAttributes {
/** `alt` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `alt` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#alt>
*/
alt?: string | undefined;
/** `coords` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `coords` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#coords>
*/
coords?: string | undefined;
/** `download` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `download` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#download>
*/
download?: string | undefined;
/** `href` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `href` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#href>
*/
href?: string | undefined;
/**
* `nohref` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#nohref>
* @deprecated
*/
nohref?: string | undefined;
/** `ping` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `ping` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#ping>
*/
ping?: string | undefined;
/** `referrerpolicy` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `referrerpolicy` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#referrerpolicy>
*/
referrerpolicy?: string | undefined;
/** `rel` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `rel` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#rel>
*/
rel?: string | undefined;
/** `shape` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `shape` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#shape>
*/
shape?: string | undefined;
/**
* `tabindex` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#tabindex>
* @deprecated
*/
tabindex?: string | undefined;
/** `target` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element. */
/**
* `target` is an attribute of the [`area`](https://developer.mozilla.org/docs/Web/HTML/Element/area) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/area#target>
*/
target?: string | undefined;
}

Expand Down
45 changes: 36 additions & 9 deletions audio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,50 @@ import { renderElement } from "./lib/mod.ts";
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio>
*/
export interface AudioElementProps extends GlobalAttributes {
/** `autoplay` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `autoplay` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#autoplay>
*/
autoplay?: string | undefined;
/** `controls` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `controls` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#controls>
*/
controls?: string | undefined;
/** `controlslist` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `controlslist` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#controlslist>
*/
controlslist?: string | undefined;
/** `crossorigin` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `crossorigin` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#crossorigin>
*/
crossorigin?: string | undefined;
/** `disableremoteplayback` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `disableremoteplayback` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#disableremoteplayback>
*/
disableremoteplayback?: string | undefined;
/** `loop` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `loop` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#loop>
*/
loop?: string | undefined;
/** `muted` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `muted` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#muted>
*/
muted?: string | undefined;
/** `preload` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `preload` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#preload>
*/
preload?: string | undefined;
/** `src` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element. */
/**
* `src` is an attribute of the [`audio`](https://developer.mozilla.org/docs/Web/HTML/Element/audio) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/audio#src>
*/
src?: string | undefined;
}

Expand Down
10 changes: 8 additions & 2 deletions base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ import { renderElement } from "./lib/mod.ts";
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/base>
*/
export interface BaseElementProps extends GlobalAttributes {
/** `href` is an attribute of the [`base`](https://developer.mozilla.org/docs/Web/HTML/Element/base) element. */
/**
* `href` is an attribute of the [`base`](https://developer.mozilla.org/docs/Web/HTML/Element/base) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/base#href>
*/
href?: string | undefined;
/** `target` is an attribute of the [`base`](https://developer.mozilla.org/docs/Web/HTML/Element/base) element. */
/**
* `target` is an attribute of the [`base`](https://developer.mozilla.org/docs/Web/HTML/Element/base) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/base#target>
*/
target?: string | undefined;
}

Expand Down
5 changes: 4 additions & 1 deletion blockquote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ import { renderElement } from "./lib/mod.ts";
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/blockquote>
*/
export interface BlockquoteElementProps extends GlobalAttributes {
/** `cite` is an attribute of the [`blockquote`](https://developer.mozilla.org/docs/Web/HTML/Element/blockquote) element. */
/**
* `cite` is an attribute of the [`blockquote`](https://developer.mozilla.org/docs/Web/HTML/Element/blockquote) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/blockquote#cite>
*/
cite?: string | undefined;
}

Expand Down
10 changes: 10 additions & 0 deletions body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,51 +13,61 @@ import { renderElement } from "./lib/mod.ts";
export interface BodyElementProps extends GlobalAttributes {
/**
* `alink` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#alink>
* @deprecated
*/
alink?: string | undefined;
/**
* `background` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#background>
* @deprecated
*/
background?: string | undefined;
/**
* `bgcolor` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#bgcolor>
* @deprecated
*/
bgcolor?: string | undefined;
/**
* `bottommargin` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#bottommargin>
* @deprecated
*/
bottommargin?: string | undefined;
/**
* `leftmargin` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#leftmargin>
* @deprecated
*/
leftmargin?: string | undefined;
/**
* `link` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#link>
* @deprecated
*/
link?: string | undefined;
/**
* `rightmargin` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#rightmargin>
* @deprecated
*/
rightmargin?: string | undefined;
/**
* `text` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#text>
* @deprecated
*/
text?: string | undefined;
/**
* `topmargin` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#topmargin>
* @deprecated
*/
topmargin?: string | undefined;
/**
* `vlink` is an attribute of the [`body`](https://developer.mozilla.org/docs/Web/HTML/Element/body) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/body#vlink>
* @deprecated
*/
vlink?: string | undefined;
Expand Down
1 change: 1 addition & 0 deletions br.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { renderElement } from "./lib/mod.ts";
export interface BrElementProps extends GlobalAttributes {
/**
* `clear` is an attribute of the [`br`](https://developer.mozilla.org/docs/Web/HTML/Element/br) element.
* @see <https://developer.mozilla.org/docs/Web/HTML/Element/br#clear>
* @deprecated
*/
clear?: string | undefined;
Expand Down
Loading

0 comments on commit aaa7c3a

Please sign in to comment.