/** * Triggered by the ModelRouter when the route has changed. * * @event cq-pagemodel-route-changed * @type {Object} * @property {Object} detail * @property {Object} detail.model - The page model object corresponding to the new route */ /** *

The ModelRouter listens for HTML5 History API popstate events and calls {@link PageModelManager#getData()} with the model path it extracted from the URL.

* *

Configuration

* *

The Model Router can be configured using meta properties located in the head section of the document.

* *

Meta properties

* * *

Defaults

* * *

Examples and Usages

* *

Disables the page model router

*
 *     e.g. <meta property="cq:page_model_router" content="disable"\>
 * 
* *

Filters paths from the model routing with the given patterns

*
 *     e.g. <meta property="cq:page_model_route_filters" content="route/not/found,^(.*)(?:exclude/path)(.*)"\>
 * 
* * @module ModelRouter */ /** * Modes in which the Model Router operates * * @type {{DISABLED: string, CONTENT_PATH: string}} */ export declare class RouterModes { /** * Flag that indicates that the model router should be disabled. */ static readonly DISABLED = "disabled"; /** * Flag that indicates that the model router should extract the model path from the content path section of the URL. */ static readonly CONTENT_PATH = "path"; private constructor(); } /** * Returns the model path. If no URL is provided the current window URL is used * * @param {string} [url] - url from which to extract the model path * * @return {string} */ export declare function getModelPath(url?: string | null): string; /** * Returns the list of provided route filters * * @returns {string[]} * * @private */ export declare function getRouteFilters(): string[]; /** * Should the route be excluded * * @param route * @returns {boolean} * * @private */ export declare function isRouteExcluded(route: string): boolean; /** * Is the model router enabled. Enabled by default * @returns {boolean} * * @private */ export declare function isModelRouterEnabled(): boolean; /** * Fetches the model from the PageModelManager and then dispatches it * * @fires cq-pagemodel-route-changed * * @param {string} [path] - path of the model to be dispatched * * @private */ export declare function dispatchRouteChanged(path: string): void; /** * Triggers the PageModelManager to fetch data based on the current route * * @fires cq-pagemodel-route-changed - with the root page model object * * @param {string} [url] - url from which to extract the model path * * @private */ export declare function routeModel(url?: string | null): void; //# sourceMappingURL=ModelRouter.d.ts.map