From b0b4398033e3bb9d81e87186e659859f6cecfb6c Mon Sep 17 00:00:00 2001 From: Jacob Baker-Kretzmar Date: Sat, 9 Nov 2024 12:11:47 -0500 Subject: [PATCH] Fix `queryParams` return type --- package-lock.json | 8 ++++++++ package.json | 1 + src/js/index.d.ts | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 9d86086e..0e7b914b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "qs": "~6.9.7" }, "devDependencies": { + "@types/qs": "^6.9.17", "jsdom": "^25.0.1", "microbundle": "^0.15.1", "prettier": "^3.3.3", @@ -2590,6 +2591,13 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/qs": { + "version": "6.9.17", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.17.tgz", + "integrity": "sha512-rX4/bPcfmvxHDv0XjfJELTTr+iB+tn032nPILqHm5wbthUUUuVtNGGqzhya9XUxjTP8Fpr0qYgSZZKxGY++svQ==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", diff --git a/package.json b/package.json index cac7a91d..29d5d830 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "qs": "~6.9.7" }, "devDependencies": { + "@types/qs": "^6.9.17", "jsdom": "^25.0.1", "microbundle": "^0.15.1", "prettier": "^3.3.3", diff --git a/src/js/index.d.ts b/src/js/index.d.ts index d1eec655..ddd20f8f 100644 --- a/src/js/index.d.ts +++ b/src/js/index.d.ts @@ -1,3 +1,5 @@ +import { ParsedQs } from 'qs'; + /** * A list of routes and their parameters and bindings. * @@ -166,7 +168,7 @@ interface Router { current(name: T, params?: ParameterValue | RouteParams): boolean; get params(): Record; get routeParams(): Record; - get queryParams(): Record; + get queryParams(): ParsedQs; has(name: T): boolean; }