Skip to content

Instantly share code, notes, and snippets.

@Petah
Created August 19, 2015 08:09
Show Gist options
  • Select an option

  • Save Petah/96cb895bec02867ad111 to your computer and use it in GitHub Desktop.

Select an option

Save Petah/96cb895bec02867ad111 to your computer and use it in GitHub Desktop.
TypeScript interface, function, variable
/// <reference path="some-name.ts" />
/// <reference path="master.ts" />
import * as someName from 'someName';
someName('grr', 'arr', 'arg');
C:\work\temp\ts>tsc
master.ts(1,27): error TS2307: Cannot find module 'someName'.
interface someName {
(...args: any[]): someName;
}
declare var someName: someName;
export = someName;
{
"compilerOptions": {
"module": "commonjs",
"target": "ES5",
"out": "dist.js",
"sourceMap": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment