Skip to content

In lib.d.ts hasn't signature for formData types (Fetch API) #14378

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alfaslash opened this issue Mar 1, 2017 · 3 comments
Closed

In lib.d.ts hasn't signature for formData types (Fetch API) #14378

alfaslash opened this issue Mar 1, 2017 · 3 comments
Assignees
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this

Comments

@alfaslash
Copy link

alfaslash commented Mar 1, 2017

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

@mhegazy mhegazy added Help Wanted You can do this Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript labels Mar 1, 2017
@mhegazy mhegazy added this to the Community milestone Mar 1, 2017
@mhegazy
Copy link
Contributor

mhegazy commented 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.

@mhegazy mhegazy added the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Mar 2, 2017
@mhegazy mhegazy self-assigned this Mar 2, 2017
@mhegazy mhegazy modified the milestones: TypeScript 2.3, Community Mar 2, 2017
@alfaslash
Copy link
Author

My PR was merged.

@mhegazy mhegazy reopened this Mar 6, 2017
@mhegazy
Copy link
Contributor

mhegazy commented 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.

@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Mar 22, 2017
@zhengbli zhengbli removed the Fixed in TSJS repo Fix merged in https://github.com/Microsoft/TSJS-lib-generator, but not ported yet label Mar 23, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Fixed A PR has been merged for this issue Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

3 participants