Skip to content

Commit

Permalink
fix: export ReadonlyURLSearchParams and add types to package.json fil…
Browse files Browse the repository at this point in the history
…es list
  • Loading branch information
wyattjoh committed Feb 15, 2023
1 parent 2862bb4 commit da910cf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/next/navigation-types/compat/navigation.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { ReadonlyURLSearchParams } from 'next/navigation'

declare module 'next/navigation' {
/**
* Get a read-only URLSearchParams object. For example searchParams.get('foo') would return 'bar' when ?foo=bar
Expand Down
2 changes: 2 additions & 0 deletions packages/next/navigation-types/navigation.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { ReadonlyURLSearchParams } from 'next/navigation'

declare module 'next/navigation' {
/**
* Get a read-only URLSearchParams object. For example searchParams.get('foo') would return 'bar' when ?foo=bar
Expand Down
2 changes: 2 additions & 0 deletions packages/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"types/global.d.ts",
"types/compiled.d.ts",
"image-types/global.d.ts",
"navigation-types/navigation.d.ts",
"navigation-types/compat/navigation.d.ts",
"font",
"navigation.js",
"navigation.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/client/components/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function readonlyURLSearchParamsError() {
return new Error('ReadonlyURLSearchParams cannot be modified')
}

class ReadonlyURLSearchParams {
export class ReadonlyURLSearchParams {
[INTERNAL_URLSEARCHPARAMS_INSTANCE]: URLSearchParams

entries: URLSearchParams['entries']
Expand Down

0 comments on commit da910cf

Please sign in to comment.