chore: convert HeaderPrimary to TypeScript (#4052)

This commit is contained in:
Vijayan K S 2024-10-03 02:23:35 +05:30 committed by GitHub
parent da441c77ca
commit 4291918171
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,13 +1,14 @@
import Component from '../../common/Component'; import Component from '../../common/Component';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import listItems from '../../common/helpers/listItems'; import listItems from '../../common/helpers/listItems';
import type Mithril from 'mithril';
/** /**
* The `HeaderPrimary` component displays primary header controls. On the * The `HeaderPrimary` component displays primary header controls. On the
* default skin, these are shown just to the right of the forum title. * default skin, these are shown just to the right of the forum title.
*/ */
export default class HeaderPrimary extends Component { export default class HeaderPrimary extends Component {
view() { view(): JSX.Element {
return <ul className="Header-controls">{listItems(this.items().toArray())}</ul>; return <ul className="Header-controls">{listItems(this.items().toArray())}</ul>;
} }
@ -16,7 +17,8 @@ export default class HeaderPrimary extends Component {
* *
* @return {ItemList<import('mithril').Children>} * @return {ItemList<import('mithril').Children>}
*/ */
items() {
return new ItemList(); items(): ItemList<Mithril.Children> {
return new ItemList<Mithril.Children>();
} }
} }