-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
Let's say I'm writing a declaration file for a library that exports two external modules: myLib
and myLibWithExtras
. The myLibWithExtras
module is exactly myLib
but with some additional items.
As an example of what I'm trying to do:
// myLib.d.ts
declare module "myLib" {
function doSomething(): void;
}
declare module "myLibWithExtras" {
// this doesn't work
import myLib= require("myLib");
module myLib {
function doSomethingElse(): void;
}
export = myLib;
}
// consumer.ts
import myLib = require("myLib")
import myLibWithExtras = require("myLibWithExtras")
myLib.doSomething();
myLib.doSomethingElse(); // should not compile
myLibWithExtras.doSomething();
myLibWithExtras.doSomethingElse();
Is there any way to accomplish this?
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue