UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

37 lines (36 loc) • 1.38 kB
export interface HistoryOptions { path?: string; search?: URLSearchParams | { [key: string]: unknown; }; hash?: string; } /** * Transform an object to an URLSearchParams instance. * * @param {Object} obj The object to convert. * @param {string} defaultSearch A string of defaults search params. * @return {URLSearchParams} * @link https://js-toolkit.studiometa.dev/utils/history/objectToURLSearchParams.html */ export declare function objectToURLSearchParams(obj: unknown, defaultSearch?: string): URLSearchParams; /** * Push a new state. * * @param {HistoryOptions} options The new state. * @param {Object} [data] The data for the new state. * @param {string} [title] The title for the new state. * @return {void} * @link https://js-toolkit.studiometa.dev/utils/history/historyPush.html */ export declare function push(options: HistoryOptions, data?: unknown, title?: string): void; /** * Replace a new state. * * @param {HistoryOptions} options The new state. * @param {Object} [data] The data for the new state. * @param {string} [title] The title for the new state. * @return {void} * @link https://js-toolkit.studiometa.dev/utils/history/historyReplace.html */ export declare function replace(options: HistoryOptions, data?: unknown, title?: string): void;