UNPKG

@svelte-navigator/history

Version:
20 lines (19 loc) 937 B
import type { BrowserHistory } from "./types"; export interface BrowserHistoryOptions { window?: Window; } /** * Use the HTML5 History API to store app loaction and state in the url. * This is probably the best choice for most apps, as it enables best ceo * possibilities and is probably most intuitive. * This setup however needs some additional work because you need to * configure your server to always serve your index.html file when a * request doesn't match a file. * You can read more about it in [vue-routers docs about history routing]( * https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations). * * @param {BrowserHistoryOptions} [options] Supply a custom window object * * @returns {BrowserHistory} The history object */ export default function createBrowserHistory<State = unknown>({ window: windowArg, }?: BrowserHistoryOptions): BrowserHistory<State>;