UNPKG

rasengan

Version:

The modern React Framework

105 lines (104 loc) 2.2 kB
import { jsx as _jsx } from "react/jsx-runtime"; /** * Router component that define a routing system */ export class RouterComponent { /** * Defines the layout applied to the Router */ _layout; /** * Defines the list of sub routers */ _routers; /** * Defines the list of pages */ _pages; /** * Defines the loader component to display when pages aren't available */ _loaderComponent; /** * Defines the not found component to display when pages aren't available */ _notFoundComponent; /** * Defines if the layout of the parent router must be used */ _useParentLayout; // Getters /** * Get the layout value */ get layout() { return this._layout; } /** * Get the list of routers */ get routers() { return this._routers; } /** * Get the list of pages */ get pages() { return this._pages; } /** * Get the loader component */ get loaderComponent() { return this._loaderComponent; } /** * Get the not found component */ get notFoundComponent() { return this._notFoundComponent; } /** * Get the use parent layout value */ get useParentLayout() { return this._useParentLayout; } // Setters /** * Set the layout value */ set layout(layout) { this._layout = layout; } /** * Set the list of routers */ set routers(routers) { this._routers = routers; } /** * Set the list of pages */ set pages(pages) { this._pages = pages; } /** * Set the loader component */ set loaderComponent(loaderComponent) { this._loaderComponent = loaderComponent; } /** * Set the not found component */ set notFoundComponent(NotFoundComponent) { this._notFoundComponent = NotFoundComponent ? (_jsx(NotFoundComponent, {})) : undefined; } /** * Set the use parent layout value */ set useParentLayout(useParentLayout) { this._useParentLayout = useParentLayout; } }