UNPKG

@virtualstate/app-history

Version:

Native JavaScript [app-history](https://github.com/WICG/app-history) implementation

72 lines 2.15 kB
import { EventTargetListeners as EventTargetListenersSymbol } from "./event-target/index.js"; export class AppHistoryAppHistory { #appHistory; get [EventTargetListenersSymbol]() { return []; } constructor(appHistory) { this.#appHistory = appHistory; } get canGoBack() { return this.#appHistory.canGoBack; } get canGoForward() { return this.#appHistory.canGoForward; } get current() { return this.#appHistory.current; } set oncurrentchange(value) { this.#appHistory.oncurrentchange = value; } set onnavigate(value) { this.#appHistory.onnavigate = value; } set onnavigateerror(value) { this.#appHistory.onnavigateerror = value; } set onnavigatesuccess(value) { this.#appHistory.onnavigatesuccess = value; } get transition() { return this.#appHistory.transition; } addEventListener(type, listener, options) { if (typeof type === "string") { this.#appHistory.addEventListener(type, listener, typeof options === "boolean" ? { once: true } : options); } } back(options) { return this.#appHistory.back(options); } dispatchEvent(event) { return this.#appHistory.dispatchEvent(event); } entries() { return this.#appHistory.entries(); } forward(options) { return this.#appHistory.forward(options); } goTo(key, options) { return this.#appHistory.goTo(key, options); } hasEventListener(type, callback) { return this.#appHistory.hasEventListener(type, callback); } navigate(url, options) { return this.#appHistory.navigate(url, options); } reload(options) { return this.#appHistory.reload(options); } removeEventListener(type, listener, options) { if (typeof type === "string") { return this.#appHistory.removeEventListener(type, listener, options); } } updateCurrent(options) { return this.#appHistory.updateCurrent(options); } } //# sourceMappingURL=app-history-app-history.js.map