Skip to main content

HistoryBridgeFunctions

Async bridge functions forwarded via comlink from the iframe (FrameWrapper) to the parent window (HostIframe). All methods are async because they cross the comlink boundary.

Callbacks that cross the boundary (addBlock) must be wrapped with comlink.proxy() by the caller (FrameWrapper.init) before being passed in.

Index

Methods

addBlock

  • Callback must be wrapped with comlink.proxy by FrameWrapper. Returns an async unsubscribe fn.


    Parameters

    Returns Promise<() => void>

navigate

  • navigate(opts: { activeChild?: null | string; activeChildInit?: { route?: string | string[]; state?: Record<string, unknown> }; route?: string | string[]; state?: Record<string, unknown> } & ChaynsHistoryNavigationCommitOptions & { hash?: string; params?: Record<string, string> }): Promise<ChaynsHistoryActionResult>
  • Parameters

    • opts: { activeChild?: null | string; activeChildInit?: { route?: string | string[]; state?: Record<string, unknown> }; route?: string | string[]; state?: Record<string, unknown> } & ChaynsHistoryNavigationCommitOptions & { hash?: string; params?: Record<string, string> }

    Returns Promise<ChaynsHistoryActionResult>

setActiveChild

  • setActiveChild(id: null | string, init?: { route?: string | string[]; state?: Record<string, unknown> }): Promise<ChaynsHistoryActionResult>
  • Parameters

    • id: null | string
    • optionalinit: { route?: string | string[]; state?: Record<string, unknown> }
      • optionalroute: string | string[]
      • optionalstate: Record<string, unknown>

    Returns Promise<ChaynsHistoryActionResult>

setHash

setParams

setRoute

setSegmentCount

  • setSegmentCount(n: number): Promise<void>
  • Parameters

    • n: number

    Returns Promise<void>

setState