File tree Expand file tree Collapse file tree 3 files changed +37
-4
lines changed
Expand file tree Collapse file tree 3 files changed +37
-4
lines changed Original file line number Diff line number Diff line change 2020 "exports" : {
2121 "." : {
2222 "import" : {
23- "types" : " ./dist/query .d.ts" ,
24- "default" : " ./dist/query .js"
23+ "types" : " ./dist/index .d.ts" ,
24+ "default" : " ./dist/index .js"
2525 },
2626 "require" : {
27- "types" : " ./dist/query .d.cts" ,
28- "default" : " ./dist/query .cjs"
27+ "types" : " ./dist/index .d.cts" ,
28+ "default" : " ./dist/index .cjs"
2929 }
3030 },
3131 "./immutable" : {
Original file line number Diff line number Diff line change 1+ import type {
2+ ErrorResponseJSON ,
3+ FilterKeys ,
4+ PathsWithMethod ,
5+ SuccessResponseJSON ,
6+ } from "openapi-typescript-helpers" ;
7+ import type { SWRConfiguration , SWRResponse } from "swr" ;
8+
9+ export * from "./query.js" ;
10+
11+ export type RequestTypes <
12+ Paths extends object ,
13+ Path extends PathsWithMethod < Paths , "get" > ,
14+ Req = FilterKeys < Paths [ Path ] , "get" > ,
15+ Data = SuccessResponseJSON < Req > ,
16+ Error = ErrorResponseJSON < Req > ,
17+ Params = Req extends { parameters : infer P } ? P : never ,
18+ PathParams = Params extends { path ?: infer P } ? P : never ,
19+ QueryParams = Params extends { query ?: infer Q } ? Q : never ,
20+ HeaderParams = Params extends { header ?: infer H } ? H : never ,
21+ CookieParams = Params extends { cookie ?: infer C } ? C : never ,
22+ SWRConfig = SWRConfiguration < Data , Error > ,
23+ > = {
24+ Data : Data ;
25+ Error : Error ;
26+ PathParams : PathParams ;
27+ QueryParams : QueryParams ;
28+ Headers : HeaderParams ;
29+ Cookies : CookieParams ;
30+ SWRConfig : SWRConfig ;
31+ SWRResponse : SWRResponse < Data , Error , SWRConfig > ;
32+ } ;
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { defineConfig } from "tsup";
33export default defineConfig ( {
44 entryPoints : [
55 "src/immutable.ts" ,
6+ "src/index.ts" ,
67 "src/infinite.ts" ,
78 "src/mutate.ts" ,
89 "src/query.ts" ,
You can’t perform that action at this time.
0 commit comments