@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
16 lines (15 loc) • 523 B
TypeScript
import type { FilterValue } from '../FilterContext';
export type FilterQueryLocatorOptions = {
/** When true, the search string is not synced to or from the URL. */
excludeSearch?: boolean;
};
/**
* Syncs filter state with URL query parameters using the History API.
* Works without any router dependency.
*/
export default function useFilterQueryLocator(id: string, options?: FilterQueryLocatorOptions): {
readFromUrl: () => {
search: string;
filters: Record<string, FilterValue>;
};
};