Type alias NavigationAgent

NavigationAgent: ((this: void, next: ((this: void, target?: Target) => void), when: "pretend" | "pre-open" | "pre-replace", from: Page, to: Page) => void)

Type declaration

    • (this: void, next: ((this: void, target?: Target) => void), when: "pretend" | "pre-open" | "pre-replace", from: Page, to: Page): void
    • Navigation agent signature.

      The agent is called by navigation methods when leaving current page and may alter navigation processing. E.g. change navigation target. For that it should be registered in appropriate context.

      All registered agents are organized into chain. The first agent in chain is called by navigation method.

      Parameters

      • this: void
      • next: ((this: void, target?: Target) => void)

        Either calls the next agent in chain, or applies the final navigation target if this agent is the last one. Not calling this function effectively prevents navigation. Accepts an optional Target parameter. The original target will be used instead when omitted.

          • (this: void, target?: Target): void
          • Parameters

            • this: void
            • Optional target: Target

            Returns void

      • when: "pretend" | "pre-open" | "pre-replace"

        When navigation occurred. Either pretend, pre-open, or pre-replace.

      • from: Page

        The page to leave.

      • to: Page

        Navigation target page.

      Returns void

Generated using TypeDoc