5

Trying to migrate from old tsd.json to typings.json. Previous my .d.ts had:

declare var modname: modname.modname;

declare module modname {
    export interface modname {
        new (): modname;
    }

    export interface foo {
        bar: string;
    }
}

declare module "mod-name" {
    export = modname;
}

Then due to errors I changed the first lines to:

declare var modname: modname.modname;

declare namespace modname {

But then got:

TS2665: Module augmentation cannot introduce new names in the top level scope.

Maybe I am meant to install the Typings differently? - I notice strange scaffolding being automatically added to my definition files, which are installed with:

typings install github:user/typ/mod-name/mod-name.d.ts --save
A T
  • 13,008
  • 21
  • 97
  • 158

1 Answers1

-3

TS2665: Module augmentation cannot introduce new names in the top level scope.

This no longer an error in the Latest Master version of typescript npm install typescript@next

Consider using this version for various reasons : https://basarat.gitbooks.io/typescript/content/docs/getting-started.html#nightly-typescript

basarat
  • 261,912
  • 58
  • 460
  • 511
  • Thanks, trying with `@next` now. Results: reverted syntax and got `TS2666: Exports and export assignments are not permitted in module augmentations.` from the `export = modname;` line. – A T May 05 '16 at 01:14