Skip to content

Commit 83e8887

Browse files
committed
feat: make backwards compatible for TS <4.1
1 parent cef2332 commit 83e8887

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@
7575
"optional": true
7676
}
7777
},
78+
"typesVersions": {
79+
"<4.1": { "types/*": ["types/ts3.8/*"] }
80+
},
7881
"devDependencies": {
7982
"@babel/cli": "^7.11.6",
8083
"@babel/core": "^7.11.6",

src/ts3.8/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { useQueries } from './useQueries'
2+
export { useQueries }
3+
4+
export * from '..'

src/ts3.8/useQueries.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { UseQueryOptions, UseQueryResult } from '../react/types'
2+
3+
/**
4+
* Backwards-compatible definition for TS < 4.1
5+
*/
6+
export declare function useQueries(queries: UseQueryOptions[]): UseQueryResult[]

tsconfig.types.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"./src/persistQueryClient-experimental/index.ts",
1717
"./src/createWebStoragePersistor-experimental/index.ts",
1818
"./src/createAsyncStoragePersistor-experimental/index.ts",
19-
"./src/broadcastQueryClient-experimental/index.ts"
19+
"./src/broadcastQueryClient-experimental/index.ts",
20+
"./src/ts3.8/index.ts"
2021
],
2122
"exclude": ["./src/**/*"]
2223
}

0 commit comments

Comments
 (0)