Skip to content

Commit 3d1a62e

Browse files
grzdevTkDodo
andauthored
fix(devtools): change onClose callback type from () => unknown to () … (#10118)
* fix(devtools): change onClose callback type from () => unknown to () => void * Fix onClose callback type in devtools Updated onClose callback type in devtools to improve type safety. * chore(changeset): fixed truncated changeset description --------- Co-authored-by: Dominik Dorfmeister <[email protected]>
1 parent fe287cc commit 3d1a62e

10 files changed

Lines changed: 19 additions & 9 deletions

File tree

.changeset/chatty-socks-act.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@tanstack/angular-query-experimental": patch
3+
"@tanstack/query-devtools": patch
4+
"@tanstack/react-query-devtools": patch
5+
"@tanstack/solid-query-devtools": patch
6+
"@tanstack/vue-query-devtools": patch
7+
---
8+
9+
fix(devtools): change onClose callback type from () => unknown to () => void
10+

docs/framework/react/devtools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function App() {
124124
- Default: `{ height: '500px' }`
125125
- Example: `{ height: '100%' }`
126126
- Example: `{ height: '100%', width: '100%' }`
127-
- `onClose?: () => unknown`
127+
- `onClose?: () => void`
128128
- Callback function that is called when the devtools panel is closed
129129
- `client?: QueryClient`,
130130
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.

docs/framework/vue/devtools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function toggleDevtools() {
110110
- Default: `{ height: '500px' }`
111111
- Example: `{ height: '100%' }`
112112
- Example: `{ height: '100%', width: '100%' }`
113-
- `onClose?: () => unknown`
113+
- `onClose?: () => void`
114114
- Callback function that is called when the devtools panel is closed
115115
- `client?: QueryClient`,
116116
- Use this to use a custom QueryClient. Otherwise, the one from the nearest context will be used.

packages/angular-query-experimental/src/devtools-panel/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface DevtoolsPanelOptions {
4242
/**
4343
* Callback function that is called when the devtools panel is closed
4444
*/
45-
onClose?: () => unknown
45+
onClose?: () => void
4646

4747
/**
4848
* Element where to render the devtools panel. When set to undefined or null, the devtools panel will not be created, or destroyed if existing.

packages/query-devtools/src/Devtools.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ interface ContentViewProps {
8989
localStore: StorageObject<string>
9090
setLocalStore: StorageSetter<string, unknown>
9191
showPanelViewOnly?: boolean
92-
onClose?: () => unknown
92+
onClose?: () => void
9393
}
9494

9595
interface QueryStatusProps {

packages/query-devtools/src/TanstackQueryDevtoolsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type { Signal } from 'solid-js'
1818
export interface TanstackQueryDevtoolsPanelConfig extends QueryDevtoolsProps {
1919
styleNonce?: string
2020
shadowDOMTarget?: ShadowRoot
21-
onClose?: () => unknown
21+
onClose?: () => void
2222
}
2323

2424
class TanstackQueryDevtoolsPanel {

packages/query-devtools/src/contexts/QueryDevtoolsContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export interface QueryDevtoolsProps {
2929
initialIsOpen?: boolean
3030
errorTypes?: Array<DevtoolsErrorType>
3131
shadowDOMTarget?: ShadowRoot
32-
onClose?: () => unknown
32+
onClose?: () => void
3333
hideDisabledQueries?: boolean
3434
theme?: Theme
3535
}

packages/react-query-devtools/src/ReactQueryDevtoolsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface DevtoolsPanelOptions {
3434
/**
3535
* Callback function that is called when the devtools panel is closed
3636
*/
37-
onClose?: () => unknown
37+
onClose?: () => void
3838
/**
3939
* Set this to true to hide disabled queries from the devtools panel.
4040
*/

packages/solid-query-devtools/src/devtoolsPanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export interface DevtoolsPanelOptions {
3434
/**
3535
* Callback function that is called when the devtools panel is closed
3636
*/
37-
onClose?: () => unknown
37+
onClose?: () => void
3838
/**
3939
* Set this to true to hide disabled queries from the devtools panel.
4040
*/

packages/vue-query-devtools/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export interface DevtoolsPanelOptions {
7979
/**
8080
* Callback function that is called when the devtools panel is closed
8181
*/
82-
onClose?: () => unknown
82+
onClose?: () => void
8383
/**
8484
* Set this to true to hide disabled queries from the devtools panel.
8585
*/

0 commit comments

Comments
 (0)