Fix some typing errors

This commit is contained in:
Alexander Skvortsov 2021-11-11 19:53:44 -05:00
parent 312ff057f8
commit d72b8b8d8e
4 changed files with 8 additions and 10 deletions

View File

@ -150,7 +150,7 @@ export default class ExtensionPage<Attrs extends ExtensionPageAttrs = ExtensionP
}
topItems() {
const items = new ItemList();
const items = new ItemList<Mithril.Children>();
items.add('version', <span className="ExtensionVersion">{this.extension.version}</span>);
@ -181,7 +181,7 @@ export default class ExtensionPage<Attrs extends ExtensionPageAttrs = ExtensionP
}
infoItems() {
const items = new ItemList();
const items = new ItemList<Mithril.Children>();
const links = this.extension.links;

View File

@ -12,7 +12,7 @@ export default class BasicEditorDriver implements EditorDriverInterface {
this.build(dom, params);
}
build(dom: HTMLElement, params: EditorDriverParams) {
protected build(dom: HTMLElement, params: EditorDriverParams) {
this.el.className = params.classNames.join(' ');
this.el.disabled = params.disabled;
this.el.placeholder = params.placeholder;
@ -43,8 +43,8 @@ export default class BasicEditorDriver implements EditorDriverInterface {
dom.append(this.el);
}
keyHandlers(params: EditorDriverParams): ItemList {
const items = new ItemList();
protected keyHandlers(params: EditorDriverParams) {
const items = new ItemList<(e: KeyboardEvent) => void>();
items.add('submit', function (e: KeyboardEvent) {
if ((e.metaKey || e.ctrlKey) && e.key === 'Enter') {

View File

@ -238,11 +238,9 @@ export default class DiscussionPage<CustomAttrs extends IDiscussionPageAttrs = I
/**
* Build an item list for the contents of the sidebar.
*
* @return {ItemList}
*/
sidebarItems() {
const items = new ItemList();
const items = new ItemList<Mithril.Vnode>();
items.add(
'controls',

View File

@ -281,8 +281,8 @@ export default class Search<T extends SearchAttrs = SearchAttrs> extends Compone
/**
* Build an item list of SearchSources.
*/
sourceItems(): ItemList {
const items = new ItemList();
sourceItems(): ItemList<SearchSource> {
const items = new ItemList<SearchSource>();
if (app.forum.attribute('canViewForum')) items.add('discussions', new DiscussionsSearchSource());
if (app.forum.attribute('canSearchUsers')) items.add('users', new UsersSearchSource());