1
0
mirror of https://github.com/flarum/core.git synced 2025-08-12 11:24:30 +02:00

fix: eliminate JSX.Element from generated typings

Either add JSDoc or TypeScript annotations so that `Mithril.Children` is always returned in favor of `JSX.Element`.
This commit is contained in:
Alexander Skvortsov
2022-03-19 16:04:41 -04:00
parent 6df4101bae
commit c9fdd0753f
104 changed files with 391 additions and 125 deletions

View File

@@ -13,6 +13,9 @@ export default class FlagList extends Component {
this.state = this.attrs.state;
}
/**
* @return {import('mithril').Children}
*/
view() {
const flags = this.state.cache || [];

View File

@@ -24,6 +24,9 @@ export default class FlagPostModal extends Modal {
return app.translator.trans('flarum-flags.forum.flag_post.title');
}
/**
* @return {import('mithril').Children}
*/
content() {
if (this.success) {
return (

View File

@@ -11,6 +11,9 @@ export default class FlagsDropdown extends NotificationsDropdown {
super.initAttrs(attrs);
}
/**
* @return {import('mithril').Children}
*/
getMenu() {
return (
<div className={'Dropdown-menu ' + this.attrs.menuClassName} onclick={this.menuClick.bind(this)}>

View File

@@ -18,6 +18,9 @@ export default class FlagsPage extends Page {
this.bodyClass = 'App--flags';
}
/**
* @return {import('mithril').Children}
*/
view() {
return (
<div className="FlagsPage">