Creating typescript definition (.d.ts) file from multiple files which are using same namespace

Viewed 113

I am trying to create typescript definition (.d.ts) file from multiple files which are using same namespace as shown below but the problem occurs bec. of exporting files from index.ts.

Dog.ts

export namespace Animal {
 export class Dog {
     
 }
}

Fish.ts

export namespace Animal {
    export class Fish {
     
    }
}

index.ts (which helps to generate index.d.ts automatically when run typescript compiler)

export * from "./Dog";
export * from "./Fish";

Error: Module "./Dog" has already exported a member named 'Animal'. Consider explicitly re-exporting to resolve the ambiguity.

0 Answers
Related