Package-level declarations

Types

Link copied to clipboard
data class ActiveRoute(val uri: String, val matchedRoute: Route.Match, val mountedRoute: MountedRoute)

Represent the route that is currently selected as active route by a Router

Link copied to clipboard
data class MountedRoute(val route: Route, val middlewares: List<RouterMiddleware>, val view: FlowContent.(Route.Match) -> Unit)

Represents a Route that is mounted by a Router

Link copied to clipboard
Link copied to clipboard
open class Pattern(regex: Regex) : Route

A route that matches a regex, f.e. used as a fallback route.

Link copied to clipboard
interface Route

Common Route representation

Link copied to clipboard
open class Route1(val pattern: String) : RouteBase

A parameterized route with one route parameter

Link copied to clipboard
open class Route2(val pattern: String) : RouteBase

A parameterized route with two route parameter

Link copied to clipboard
open class Route3(val pattern: String) : RouteBase

A parameterized route with two route parameter

Link copied to clipboard
open class Route4(val pattern: String) : RouteBase

A parameterized route with two route parameter

Link copied to clipboard
open class Route5(val pattern: String) : RouteBase

A parameterized route with two route parameter

Link copied to clipboard
abstract class RouteBase(val pattern: String, numParams: Int) : Route, Route.Renderable

A parameterized route with one route parameter

Link copied to clipboard
class Router(mountedRoutes: List<MountedRoute>, enabled: Boolean)

The Router

Link copied to clipboard

Helper class for building a Router

Link copied to clipboard
Link copied to clipboard

A RouterMiddleware is just a function with RouterMiddlewareContext as the receiver

Link copied to clipboard
class RouterMiddlewareContext(val router: Router, val uri: String, val match: Route.Match)

The context for all middle wares

Link copied to clipboard
typealias RouterProvider = () -> Router
Link copied to clipboard
open class Static(val pattern: String) : RouteBase

A static route is a route that does not have any route parameters

Functions

Link copied to clipboard
fun Tag.JoinedPageTitle(parts: () -> Iterable<String?>)
fun Tag.JoinedPageTitle(glue: String, parts: () -> Iterable<String?>)
Link copied to clipboard
fun navigateTo(uri: String)
Link copied to clipboard
fun Tag.PageTitle(provider: () -> String): ComponentRef<PageTitle>
fun Tag.PageTitle(title: String)
Link copied to clipboard
fun router(builder: RouterBuilder.() -> Unit): Router
Link copied to clipboard

The router component displays the view that is associated with the ActiveRoute of the given Router

Link copied to clipboard

Helper for defining a router middleware

Link copied to clipboard
fun <C> Component<C>.urlParam(router: Router, name: String, default: Int, onChange: (Int) -> Unit? = null): ReadWriteProperty<Component<C>, Int>
fun <C> Component<C>.urlParam(router: Router, name: String, default: String, onChange: (String) -> Unit? = null): ReadWriteProperty<Component<C>, String>
Link copied to clipboard
fun <C, T> Component<C>.urlParams(router: Router, fromParams: (Map<String, String>) -> T, toParams: (T) -> Map<String, Any?>, onChange: (T) -> Unit? = null): ReadWriteProperty<Component<C>, T>