diff --git a/README.md b/README.md index ed78af25..9d1a9a3b 100644 --- a/README.md +++ b/README.md @@ -2161,7 +2161,8 @@ Returns a new `AxiosHeaders` instance. ### AxiosHeaders#toJSON(asStrings?) ``` -toJSON(asStrings?: boolean): RawAxiosHeaders; +toJSON(asStrings: true): Record; +toJSON(asStrings?: false): Record; ``` Resolve all internal header values into a new null prototype object. diff --git a/index.d.cts b/index.d.cts index 30b093ef..2e17a8e4 100644 --- a/index.d.cts +++ b/index.d.cts @@ -66,7 +66,9 @@ declare class AxiosHeaders { ...targets: Array ): AxiosHeaders; - toJSON(asStrings?: boolean): axios.RawAxiosHeaders; + toJSON(asStrings: true): Record; + toJSON(asStrings?: false): Record; + toJSON(asStrings?: boolean): Record; static from(thing?: AxiosHeaders | axios.RawAxiosHeaders | string): AxiosHeaders; diff --git a/index.d.ts b/index.d.ts index a43f3865..7304f5fa 100644 --- a/index.d.ts +++ b/index.d.ts @@ -47,7 +47,9 @@ export class AxiosHeaders { ...targets: Array ): AxiosHeaders; - toJSON(asStrings?: boolean): RawAxiosHeaders; + toJSON(asStrings: true): Record; + toJSON(asStrings?: false): Record; + toJSON(asStrings?: boolean): Record; static from(thing?: AxiosHeaders | RawAxiosHeaders | string): AxiosHeaders;