Skip to content

Type reference to Image resolves to static side #34803

Open
@sandersn

Description

@sandersn
/**
 * @param {Image} i
 * @param {Element} l
 */
function f(i, l) {
    l.appendChild(i);
    i.style.display = 'none';
}

Expected: i should (1) have type Image (2) be assignable to Node and (3) should have the property style.

Actual: i: new (width?: number, height?: number) => HTMLImageElement, which is not assignable to Node and doesn't have the property style.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specifically

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions