Parameterized navigation.

Allows to assign target page parameters prior to navigating to it.

Hierarchy

  • Parameterized

Methods

  • Opens a page by navigating to the given target with provided page parameters.

    Appends an entry to navigation history.

    Fires

    PreNavigateEvent#wesib:preNavigate On window object prior to actually navigate. Then navigates to the target, unless the event cancelled.

    Fires

    NavigateEvent@wesib:navigate On window object when navigation succeed.

    Returns

    A promise resolved to navigated page, or to null otherwise.

    Parameters

    • Optional target: string | URL | Target

      Either navigation target or URL to navigate to. Navigates to current page URL when omitted.

    Returns Promise<null | Page>

  • Pretends navigation.

    Prepares navigation and parameters, but does not actually navigate. Instead it calls the provided callback function.

    This is useful e.g. to build target URL or evaluate target page parameter.

    Returns

    Either the value returned by callback, or undefined when navigation failed.

    Type Parameters

    • T

    Parameters

    • target: string | URL | Target

      Either navigation target or URL to pretend navigation to.

    • callback: ((this: void, from: Page, to: Page) => T)

      A callback function receiving two pages as parameters: the page to leave, and the page to open. The latter one is valid only inside callback, as its parameters will be cleaned up right after callback returns. The value returned from callback is then returned from this method call. It may be used to collect some data from target page.

        • (this: void, from: Page, to: Page): T
        • Parameters

          Returns T

    Returns undefined | T

  • Pretends navigation to the same page.

    Prepares navigation and parameters, but does not actually navigate. Instead it calls the provided callback function.

    This is useful e.g. to build target URL or evaluate target page parameter.

    Returns

    Either the value returned by callback, or undefined when navigation failed.

    Type Parameters

    • T

    Parameters

    • callback: ((this: void, from: Page, to: Page) => T)

      A callback function receiving two pages as parameters: the page to leave, and the page to open. The latter one is valid only inside callback, as its parameters will be cleaned up right after callback returns. The value returned from callback is then returned from this method call. It may be used to collect some data from target page.

        • (this: void, from: Page, to: Page): T
        • Parameters

          Returns T

    Returns undefined | T

  • Pretends navigation and builds navigation target.

    Prepares navigation and parameters, but does not actually navigate. Instead it calls the provided callback function.

    This is useful e.g. to build target URL or evaluate target page parameter.

    Returns

    Either Navigation target with URL value, or undefined when navigation failed.

    Parameters

    • Optional target: string | URL | Target

      Either navigation target or URL to pretend navigation to. Prepends navigation to current page when omitted.

    Returns undefined | URLTarget

  • Replaces the most recent entry in navigation history with the given target and provided page parameters.

    Fires

    PreNavigateEvent#wesib:preNavigate On window object prior to actually update the history. Then navigates to the target, unless the event cancelled.

    Fires

    NavigateEvent@wesib:navigate On window object when history updated.

    Returns

    A promise resolved to navigated page, or to null otherwise.

    Parameters

    • Optional target: string | URL | Target

      Either navigation target or URL to replace the latest history entry with. Navigates to current page URL when omitted.

    Returns Promise<null | Page>

  • Applies parameter to navigation target page.

    Returns

    New parameterized navigation instance.

    Type Parameters

    • T

      Parameter value type.

    • TInput

      Parameter input type.

    Parameters

    • ref: PageParam.Ref<T, TInput>

      A reference to page navigation parameter to apply.

    • input: TInput

      Parameter input to use when constructing its value.

    Returns Parameterized

Generated using TypeDoc