Skip to content

Instantly share code, notes, and snippets.

@jjrv
Created November 13, 2015 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjrv/e52e16e3a3efcc2984c2 to your computer and use it in GitHub Desktop.
Save jjrv/e52e16e3a3efcc2984c2 to your computer and use it in GitHub Desktop.
import {hello} from './src/test';
hello();
// Save in src/test.d.ts
declare module test {
export var hello: any;
}
export = test;
// This also works, replacing all of the above:
// export declare var hello: any;
// Save in src/test.js
exports.hello = function () { console.log('Hello, World!'); };
{
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"target": "es5"
},
"files": [
"run.ts"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment