From c900cb3f6d50c7e315aeb9a97ec966c5fe2134d1 Mon Sep 17 00:00:00 2001 From: David Wheatley Date: Fri, 20 Aug 2021 23:59:54 +0200 Subject: [PATCH] Move `HTMLInputTypes` type to global declarations --- js/src/@types/global.d.ts | 28 +++++++++++++++++++++++++++ js/src/admin/components/AdminPage.tsx | 24 ----------------------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/js/src/@types/global.d.ts b/js/src/@types/global.d.ts index 82019b82d..db508e78e 100644 --- a/js/src/@types/global.d.ts +++ b/js/src/@types/global.d.ts @@ -1,3 +1,31 @@ +/** + * A type that matches any valid value for the `type` attribute on an + * HTML `` element. + */ +declare type HTMLInputTypes = + | 'button' + | 'checkbox' + | 'color' + | 'date' + | 'datetime-local' + | 'email' + | 'file' + | 'hidden' + | 'image' + | 'month' + | 'number' + | 'password' + | 'radio' + | 'range' + | 'reset' + | 'search' + | 'submit' + | 'tel' + | 'text' + | 'time' + | 'url' + | 'week'; + /** * @deprecated Please import `app` from a namespace instead of using it as a global variable. * diff --git a/js/src/admin/components/AdminPage.tsx b/js/src/admin/components/AdminPage.tsx index 3a3ff04fc..ca6361959 100644 --- a/js/src/admin/components/AdminPage.tsx +++ b/js/src/admin/components/AdminPage.tsx @@ -20,30 +20,6 @@ interface AdminHeaderOptions { className: string; } -type HTMLInputTypes = - | 'button' - | 'checkbox' - | 'color' - | 'date' - | 'datetime-local' - | 'email' - | 'file' - | 'hidden' - | 'image' - | 'month' - | 'number' - | 'password' - | 'radio' - | 'range' - | 'reset' - | 'search' - | 'submit' - | 'tel' - | 'text' - | 'time' - | 'url' - | 'week'; - interface CommonSettingsItemOptions extends Mithril.Attributes { setting: string; label: string | ReturnType;