Skip to content

[lib.d.ts BUG] new window.Image(); //ERROR: Property 'Image' does not exists on type 'Window' #10241

@jhm-ciberman

Description

@jhm-ciberman

TypeScript Version: atom-typescript

Code

new Image(); //works
new window.Image(); //ERROR: Property 'Image' des not exists on type 'Window'

Expected behavior:
Image constructor should exists in window object

Actual behavior:
Image constructor does not exists in window object

Other Info:
I actually ussing nw.js so I can't access to the window object directly:

function newImage( win: Window): Image {
    return new win.Image(); //ERROR: Property 'Image' des not exists on type 'Window'
}

If I cast win as any, it works, but I loose the Typescript typing feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions