The PageSwapEvent() constructor creates a new PageSwapEvent object instance.
new PageSwapEvent(type, init)typeA string representing the type of event. In the case of PageSwapEvent this is always pageswap.
initAn object containing the following properties:
activationA NavigationActivation object representing the navigation type and current and destination document history entries. Defaults to null if the associated navigation is a cross-origin navigation.
viewTransitionA ViewTransition object representing the active view transition for the related navigation. Defaults to null if there is no active view transition.
A developer would not use this constructor manually. A new PageSwapEvent object is constructed when a handler is invoked as a result of the pageswap event firing.