TS2668
'export' modifier cannot be applied to ambient modules and module augmentations since they are always visible.
Info
Ambient modules
To describe the shape of libraries not written in TypeScript, we need to declare the API that the library exposes. We call declarations that donβt define an implementation βambientβ. Typically, these are defined in .d.ts files. If youβre familiar with C/C++, you can think of these as .h files.
Source: Modules - Introduction
Module Augmentation
With module augmentation, users have the ability to extend existing modules such that consumers can specify if they want to import the whole module or just a subset.
Source: TypeScript 1.8 Release Notes
Broken Code β
export module 'amplify' {
export function publish(topic: string, ...args: any[]): boolean;
}Fixed Code βοΈ
export function publish(topic: string, ...args: any[]): boolean;Usage
import amplify = require('amplify');