Skip to content

Commit 4670944

Browse files
authored
Fix type returned by end() (#85)
1 parent 498c67f commit 4670944

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ declare namespace LightMyRequest {
9797
payload: (payload: InjectPayload) => Chain
9898
query: (query: object) => Chain
9999
cookies: (query: object) => Chain
100-
end: (callback?: CallbackFunc) => Chain | Promise<Response>
100+
end: (callback?: CallbackFunc) => Promise<Response>
101101
}
102102
}
103103

test/index.test-d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ inject(dispatch)
7272
})
7373

7474
expectType<Chain>(inject(dispatch))
75+
expectType<Promise<Response>>(inject(dispatch).end())
7576
expectType<Chain>(inject(dispatch, { method: 'get', url: '/' }))
7677
// @ts-ignore tsd supports top-level await, but normal ts does not so ignore
7778
expectType<Response>(await inject(dispatch, { method: 'get', url: '/' }))

0 commit comments

Comments
 (0)