Skip to content
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

TypeScript doesn't recognise Uint8ClampedArray #1995

Closed
webbedspace opened this issue Feb 10, 2015 · 4 comments
Closed

TypeScript doesn't recognise Uint8ClampedArray #1995

webbedspace opened this issue Feb 10, 2015 · 4 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 Revisit An issue worth coming back to

Comments

@webbedspace
Copy link

var a = new Uint8Array(7); works, var a = new Uint8ClampedArray(7); produces an error.

@danquirk danquirk added Bug A bug in TypeScript Domain: lib.d.ts The issue relates to the different libraries shipped with TypeScript Revisit An issue worth coming back to labels Feb 10, 2015
@webbedspace
Copy link
Author

I've since learned that setting ES6 as the compile target causes it to work... however, since the other array sizes work regardless, it's arguable that this is an unnecessary restriction.

@saschanaz
Copy link
Contributor

I hope there is an option to force the compiler use ES6 declarations while still giving ES5 output. There are browsers that natively support, for example, Promise, without full ES6 syntax support.

@mhegazy
Copy link
Contributor

mhegazy commented Feb 13, 2015

@saschanaz you can always augment your program with additional types that you know would exist on your target system. for instance, if you know you are always running on an engine that supports promises, just add declarations for Promise in your program. The idea is that the lib file reflects the baseline of engines supporting the target of the compilation (ES5 v.s. ES6)

@mhegazy mhegazy added this to the TypeScript 1.6 milestone Feb 13, 2015
@mhegazy mhegazy self-assigned this Feb 13, 2015
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Apr 22, 2015
@mhegazy
Copy link
Contributor

mhegazy commented Apr 22, 2015

Type definitions added to lib.es6.d.ts

@mhegazy mhegazy closed this as completed Apr 22, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 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 Revisit An issue worth coming back to
Projects
None yet
Development

No branches or pull requests

4 participants