Skip to main content

Class: PageNavigationHandler

@ima/core.PageNavigationHandler

Hierarchy

Constructors

constructor

new PageNavigationHandler(window)

Parameters

NameTypeDescription
windowWindowThe utility for manipulating the global context and global client-side-specific APIs.

Overrides

PageHandler.constructor

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:18

Properties

#preManaged

Private #preManaged: boolean = false

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:10


_window

Protected _window: Window

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:8


$dependencies

Static $dependencies: Dependencies

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:12

Methods

_saveScrollHistory

_saveScrollHistory(): void

Save user's scroll state to history.

Replace scroll values in current state for actual scroll values in document.

Returns

void

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:104


_scrollTo

_scrollTo(«destructured»): void

Scrolls to give coordinates on a page.

Parameters

NameType
«destructured»Object

Returns

void

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:121


_setAddressBar

_setAddressBar(url, isRedirection): void

Sets the provided URL to the browser's address bar by pushing or replacing a new state to the history.

The state object pushed to or replaced in the history will be an object with the following structure: {url: string}. The url field will be set to the provided URL.

Parameters

NameTypeDescription
urlstringThe URL.
isRedirectionbooleanIf replaceState should be used instead of pushState.

Returns

void

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:138


destroy

destroy(): void

Finalization callback, called when the page manager is being discarded. This usually happens when the page is hot-reloaded at the client side.

Returns

void

Inherited from

PageHandler.destroy

Defined in

packages/core/src/page/handler/PageHandler.ts:50


handlePostManagedState

handlePostManagedState(managedPage, previousManagedPage, action): void

Called after a PageManager finishes transition from previous page to a new one.

Parameters

NameTypeDescription
managedPageManagedPageThe currently managed page.
previousManagedPageManagedPageThe data of the page that was previously managed.
actionPageActionAn action object describing what triggered the routing.

Returns

void

Overrides

PageHandler.handlePostManagedState

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:84


handlePreManagedState

handlePreManagedState(managedPage, nextManagedPage, action): void

Called before a PageManager starts to transition from previous page to a new one.

Parameters

NameTypeDescription
managedPageManagedPageThe currently managed page - soon-to-be previously managed page.
nextManagedPageManagedPageThe data of the page that's about to be managed.
actionPageActionAn action object describing what triggered the routing.

Returns

void

Overrides

PageHandler.handlePreManagedState

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:43


init

init(): void

Initializes the page handler.

Returns

void

Overrides

PageHandler.init

Defined in

packages/core/src/page/handler/PageNavigationHandler.ts:31