/** * @typedef SimplrRoute * @property { string } path The URL path for the route * @property { string } [component] The view component name for the route * @property { string } [name] Name of the view route * @property { Function } [import] An import function for lazy loading. e.g. () => import("./my-view.js") * @property { Function } [guard] A guard function to check view access * @property { SimplrRoute[] } [routes] An array of subroutes that inherit paths from the parent route * @property { SimplrRoute[] } [children] An array of nested routes that are rendered inside a nested router outlet * @property { Object.[] } [slots] An array of slots to append to the view component * @property { Object. } [pattern] RegExp pattern to match dynamic route keys * @property { string | {name: string} } [redirect] Path to redirect to * @property { boolean } [preventUnload] If navigation from this page should be prevented with a confirmation dialog * */ export const _route: {}; export type SimplrRoute = { /** * The URL path for the route */ path: string; /** * The view component name for the route */ component?: string; /** * Name of the view route */ name?: string; /** * An import function for lazy loading. e.g. () => import("./my-view.js") */ import?: Function; /** * A guard function to check view access */ guard?: Function; /** * An array of subroutes that inherit paths from the parent route */ routes?: SimplrRoute[]; /** * An array of nested routes that are rendered inside a nested router outlet */ children?: SimplrRoute[]; /** * An array of slots to append to the view component */ slots?: { [x: string]: string | Function; }[]; /** * RegExp pattern to match dynamic route keys */ pattern?: { [x: string]: string; }; /** * Path to redirect to */ redirect?: string | { name: string; }; /** * If navigation from this page should be prevented with a confirmation dialog */ preventUnload?: boolean; };