diff --git a/framework/core/js/src/@types/global.d.ts b/framework/core/js/src/@types/global.d.ts index a0d84324f..26bc910f3 100644 --- a/framework/core/js/src/@types/global.d.ts +++ b/framework/core/js/src/@types/global.d.ts @@ -23,19 +23,18 @@ declare type KeyOfType = KeysOfType[key type Component = import('mithril').Component; -declare type ComponentClass< -Attrs = Record, C extends Component = Component> = { new (...args: any[]): Component, prototype: C }; +declare type ComponentClass, C extends Component = Component> = { + new (...args: any[]): Component; + prototype: C; +}; /** * Unfortunately, TypeScript only supports strings and classes for JSX tags. * Therefore, our type definition should only allow for those two types. - * + * * @see https://github.com/microsoft/TypeScript/issues/14789#issuecomment-412247771 */ -declare type VnodeElementTag< - Attrs = Record, - C extends Component = Component -> = string | ComponentClass; +declare type VnodeElementTag, C extends Component = Component> = string | ComponentClass; /** * @deprecated Please import `app` from a namespace instead of using it as a global variable. diff --git a/framework/core/js/src/admin/components/ReadmeModal.tsx b/framework/core/js/src/admin/components/ReadmeModal.tsx index f932de229..e2cc9f0bc 100644 --- a/framework/core/js/src/admin/components/ReadmeModal.tsx +++ b/framework/core/js/src/admin/components/ReadmeModal.tsx @@ -4,7 +4,7 @@ import LoadingIndicator from '../../common/components/LoadingIndicator'; import Placeholder from '../../common/components/Placeholder'; import ExtensionReadme from '../models/ExtensionReadme'; import type Mithril from 'mithril'; -import { Extension } from '../AdminApplication'; +import type { Extension } from '../AdminApplication'; export interface IReadmeModalAttrs extends IInternalModalAttrs { extension: Extension; diff --git a/framework/core/js/src/common/components/EditUserModal.tsx b/framework/core/js/src/common/components/EditUserModal.tsx index 01083ec76..994d6b8b3 100644 --- a/framework/core/js/src/common/components/EditUserModal.tsx +++ b/framework/core/js/src/common/components/EditUserModal.tsx @@ -6,9 +6,9 @@ import Group from '../models/Group'; import extractText from '../utils/extractText'; import ItemList from '../utils/ItemList'; import Stream from '../utils/Stream'; -import Mithril from 'mithril'; -import User from '../models/User'; -import { SaveAttributes, SaveRelationships } from '../Model'; +import type Mithril from 'mithril'; +import type User from '../models/User'; +import type { SaveAttributes, SaveRelationships } from '../Model'; export interface IEditUserModalAttrs extends IInternalModalAttrs { user: User; diff --git a/framework/core/js/src/common/components/RequestErrorModal.tsx b/framework/core/js/src/common/components/RequestErrorModal.tsx index f624e1c17..895ef5acc 100644 --- a/framework/core/js/src/common/components/RequestErrorModal.tsx +++ b/framework/core/js/src/common/components/RequestErrorModal.tsx @@ -1,10 +1,10 @@ -import RequestError from '../utils/RequestError'; +import type RequestError from '../utils/RequestError'; import Modal, { IInternalModalAttrs } from './Modal'; export interface IRequestErrorModalAttrs extends IInternalModalAttrs { error: RequestError; formattedError: string[]; -}; +} export default class RequestErrorModal extends Modal { className() { diff --git a/framework/core/js/src/common/states/ModalManagerState.ts b/framework/core/js/src/common/states/ModalManagerState.ts index 44c2be05d..425de5150 100644 --- a/framework/core/js/src/common/states/ModalManagerState.ts +++ b/framework/core/js/src/common/states/ModalManagerState.ts @@ -1,4 +1,4 @@ -import Component from '../Component'; +import type Component from '../Component'; import Modal from '../components/Modal'; /** @@ -8,7 +8,7 @@ import Modal from '../components/Modal'; * https://github.com/Microsoft/TypeScript/issues/1213 * Therefore, we have to use this ugly, messy workaround. */ -type UnsafeModalClass = ComponentClass & {isDismissible: boolean, component: typeof Component.component}; +type UnsafeModalClass = ComponentClass & { isDismissible: boolean; component: typeof Component.component }; /** * Class used to manage modal state.