10000 Do we need to use "declare" for type aliased in d.ts files? · Issue #1940 · microsoft/TypeScript · GitHub
[go: up one dir, main page]

Skip to content
Do we need to use "declare" for type aliased in d.ts files? #1940
Closed
@mpawelski

Description

@mpawelski

I read that declare is required for all top level non-interface elements (i.e. module, class, var) in a declaration .d.ts file.

But do we need it for type aliases too?

Right now this code in tests.d.ts file gives error:

interface ITest {
    foo: string;
    bar: string;
}


type IMyAlias = ITest;

A 'declare' modifier is required for a top level declaration in a .d.ts file.

For me type aliases are similar to interfaces in this case and should not require declare keyword.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issueSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0