oauth-1.0a
oauth-1.0a copied to clipboard
Index signature missing for OAuth.Header (typescript)
Hi,
I am using the output of toHeader in the fetch API and I see the following error:
error TS2322: Type 'Header' is not assignable to type 'Record<string, string> | Headers | string[][] | undefined'.
Type 'Header' is not assignable to type 'Record<string, string>'.
Index signature is missing in type 'Header'.
136 headers: this.client.toHeader(body)
Any thoughts on how to fix it?
This seems to be an odd behavior with Typescript, Data, Header & Authorization interfaces need to be declared as a type instead of an interface. For now you can use headers: this.client.toHeader(body) as Record<string, string> while it's solved at library level.