Skip to content

ImageData.data should be a Uint8ClampedArray, not a number[] #949

New issue

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

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

Already on GitHub? # to your account

Closed
tomtung opened this issue Oct 23, 2014 · 5 comments
Closed

ImageData.data should be a Uint8ClampedArray, not a number[] #949

tomtung opened this issue Oct 23, 2014 · 5 comments
Labels
Breaking Change Would introduce errors in existing code 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 Revisit An issue worth coming back to

Comments

@tomtung
Copy link

tomtung commented Oct 23, 2014

In version 1.0.1, ImageData.data was a Uint8Array. In version 1.1 it becomes a number[]. Seems like it should be a Uint8ClampedArray.

Reference:
https://developer.mozilla.org/en-US/docs/Web/API/ImageData#Browser_compatibility

@danquirk danquirk added Bug A bug in TypeScript Revisit An issue worth coming back to labels Oct 23, 2014
@danquirk
Copy link
Member

We'll be taking a look at a bunch of lib.d.ts bugs all together in the future.

@sophiajt sophiajt added this to the Suggestions milestone Oct 24, 2014
@sophiajt sophiajt removed the Bug A bug in TypeScript label Oct 24, 2014
@mhegazy mhegazy added the Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript label Dec 2, 2014
@mhegazy mhegazy added the Bug A bug in TypeScript label Mar 24, 2015
@mhegazy mhegazy modified the milestones: TypeScript 1.5, Suggestions, TypeScript 1.6 Mar 24, 2015
@darrylring
Copy link

Other than simply leaving an ImageData object untyped, is there a workaround for this?

A complication here is that Firefox 38 already uses an ES6 Uint8ClampedArray for ImageData.data but doesn't support ES6's class. Maybe this is a separate issue, but is it possible to use es6.d.ts while still emitting ES5 JavaScript?

@mhegazy
Copy link
Contributor

mhegazy commented May 25, 2015

is it possible to use es6.d.ts while still emitting ES5 JavaScript?

@darrylring, yes. just add a reference to lib.es6.d.ts either on the commandline or using a /// reference.

@mhegazy
Copy link
Contributor

mhegazy commented Oct 20, 2015

@zhengbli can we get this in soon?

@zhengbli
Copy link
Contributor

Sure I'll send a PR soon.

@zhengbli zhengbli added Fixed A PR has been merged for this issue and removed Fixed in TSJS repo labels Dec 1, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Breaking Change Would introduce errors in existing code 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 Revisit An issue worth coming back to
Projects
None yet
Development

No branches or pull requests

6 participants