UNPKG

@virtualstate/navigation

Version:

Native JavaScript [navigation](https://developer.mozilla.org/en-US/docs/Web/API/Navigation_API) implementation

60 lines 1.57 kB
export class NavigateEvent { type; canIntercept; /** * @deprecated */ canTransition; destination; downloadRequest; formData; hashChange; info; signal; userInitiated; navigationType; constructor(type, init) { this.type = type; if (!init) { throw new TypeError("init required"); } if (!init.destination) { throw new TypeError("destination required"); } if (!init.signal) { throw new TypeError("signal required"); } this.canIntercept = init.canIntercept ?? false; this.canTransition = init.canIntercept ?? false; this.destination = init.destination; this.downloadRequest = init.downloadRequest; this.formData = init.formData; this.hashChange = init.hashChange ?? false; this.info = init.info; this.signal = init.signal; this.userInitiated = init.userInitiated ?? false; this.navigationType = init.navigationType ?? "push"; } commit() { throw new Error("Not implemented"); } intercept(options) { throw new Error("Not implemented"); } preventDefault() { throw new Error("Not implemented"); } reportError(reason) { throw new Error("Not implemented"); } scroll() { throw new Error("Not implemented"); } /** * @deprecated */ transitionWhile(options) { return this.intercept(options); } } //# sourceMappingURL=navigate-event.js.map