forum: create app.ts file that exports Forum instance

This file can now be imported so 'app' is an instance of Forum instead of just Application - for typings
This commit is contained in:
David Sevilla Martin 2020-03-22 10:18:25 -04:00
parent d73f1d8a67
commit 88aa9fc038
No known key found for this signature in database
GPG Key ID: F764F1417E16B15F
5 changed files with 14 additions and 9 deletions

View File

@ -32,8 +32,8 @@ export default class Forum extends Application {
// discussionRenamed: DiscussionRenamedPost
};
previous: Page;
current: Page;
previous?: Page;
current?: Page;
constructor() {
super();

8
js/src/forum/app.ts Normal file
View File

@ -0,0 +1,8 @@
import Forum from './Forum';
const app = new Forum();
// @ts-ignore
window.app = app;
export default app;

View File

@ -1,3 +1,5 @@
import app from '../app';
import Component from '../../common/Component';
import listItems from '../../common/helpers/listItems';
import Button from '../../common/components/Button';

View File

@ -6,7 +6,7 @@ import ReplyPlaceholder from './ReplyPlaceholder';
import Button from '../../common/components/Button';
import Discussion from '../../common/models/Discussion';
import Post from '../../common/models/Post';
import Evented from '../../common/utils/evented';
import Evented from '../../common/utils/Evented';
import { DiscussionProp } from '../../common/concerns/ComponentProps';
import { Attributes } from 'mithril';

View File

@ -1,9 +1,4 @@
import Forum from './Forum';
const app = new Forum();
// @ts-ignore
window.app = app;
import app from './app';
export { app };