Flarum (v2.0.0-beta.4)
    Preparing search index...

    The App class provides a container for an application, as well as various utilities for the rest of the app to use.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    alerts: AlertManagerState = ...

    An object that manages the state of active alerts.

    allowUserColorScheme: boolean
    booted: boolean = false

    Whether or not the app has been booted.

    cache: Record<string, unknown> = {}

    A local cache that can be used to store data at the application level, so that is persists between different routes.

    current: PageState = ...

    The page the app is currently on.

    This object holds information about the type of page we are currently visiting, and sometimes additional arbitrary page state that may be relevant to lower-level components.

    currentInitializerExtension: string | null = null

    Settings are serialized to the admin dashboard as strings. Additional encoding/decoding is possible, but must take place on the client side.

    drawer: Drawer

    An object that manages the state of the navigation drawer.

    extensionCategories: Record<string, number> = ...
    forum: Forum

    The forum model for this application.

    generalIndex: GeneralSearchIndex = ...

    Custom settings and custom permissions do not go through the registry. The general index is used to manually add these items to be picked up by the search.

    history: IHistory = ...
    initializers: ItemList<(app: this) => void> = ...

    An ordered list of initializers to bootstrap the application.

    initialRoute: string
    modal: ModalManagerState = ...

    An object that manages modal state.

    pane: any = null
    previous: PageState = ...

    The page the app was on before the current page.

    Once the application navigates to another page, the object previously assigned to this.current will be moved to this.previous, while this.current is re-initialized.

    refs: Record<string, string> = ...
    registry: AdminRegistry = ...

    Stores the available settings, permissions, and custom pages of the app. Allows the global search to find these items.

    route: (name: string, params?: Record<string, unknown>) => string & AdminRoutes

    Construct a URL to the route with the given name.

    routes: Record<string, FlarumGenericRoute> = {}

    A map of routes, keyed by a unique route name. Each route is an object containing the following properties:

    • path The path that the route is accessed at.
    • component The Mithril component to render when this route is active.
    app.routes.discussion = { path: '/d/:id', component: DiscussionPage };
    
    search: SearchManager<SearchState> = ...
    session: Session

    The app's session.

    Stores info about the current user.

    store: Store = ...

    The app's data store.

    translator: Translator = ...

    The app's translator.

    Methods