Skip to content

Commit e6f9026

Browse files
turisapShakirov Kirilljasonsaayman
authored
Fixing AxiosRequestHeaders typings (axios#4334)
Co-authored-by: Shakirov Kirill <ksshakirov@sberautotech.ru> Co-authored-by: Jay <jasonsaayman@gmail.com>
1 parent ee51e68 commit e6f9026

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

index.d.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
// TypeScript Version: 3.0
2-
export type AxiosRequestHeaders = Record<string, string | string[] | number | boolean>;
1+
// TypeScript Version: 4.1
2+
type AxiosHeaders = Record<string, string | string[] | number | boolean>;
3+
4+
type MethodsHeaders = {
5+
[Key in Method as Lowercase<Key>]: AxiosHeaders;
6+
};
7+
8+
interface CommonHeaders {
9+
common: AxiosHeaders;
10+
}
11+
12+
export type AxiosRequestHeaders = Partial<AxiosHeaders & MethodsHeaders & CommonHeaders>;
313

414
export type AxiosResponseHeaders = Record<string, string> & {
515
"set-cookie"?: string[]

0 commit comments

Comments
 (0)