Skip to content

Commit 41ab76a

Browse files
committed
chore: Convert InputType to JavaScript object
1 parent 2b46e44 commit 41ab76a

File tree

1 file changed

+29
-23
lines changed
  • packages/browser-utils/src/types/html

1 file changed

+29
-23
lines changed

packages/browser-utils/src/types/html/index.ts

+29-23
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,32 @@
22
* Valid input types according to the HTML specification.
33
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types}
44
*/
5-
export type InputType =
6-
| 'button'
7-
| 'checkbox'
8-
| 'color'
9-
| 'date'
10-
| 'datetime-local'
11-
| 'email'
12-
| 'file'
13-
| 'hidden'
14-
| 'image'
15-
| 'month'
16-
| 'number'
17-
| 'password'
18-
| 'radio'
19-
| 'range'
20-
| 'reset'
21-
| 'search'
22-
| 'submit'
23-
| 'tel'
24-
| 'text'
25-
| 'time'
26-
| 'url'
27-
| 'week';
5+
export const InputType = {
6+
button: 'button',
7+
checkbox: 'checkbox',
8+
color: 'color',
9+
date: 'date',
10+
datetimeLocal: 'datetime-local',
11+
email: 'email',
12+
file: 'file',
13+
hidden: 'hidden',
14+
image: 'image',
15+
month: 'month',
16+
number: 'number',
17+
password: 'password',
18+
radio: 'radio',
19+
range: 'range',
20+
reset: 'reset',
21+
search: 'search',
22+
submit: 'submit',
23+
tel: 'tel',
24+
text: 'text',
25+
time: 'time',
26+
url: 'url',
27+
week: 'week',
28+
} as const;
29+
/**
30+
* Valid input types according to the HTML specification.
31+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types}
32+
*/
33+
export type InputType = (typeof InputType)[keyof typeof InputType];

0 commit comments

Comments
 (0)