vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
33 lines (32 loc) • 985 B
TypeScript
export { pushHistoryState };
export { replaceHistoryStateOriginal };
export { onPopStateBegin };
export { saveScrollPosition };
export { initHistoryState };
export { monkeyPatchHistoryAPI };
export type { HistoryInfo };
export type { ScrollPosition };
type StateEnhanced = {
timestamp: number;
scrollPosition: null | ScrollPosition;
triggeredBy: 'user' | 'vike' | 'browser';
_isVikeEnhanced: true;
};
type ScrollPosition = {
x: number;
y: number;
};
declare function saveScrollPosition(): void;
declare function pushHistoryState(url: string, overwriteLastHistoryEntry: boolean): void;
declare function replaceHistoryStateOriginal(state: unknown, url: string): void;
declare function monkeyPatchHistoryAPI(): void;
type HistoryInfo = {
url: `/${string}`;
state: StateEnhanced;
};
declare function onPopStateBegin(): {
isHistoryStateEnhanced: boolean;
previous: HistoryInfo;
current: HistoryInfo;
};
declare function initHistoryState(): void;