@barba/core
Version:
Create badass, fluid and smooth transition between your website's pages
57 lines (56 loc) • 1.07 kB
TypeScript
/**
* @barba/core/utils/history
* <br><br>
* ## History manager.
*
* - Keep track of the navigation history
*
* @module core/utils/history
* @preferred
*/
/***/
/**
* History item.
*
* @property namespace
* @property URL
*/
interface IHistoryItem {
/** namespace */
ns: string | undefined;
/** URL */
url: string;
}
export declare class History {
private _state;
/**
* Add a new state.
*/
add(url: string, ns: string): void;
/**
* Remove last state.
*/
remove(): void;
/**
* Add new state then update browser history.
*/
push(url: string, ns: string): void;
/**
* Remove last state then go back.
*/
cancel(): void;
/**
* Get the current state.
*/
readonly current: IHistoryItem;
/**
* Get the previous state.
*/
readonly previous: IHistoryItem | null;
/**
* Get the state size.
*/
readonly size: number;
}
declare const history: History;
export { history };