Skip to content

import * as alias syntax doesn't work with export = function unless merged with namespace #5073

Description

declare module "foo"{functionfoo(): void;export=foo;}

Can't be included via import * as f from "foo";.
(test.ts(1,20): error TS2497: Module '"foo"' resolves to a non-module entity and cannot be imported using this construct.)
Whereas

declare module "foo"{functionfoo(): void;namespacefoo{}export=foo;}

Can be. The distinction seems artificial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    By DesignDeprecated - use "Working as Intended" or "Design Limitation" instead

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions