UNPKG

react-use-query-params

Version:

Strongly typed, routing-library agnostic react hook to use and manipulate query params

7 lines 662 B
export type TDefaultParamsObject = Record<string, any>; export type TAllParams<PARAMS extends TDefaultParamsObject> = { [key in keyof PARAMS]: string[]; }; export declare function applyQueryParams<PARAMS extends TDefaultParamsObject>(target: URL | URLSearchParams, queryParams: Partial<TAllParams<PARAMS>>, removeExtras?: boolean): URL | URLSearchParams; export declare function useQueryParams<PARAMS extends TDefaultParamsObject = TDefaultParamsObject>(): readonly [TAllParams<PARAMS>, (nextParams: TAllParams<PARAMS> | ((current: TAllParams<PARAMS>) => Partial<TAllParams<PARAMS>>), replace?: boolean) => void]; //# sourceMappingURL=useQueryParams.d.ts.map