1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 16:05:05 +02:00
Files
php-flarum/js/dist-typings/forum/resolvers/DiscussionPageResolver.d.ts
flarum-bot ec5214f714 Bundled output for commit bac0e594ee
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-11-11 19:21:56 +00:00

26 lines
1.3 KiB
TypeScript

import type Mithril from 'mithril';
import DefaultResolver from '../../common/resolvers/DefaultResolver';
import DiscussionPage, { IDiscussionPageAttrs } from '../components/DiscussionPage';
/**
* A custom route resolver for DiscussionPage that generates the same key to all posts
* on the same discussion. It triggers a scroll when going from one post to another
* in the same discussion.
*/
export default class DiscussionPageResolver<Attrs extends IDiscussionPageAttrs = IDiscussionPageAttrs, RouteArgs extends Record<string, unknown> = {}> extends DefaultResolver<Attrs, DiscussionPage<Attrs>, RouteArgs> {
static scrollToPostNumber: number | null;
/**
* Remove optional parts of a discussion's slug to keep the substring
* that bijectively maps to a discussion object. By default this just
* extracts the numerical ID from the slug. If a custom discussion
* slugging driver is used, this may need to be overriden.
* @param slug
*/
canonicalizeDiscussionSlug(slug: string | undefined): string | undefined;
/**
* @inheritdoc
*/
makeKey(): string;
onmatch(args: Attrs & RouteArgs, requestedPath: string, route: string): new () => DiscussionPage<Attrs>;
render(vnode: Mithril.Vnode<Attrs, DiscussionPage<Attrs>>): Mithril.Children;
}