Options
All
  • Public
  • Public/Protected
  • All
Menu

Project routee

Index

Type aliases

ExecutorParameters

ExecutorParameters<T>: SanitizeRouteParameters<Record<T[number], string>>

Type parameters

  • T: Array<string>

RouteExecutor

RouteExecutor<P, D>: (parameters: ExecutorParameters<P>, data: Partial<D>) => void

Type parameters

  • P: Array<string>

  • D: Record<any, any>

Type declaration

RouteInterface

RouteInterface<Segments, Data>: { executor: RouteExecutor<Segments, Data>; id: string; segments: Segments }

Type parameters

  • Segments: Array<string>

  • Data: Record<string, any> = undefined

Type declaration

  • executor: RouteExecutor<Segments, Data>
  • id: string
  • segments: Segments

Functions

Const createURL

  • Create an URL for the route with the given parameters.

    Type parameters

    • P: string[]

    Parameters

    Returns string

Const dispatch

  • Dispatch a location to the corresponding route, if any, and return that route.

    Parameters

    • location: string

    Returns RouteInterface<any> | undefined

Const registerRoute

  • registerRoute<P, D>(id: string, segments: Keys<P> | Array<undefined>, executor: RouteExecutor<Keys<P> | Array<undefined>, D>): RouteInterface<Keys<P>, D>
  • Create and register a route.

    Type parameters

    • P

    • D

    Parameters

    • id: string
    • segments: Keys<P> | Array<undefined>
    • executor: RouteExecutor<Keys<P> | Array<undefined>, D>

    Returns RouteInterface<Keys<P>, D>

Generated using TypeDoc