Skip to content

Docs - I am able to add new add new items to top level scope, contrary to what doc mention. #37145

@zzxoto

Description

@zzxoto

Search Terms: Documentation

Typescript Version: 3.5.3

Documentation here and here mention, "Neither module augmentations nor global augmentations can add new items to the top level scope - they can only “patch” existing declarations.", however I am able to "add new items".

//file-a.ts
import * as moment from 'moment';
declare module "moment" {
  interface GoblyGoop {
      name: string;
  }
}
let y: moment.GoblyGoop;

//file-b.ts
import * as moment from 'moment';
let y: moment.GoblyGoop;

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsThe issue relates to how you learn TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions