raviger
Version:
React routing with hooks
20 lines (19 loc) • 633 B
TypeScript
export interface QueryParam {
[key: string]: any;
}
export interface setQueryParamsOptions {
/**
* Controls whether the querystring is overwritten or merged into
*
* default: true
*/
overwrite?: boolean;
/**
* Controls whether the querystring update causes a history push or replace
*
* default: false
*/
replace?: boolean;
}
export declare function useQueryParams<T extends QueryParam>(parseFn?: (query: string) => T, serializeFn?: (query: Partial<T>) => string): [T, (query: T, options?: setQueryParamsOptions) => void];
export declare function getQueryString(): string;