Bundled output for commit 29c290e78f68b878b7d8a82c4bd5f0fe7abf3f81

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot 2021-12-01 16:32:02 +00:00
parent 29c290e78f
commit 2b87f10738
8 changed files with 31 additions and 25 deletions

View File

@ -1,6 +1,5 @@
import AdminApplication from './AdminApplication';
/**
* The `routes` initializer defines the forum app's routes.
*
* @param {App} app
*/
export default function _default(app: any): void;
export default function (app: AdminApplication): void;

View File

@ -13,10 +13,7 @@ import type Mithril from 'mithril';
import type Component from './Component';
import type { ComponentAttrs } from './Component';
export declare type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd';
export declare type FlarumGenericRoute = RouteItem<Record<string, unknown>, Component<{
routeName: string;
[key: string]: unknown;
}>, Record<string, unknown>>;
export declare type FlarumGenericRoute = RouteItem<any, any, any>;
export interface FlarumRequestOptions<ResponseType> extends Omit<Mithril.RequestOptions<ResponseType>, 'extract'> {
errorHandler?: (error: RequestError) => void;
url: string;
@ -52,18 +49,14 @@ export declare type RouteItem<Attrs extends ComponentAttrs, Comp extends Compone
/**
* The component to render when this route matches.
*/
component: {
new (): Comp;
};
component: new () => Comp;
/**
* A custom resolver class.
*
* This should be the class itself, and **not** an instance of the
* class.
*/
resolverClass?: {
new (): DefaultResolver<Attrs, Comp, RouteArgs>;
};
resolverClass?: new (component: new () => Comp, routeName: string) => DefaultResolver<Attrs, Comp, RouteArgs>;
} | {
/**
* An instance of a route resolver.

View File

@ -11,13 +11,9 @@ import type { default as Component, ComponentAttrs } from '../Component';
export default class DefaultResolver<Attrs extends ComponentAttrs, Comp extends Component<Attrs & {
routeName: string;
}>, RouteArgs extends Record<string, unknown> = {}> implements RouteResolver<Attrs, Comp, RouteArgs> {
component: {
new (): Comp;
};
component: new () => Comp;
routeName: string;
constructor(component: {
new (): Comp;
}, routeName: string);
constructor(component: new () => Comp, routeName: string);
/**
* When a route change results in a changed key, a full page
* rerender occurs. This method can be overriden in subclasses

View File

@ -1,5 +1,6 @@
import History from './utils/History';
import Pane from './utils/Pane';
import { makeRouteHelpers } from './routes';
import Application from '../common/Application';
import NotificationListState from './states/NotificationListState';
import GlobalSearchState from './states/GlobalSearchState';
@ -44,6 +45,7 @@ export default class ForumApplication extends Application {
* is used in the index page and the slideout pane.
*/
discussions: DiscussionListState;
route: typeof Application.prototype.route & ReturnType<typeof makeRouteHelpers>;
constructor();
/**
* @inheritdoc

View File

@ -1,6 +1,22 @@
import ForumApplication from './ForumApplication';
import Discussion from '../common/models/Discussion';
import Post from '../common/models/Post';
import User from '../common/models/User';
/**
* The `routes` initializer defines the forum app's routes.
*
* @param {App} app
*/
export default function _default(app: any): void;
export default function (app: ForumApplication): void;
export declare function makeRouteHelpers(app: ForumApplication): {
/**
* Generate a URL to a discussion.
*/
discussion: (discussion: Discussion, near: number) => string;
/**
* Generate a URL to a post.
*/
post: (post: Post) => string;
/**
* Generate a URL to a user.
*/
user: (user: User) => string;
};

2
js/dist/admin.js.map generated vendored

File diff suppressed because one or more lines are too long

2
js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

2
js/dist/forum.js.map generated vendored

File diff suppressed because one or more lines are too long