Skip to content

Commit

Permalink
Fixing AxiosRequestHeaders typings (#4334)
Browse files Browse the repository at this point in the history
Co-authored-by: Shakirov Kirill <ksshakirov@sberautotech.ru>
Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
3 people committed May 16, 2022
1 parent ee51e68 commit e6f9026
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions index.d.ts
@@ -1,5 +1,15 @@
// TypeScript Version: 3.0
export type AxiosRequestHeaders = Record<string, string | string[] | number | boolean>;
// TypeScript Version: 4.1
type AxiosHeaders = Record<string, string | string[] | number | boolean>;

type MethodsHeaders = {
[Key in Method as Lowercase<Key>]: AxiosHeaders;
};

interface CommonHeaders {
common: AxiosHeaders;
}

export type AxiosRequestHeaders = Partial<AxiosHeaders & MethodsHeaders & CommonHeaders>;

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

0 comments on commit e6f9026

Please sign in to comment.