我只想导出 Typescript 模块中的所有内容,例如我声明一个这样的模块:
/// <reference path='../d.ts/DefinitelyTyped/node/node.d.ts' />
/// <reference path='../d.ts/DefinitelyTyped/express/express.d.ts' />
/// <reference path='../d.ts/DefinitelyTyped/mongoose/mongoose.d.ts' />
import express = require("express");
import mongoose = require("mongoose");
export module Users {
export var users: Express = express();
export var base_URL: string = "/users";
users.get(base_URL, (req, res) => {
res.render("index", {
title: "Cheese cakes"
});
});
}
现在,如您所见,为了访问base_URL
and users
,我还需要明确地导出它们。我能说什么,我想导出模块内的所有内容。