Skip to content

Commit dcb09d1

Browse files
BlockOGmolefrog
authored andcommitted
add types for useSearchParams in wouter-preact
1 parent e06a29f commit dcb09d1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

packages/wouter-preact/types/index.d.ts

+13
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,19 @@ export function useSearch<
178178
H extends BaseSearchHook = BrowserSearchHook
179179
>(): ReturnType<H>;
180180

181+
export type URLSearchParamsInit = ConstructorParameters<
182+
typeof URLSearchParams
183+
>[0];
184+
185+
export type SetSearchParams = (
186+
nextInit:
187+
| URLSearchParamsInit
188+
| ((prev: URLSearchParams) => URLSearchParamsInit),
189+
options?: { replace?: boolean; state?: any }
190+
) => void;
191+
192+
export function useSearchParams(): [URLSearchParams, SetSearchParams];
193+
181194
export function useParams<T = undefined>(): T extends string
182195
? StringRouteParams<T>
183196
: T extends undefined

0 commit comments

Comments
 (0)