In lib.d.ts hasn't signature for formData types (Fetch API) #14378
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 2.2.1
After adding typings for Fetch API in core typescript I got an error Property 'formData' does not exist on type 'Response'. Because in lib.dom.d.ts I see:
interface Body {
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
json(): Promise<any>;
text(): Promise<string>;
}
But for typings whatwg-fetch:
interface Body {
readonly bodyUsed: boolean;
arrayBuffer(): Promise<ArrayBuffer>;
blob(): Promise<Blob>;
formData(): Promise<FormData>;
json(): Promise<any>;
json<T>(): Promise<T>;
text(): Promise<string>;
}
And this types in Fetch API spec https://fetch.spec.whatwg.org/#body
I sent a PR to the repository TSJS-lib-generator
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Activity
mhegazy commentedon Mar 1, 2017
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes.
alfaslash commentedon Mar 6, 2017
My PR was merged.
mhegazy commentedon Mar 6, 2017
We still need to port the changes from https://github.com/Microsoft/TSJS-lib-generator. keeping it open until a new drop is ported.