Skip to content

How to define a global variable in a typescript module, which could be used in other modules directly without import? #18237

@acrazing

Description

@acrazing

Currently, we have two ways to define a global variable, the first one is use @types define it, and the second one is use declare global in a module. But the first one method need to publish to @types, which is just for modules written in javascript, and the second one need to import to use it. Is there any way to define a variable in a typescript module which could be invoked in other modules directly?

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