Skip to content

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

Closed

Description

@tomtung

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

Activity

  1. danquirk commented on Oct 23, 2014

    @danquirk
    Member

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

  2. added this to the milestone on Oct 24, 2014
  3. modified the milestones: TypeScript 1.5, , TypeScript 1.6 on Mar 24, 2015
  4. darrylring commented on May 25, 2015

    @darrylring

    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?

  5. mhegazy commented on May 25, 2015

    @mhegazy
    Contributor

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

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

  6. 3 remaining items

  7. mhegazy commented on Oct 20, 2015

    @mhegazy
    Contributor

    Zhengbo Li (@zhengbli) can we get this in soon?

  8. zhengbli commented on Oct 20, 2015

    @zhengbli

    Sure I'll send a PR soon.

  9. locked and limited conversation to collaborators on Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueRevisitAn issue worth coming back to

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions