Difference between:
Export | Import |
---|---|
export = foo; |
import foo = require("./file"); // deprecated |
export default foo; |
import foo from "./file"; |
export foo; or: export {foo}; |
import {foo} from "./file"; |
export foo; export bar; or: export {foo, bar}; |
import {foo, bar} from "./file"; or: import * as Oops from "./file"; let foo = Oops.foo; let bar = Oops.bar; |
declare module "foo" {...}; |
import foo from "foo"; // Without relative path "./" in front, // TypeScript compiler will look for // an external module declaration. |