mirror of
https://github.com/flarum/core.git
synced 2025-08-13 11:54:32 +02:00
Bundled output for commit f8232b9c1b
Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci]
This commit is contained in:
@@ -1,21 +1,34 @@
|
||||
import type Mithril from 'mithril';
|
||||
import type { RouteResolver } from '../Application';
|
||||
import type { default as Component, ComponentAttrs } from '../Component';
|
||||
/**
|
||||
* Generates a route resolver for a given component.
|
||||
*
|
||||
* In addition to regular route resolver functionality:
|
||||
* - It provide the current route name as an attr
|
||||
* - It sets a key on the component so a rerender will be triggered on route change.
|
||||
*/
|
||||
export default class DefaultResolver {
|
||||
component: Mithril.Component;
|
||||
export default class DefaultResolver<Attrs extends ComponentAttrs, Comp extends Component<Attrs & {
|
||||
routeName: string;
|
||||
constructor(component: any, routeName: any);
|
||||
}>, RouteArgs extends Record<string, unknown> = {}> implements RouteResolver<Attrs, Comp, RouteArgs> {
|
||||
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
|
||||
* to prevent rerenders on some route changes.
|
||||
*/
|
||||
makeKey(): string;
|
||||
makeAttrs(vnode: any): any;
|
||||
onmatch(args: any, requestedPath: any, route: any): Mithril.Component<{}, {}>;
|
||||
render(vnode: any): any[];
|
||||
makeAttrs(vnode: Mithril.Vnode<Attrs, Comp>): Attrs & {
|
||||
routeName: string;
|
||||
};
|
||||
onmatch(args: RouteArgs, requestedPath: string, route: string): {
|
||||
new (): Comp;
|
||||
};
|
||||
render(vnode: Mithril.Vnode<Attrs, Comp>): Mithril.Children;
|
||||
}
|
||||
|
Reference in New Issue
Block a user