模块
JavaScript 在处理模块化代码的不同方法方面有着悠久的历史。 TypeScript 自 2012 年问世以来,已经实现了对许多这些格式的支持,但随着时间的推移,社区和 JavaScript 规范已经融合到一种称为 ES 模块(或 ES6 模块)的格式上。您可能知道它是 import
/export
语法。
ES Modules 于 2015 年被添加到 JavaScript 规范中,到 2020 年在大多数 Web 浏览器和 JavaScript 运行时得到广泛支持。
作为重点,该手册将涵盖 ES 模块及其流行的前驱 CommonJS module.exports =
语法,您可以在 模块 下的参考部分中找到有关其他模块模式的信息。
JavaScript 模块是如何定义的
在 TypeScript 中,就像在 ECMAScript 2015 中一样,任何包含顶级 import
或 export
的文件都被视为一个模块。
相反,没有任何顶级导入或导出声明的文件被视为其内容在全局作用域内可用的脚本(因此也可用于模块)。
/KPtktYjXS40Eyr7imJJj6qbzjlWa89B+VeBGfrO4dVib9Ph8VSMnXbk6/PwYZ5hxxvoH9/mh8D71i/UfTgODIgcx5syqDs1XzFaYanRz+sIuD+CM3wITj3GFLgbDG+jB12zOb8CXkr9yetklKq7EcmGT144CBJAo+RQCPck7YIEvI5/OUynWh+TRGm7nHGv/36/bOMa5Q4ecsvaVrsEalF6BAk7IY+6U3mpevNL4/SwsrcnyNmE80SPh5kW52+bpi6AqjvgBOM8SGm+vZ96ukGeGu8/yl3Luu4Q03plyqrcFhFKfpWKE9Txi2/0JvgzurPKpt+9EEYEUJcMDwDKkrBFgoNh9lpSgkYT0qwsvUPVRtsYt+0N8ubRO/tpG80RxZHf7MaAFKsmQ1T2k7IOqIATJg8BG57rlZ6JqDSm0PteIUrWpxRYz8Xw9D74uVaFT6unDDSiDDdhmX0rjTDA5g==
非模块
nGHFaXzv4jM1JynbZqMSRw6+Q7RMtEIZvn7grB1oJG37xoXjqzy1XWW5IEEeJNchMDEBLP7XpuA1ncJRZtyOxidCrGe5OTO9dcwvAF3bw2txZx1Tc/nRXznniuMLKJ6AtrdtkYj+z1yl4o1j9KL/32QcfpSjfWqOlyvvxvv6+lb5jm2cgA+e6JxS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RN8l5GlaLpSRjPCiqFXKiVGstX6Zwm9kP60RWBrBblSpE=
- e7mjKzBH5dfaeczH03Tb7k4XBNQHRMcu8vgMkiEWZzX5ty0VLR0IgzRFkYanzlZDDC4UseSD1WBmJw1lj3I6uxuUd7+P88/1z6zThJeW9w1A2WWw0IC9PSXvvnIk6bULCA4zXugiPjJ2olps3br0jItOTWb4b+uDgqSYytkm0duxyeorhh1uV5S03GRUg/4L1ZzgERCXz5l2m8nTcqlPJ+jOQ3d3jDCT5l9428AhNiZydmcBRrpwGo+BC+VMXdcpz9vsfTa0ZH1Z/otavFFWA7fjTfzs6aR73H5FHXD/Vg6/oXqXdSBuAGAQWzZL6FD/25ZGV9SCNfw0Sh5QjWklusyxsPKny5D9IMi1f0h6ZyDxeAPxyhT0n52CXB6iPFECd87Vkin42UXi1zEFCXl86g==
ES 模块语法
MsLHSmnBqOQia4adn28q0Dd4zK5irrfUQaz1VGDfE3lFu5EZlpD+8oQ9GGY3KnkOn2hFxy36xp+EbHZ7EviN9v99ShTq3tuQdiQuWmPMnkg=
// @filename: hello.ts
export default function helloWorld() {
console.log("Hello, world!");
}
XwGgMzOXsEvRPn3TW73kWezSLfu/s1kx0mw7qhlcuEBSgFAyXIdllhJ3C9f75heJ
// @filename: hello.ts
export default function helloWorld() {
console.log("Hello, world!");
}
// @filename: index.ts
import helloWorld from "./hello.js";
helloWorld();
FWLvvUduvDKM9dIlefqhhRS6iesx9ajxiEg3KCD/E8f9mvplWuIzGZLDbiWsgJwkA/3ApxEVbDpVvCnMD3fVJlZvOc4FaJYKBJ0aRe2gc5IDgAbh4qpIO7qEo6f80Mpv9/BQrqEz0nK2wNnNbvPg7rcve+pBExQFMv0yVkPNTYyHj7aOZZgkkqdQkIvbR5Hf
// @filename: maths.ts
export var pi = 3.14;
export let squareTwo = 1.41;
export const phi = 1.61;
export class RandomNumberGenerator {}
export function absolute(num: number) {
if (num < 0) return num * -1;
return num;
}
tOVZWICltawrGnrIVLhB+/D7HJduq4VZzM2AaMOG7F1FD7r0ew874gH5D7eddMx0ZAFvhYBuJAqf7HG0fvWDgm3ok1lksOKPcZkRV8GcBMc=
// @filename: maths.ts
export var pi = 3.14;
export let squareTwo = 1.41;
export const phi = 1.61;
export class RandomNumberGenerator {}
export function absolute(num: number) {
if (num < 0) return num * -1;
return num;
}
// @filename: app.ts
import { pi, phi, absolute } from "./maths.js";
console.log(pi);
const absPhi = absolute(phi);
// ^?
附加导入语法
EGtaL5MA4nCg8FOI7TNsJ9stdKa8A3mLZwT5AFwXTxzBRhZI3x9k/ii/0L4dQoGXYFWNOS2h8j4fxOvHYmKLx3hlcZf5gcm8yhN4X+/UGXA=
// @filename: maths.ts
export var pi = 3.14;
// @filename: app.ts
import { pi as π } from "./maths.js";
console.log(π);
// ^?
xsXWafyHs3W0fxMy6DGgRA4/PeFxlR+9ZP0QMX20lI+RMb3CyprBn8v2Z8MsxWFGf7u4brrMgayVtQ6NqU4z53H10AFqGV6nKGXZJIoIByY=
// @filename: maths.ts
export const pi = 3.14;
export default class RandomNumberGenerator {}
// @filename: app.ts
import RandomNumberGenerator, { pi as π } from "./maths.js";
RandomNumberGenerator;
// ^?
console.log(π);
// ^?
uS+xbX2WSsPay93a8+3vWqqNFKlw4k5PQzQbU5Ns/GaopII20ljBwi3XKSYyIpQXNXPmgv9AcS+vJpKysEceqeAsQsNC7XQIQh8slcF3m5y+f423c0RhWOLLMBF/Ezpd
// @filename: maths.ts
export var pi = 3.14;
export let squareTwo = 1.41;
export const phi = 1.61;
export function absolute(num: number) {
if (num < 0) return num * -1;
return num;
}
// @filename: app.ts
import * as math from "./maths.js";
console.log(math.pi);
const positivePhi = math.absolute(math.phi);
// ^?
Ng1QCa4+U/CxB22ejKlc7FD7AdJLggbtr3+GwYv//4TQRpmm1eOeJuDDurjSk7T5qfCcyO75ZYY6LRRN4kOcI6PSrKBkXshKM2hqS9ulqPIuAK141HgQ3FPsFriLfZ3d5I7GOWPdCcy428Fo3Au/0w==
// @filename: maths.ts
export var pi = 3.14;
// @filename: app.ts
import "./maths.js";
console.log("3.14");
FIHnXqbZ3N6b9am60cs+C3OsOhknm1W9QTwfwLhA0toCtyHlSKxKECuFkzJjTF82u8TT9Zi/h6/bRhM06vg2ctCaz3QfqA6Pif94UfNWlg77K4S0t9dilxBDEgbZ9qgIkTlsDEJ1oHMKJVuETHEibRDzWAbJf4y38PeyoYCGC5ZXkMUr4PDoc/cgx9gYB2lp2Ha/Zzlvc4+jTJdfNv2dGiljz1vJEM3+Yep+klC5ZH0=
TypeScript 特定的 ES 模块语法
/CdZ/FqVTqzFVDUKyA+h0+hdkLwhbEYYQd4v12rIZ+wdFYCdYVZqllDVXoIVaQHys9zx+d7JzlGB/hoqggxe5DvfFWQu3lO2UPQtKU6W9MM=
// @filename: animal.ts
export type Cat = { breed: string; yearOfBirth: number };
export interface Dog {
breeds: string[];
yearOfBirth: number;
}
// @filename: app.ts
import { Cat, Dog } from "./animal.js";
type Animals = Cat | Dog;
zvKL4dxCIvOikGxZKsllR3LMOfNKLwYOYiAddVRQJoQVqeCjUkDe0tO3gVyvG9iJj6/yVi24t5vDNa1nYGFKwp2LWlN6EMAXQByArqUkL2T67GBDvvA6Vt57BGQC30nnHcG8fyNRgzD4RenkMePyDw==
import type
vtvge9QYDZ7TOKASDmYJ3Td3QFx9elnk3eJ/cFpn+VqlVptJ5KJcxhClOkr/8GzoNLoyoeUREhhs++eYQ2v1Yg==
// @filename: animal.ts
export type Cat = { breed: string; yearOfBirth: number };
export type Dog = { breeds: string[]; yearOfBirth: number };
export const createCatName = () => "fluffy";
// @filename: valid.ts
import type { Cat, Dog } from "./animal.js";
export type Animals = Cat | Dog;
// @filename: app.ts
import type { createCatName } from "./animal.js";
const name = createCatName();
内联 type 导入
Cgv1OEaCxDy2ONwcthIadBTHkE5Y43xAA6eb+W+E1CsH7f5ySc7PadbwpfbBoRBI8XorDGi0TipmSUuZV4PAevdeFXaQNjcszPIf34ysf40uE0wRTRgixQY48T3oGu9z3nfojHvEaZHKG+7QQJDSJb2djKGArfLZXSkLCjRDx3o=
// @filename: animal.ts
export type Cat = { breed: string; yearOfBirth: number };
export type Dog = { breeds: string[]; yearOfBirth: number };
export const createCatName = () => "fluffy";
// @filename: app.ts
import { createCatName, type Cat, type Dog } from "./animal.js";
export type Animals = Cat | Dog;
const name = createCatName();
wk3YgvndKh65brVHcaVCmQgXRNUkeaHhrow/MM2Qc+zV69NFgXVvSsm/0jT8THYQp95xdITZ71aJ3NucyRI/Zu+/3HOh5I4p/or1lYR1/iIospABVbi+EKou4qaM2gq+AgAIaoyti/x0GfOIRSCENAc0I3/JQvtIxZ32/Drj2V0=
具有 CommonJS 行为的 ES 模块语法
OxAuoIpAfoYzoz5G8LVQnSYk4AlKdKGSVG4iT8s8Vk4oGP09bLm8VnWCR001PsE64aUsgK0z70Ypk+vbU48ndTPYGIp8KPqVwOwufAgv+jBdgs6KtgGlOiin8c85FCqfX0lN8IIAG5QfN6ppcTzjTz9yQxwp6Au4fUNh6fLtraAtDvulisfTX1uVNw/OueAzACnpMVkGaIVUlbamQ/bxBPQVH9jqE+ekxZY3DO1kwN68orM/yXg1FgUlUnlO76xlJLFSmfzPVrR2mscaeRNalCzb1TcB/zyDHLoeXeYn7ZFbzoGGJFfWsifCO7/8sLbl08PD21aFgVDz2bNNmP7xbb3srUhHB7pcTgmF7cKPhK6IMSoZFqEy5acQbBvcyFMC
/// <reference types="node" />
import fs = require("fs");
const code = fs.readFileSync("hello.ts", "utf8");
yGUKk0TfbWtSbiAu+ai9aDWYa4dej8wFTQWjZXSX0DW2R6TlI6dCoMOsN4nvnAPr9RpPYg3bxJOj48lCCGL5lubQSvGp9Nd8imvOv1WpyNY+waVceOhY9SAxz6tijdYyP7EObyQ4gOLoA1EC3afZ+/JNkLNPpuYo5Erhl95EHNM=
CommonJS 语法
UAafaYarKE0PQYl3JX3l4WlTY0zl5zQBF4mLQeVoj/j1noBqFc2IYgFk/XoUapxNnF631GpEIul229emvTWQwLGB7sJ42efpp7iv5eulN+KWmNLpMUO3S9ftXwEhnimFOoMJ005Vhy4NwPYDerm8Qiq9YDCKO99OlF45YSfAvnF11YC6uvcXhdPqHXEeHhzMSWvxry+zCnLkMhbLSjqdk3EcgJm2vucg1/j/ceFeUMaEyQHIh03pVoIWOP0NPUpBKJnubGlRa79NNnbUa+OOcGFy1yYQFoYt2xbvuUoATiI=
导出
gihtQSXlvjX9Nn+AwL0LTyGKeFpLwVeL6qV9HTBrhKqLouGLRBHnaaniXjFmo6grzQRXPyk1tOnR7rrUy8dNKVCurhsxbAgaJwcxPScTICHMNs7ywyAE7NO7YzqURbXx0lDF+H9TORsef13fPEw34A==
/// <reference types="node" />
function absolute(num: number) {
if (num < 0) return num * -1;
return num;
}
module.exports = {
pi: 3.14,
squareTwo: 1.41,
phi: 1.61,
absolute,
};
U131VJLZDOt/qlS9H4/iQ9X6veQYxtkQ6id4UoY71CQGuG9KISxb3Rga/IXeLtWW25QVXLl3KtgMEvtMPkBmlQo42H5GtC0syR1xljXHL4Q=
// @filename: maths.ts
/// <reference types="node" />
function absolute(num: number) {
if (num < 0) return num * -1;
return num;
}
module.exports = {
pi: 3.14,
squareTwo: 1.41,
phi: 1.61,
absolute,
};
// @filename: index.ts
const maths = require("maths");
maths.pi;
// ^?
NtxuL/b2hag/TC7fk4Oikv54yCB75vfPf7E3mXaPFMVPQU0G27eJ3FKVOitgA8iclJJec/jx9EK5LxyYzxf7HlZ7W4xvSgYsEK1tTjp0kh8=
// @filename: maths.ts
/// <reference types="node" />
function absolute(num: number) {
if (num < 0) return num * -1;
return num;
}
module.exports = {
pi: 3.14,
squareTwo: 1.41,
phi: 1.61,
absolute,
};
// @filename: index.ts
const { squareTwo } = require("maths");
squareTwo;
// ^?
CommonJS 和 ES 模块互操作
y16gZKWv3LuEZtmqumeF/y33RC4Snw4gqArb9wyJ589TyMsmu9/ovxPZSOe1zYh/ynXtY6DfwtPJVMyKvBzl/KLkPQskU0u2txzR2wNxFQSCKTDSFseUzoypwKuOCumTP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SljmKNl3F+ZkxSI6ALyFsosW1UgotuCTrTI3Qhdk5RkLqBwcSPedRrsJqW94Q=
// @filename: constants.ts
export const valueOfPi = 3.142;
// @filename: index.ts
import { valueOfPi } from "./constants.js";
export const twoPi = valueOfPi * 2;
ES2020
import { valueOfPi } from "./constants.js";
export const twoPi = valueOfPi * 2;
CommonJS
import { valueOfPi } from "./constants.js";
export const twoPi = valueOfPi * 2;
UMD
import { valueOfPi } from "./constants.js";
export const twoPi = valueOfPi * 2;
ra0E9rNcXzpseb4MpVHTuJh4UgaWEjF9ctFtzbo8QpeL+OCSLoaSDpHpi6OWxnXZM5OYQQhjY4zOv2HHIw+ozj76ZkFR89u71tAZ93jAShA=
OO4/qNqij9hoYVydCu5Y0grd53jFNYiC5koipBoGXpTGM13OXSQXdGJqRaNiVgMOjpGgHpDXhLvFObshmP5H/ZdvaNDOxzgvr4SrKVpE3hi0d3+7Wo2f53fv9TDF1k5NDNU/ngs/JSLJddttAZCrl9Gks+G0oCS3oomVMymlE8zlWXzFNUIWzyAv+Xtl5MfLJKewy5Oya3cnPMLCVb/8hsc0OntdhDm+DYnmYviMJ6HSSMAkEgU9fcqquj0LZrjb
TypeScript 命名空间
kmspCHTCI2psSV3mTFuJS0zGzsBXgXKt9IGP7HrORUhJ3hMYYbFEyhYTdUDTI7kUJ8JaiA/XXJpDYbKuwyHd2021jf3XYCOkciYDcFyLCLnmgnz3wPn6slCyGULKUTaI3Y8hyuuDYvnoCzoPFoQ0+E+WZ76HNdnnUdwybtuMdqGEGqQNz3ILSxXPtYbNqSdVPOubTj8+PFiMzLrk9I+vchLU1ebfVxUTXdpHmqzkySwxtTT/c/YTWoYYl0bB9CwJ8y1wqBleRLMIesJ4Z4SLgwv6ClMZgxkbkVsGLtrBlMkHNuBJSSznrB6mYQzw6c0u79CRuNRzYSAr8SzEis7S0D8CT9z69AQBrLih+LOjd8vkpgW6qPzoOI8/KPrkoIgqPdaPBeLE/d9bH5U57Jd7PmniA0cSyVN4H4+if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