use-query-params
Version:
React Hook for managing state in URL query parameters with easy serialization.
16 lines (15 loc) • 897 B
TypeScript
import { QueryParamConfig, QueryParamConfigMap } from 'serialize-query-params';
import { QueryParamOptions } from './options';
import { QueryParamConfigMapWithInherit } from './types';
/**
* Convert inherit strings from a query param config to actual
* parameters based on predefined ('inherited') mappings.
* Defaults to StringParam.
*/
export declare function convertInheritedParamStringsToParams(paramConfigMapWithInherit: QueryParamConfigMapWithInherit, options: QueryParamOptions): QueryParamConfigMap;
/**
* Extends a config to include params for all specified keys,
* defaulting to StringParam if not found in the inheritedParams
* map.
*/
export declare function extendParamConfigForKeys(baseParamConfigMap: QueryParamConfigMap, paramKeys: string[], inheritedParams?: QueryParamOptions['params'] | undefined, defaultParam?: QueryParamConfig<any> | undefined): QueryParamConfigMap;