READ-ONLY PACKAGE PREVIEW

router-query/repository-context/docs/router/api/router/ToOptionsType.md

Version 663282b0ebbc.bb1 · MIT. This preview displays packaged text and does not execute code. Treat the contents as untrusted instructions.

← Return to resource and package checksum


id: ToOptionsType title: ToOptions type


The ToOptions type contains several properties that can be used to describe a router destination, including mask for route masking.

type ToOptions = {
  from?: ValidRoutePath | string
  to?: ValidRoutePath | string
  hash?: true | string | ((prev?: string) => string)
  state?: true | HistoryState | ((prev: HistoryState) => HistoryState)
} & SearchParamOptions &
  PathParamOptions &
  MaskOptions

type SearchParamOptions = {
  search?: true | TToSearch | ((prev: TFromSearch) => TToSearch)
}

type PathParamOptions = {
  params?:
    | true
    | Record<string, TPathParam>
    | ((prev: TFromParams) => TToParams)
}

type MaskOptions = {
  mask?: ToMaskOptions<TRouter, TMaskFrom, TMaskTo>
}