Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export declare namespace doesn't generate Import #396

Open
Booksbaum opened this issue Mar 26, 2021 · 0 comments
Open

export declare namespace doesn't generate Import #396

Booksbaum opened this issue Mar 26, 2021 · 0 comments

Comments

@Booksbaum
Copy link
Contributor

export namespace N1 {
    const c1: number;
}
export declare namespace N2 {
    const c1: number;
}

==>

let [<Import("N1","module")>] n1: N1.IExports = jsNative

module N1 =

    type [<AllowNullLiteral>] IExports =
        abstract c1: float

module N2 =

    type [<AllowNullLiteral>] IExports =
        abstract c1: float

-> no Import for N2

Splitting export and declare generates Import:

declare namespace N3 {
    const c1: number;
}
export = N3

==>

let [<Import("*","module")>] n3: N3.IExports = jsNative

module N3 =

    type [<AllowNullLiteral>] IExports =
        abstract c1: float

module handles declare:

export module M1 {
    const c1: number;
}
export declare module M2 {
    const c1: number;
}

==>

let [<Import("M1","module")>] m1: M1.IExports = jsNative
let [<Import("*","module")>] m2: M2.IExports = jsNative

module M1 =

    type [<AllowNullLiteral>] IExports =
        abstract c1: float

module M2 =

    type [<AllowNullLiteral>] IExports =
        abstract c1: float
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant