fable-compiler/ts2fable

`export declare namespace` doesn't generate `Import`

Opened this issue · 0 comments

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