ENع
الدرس 13 · Advanced and in practice

Modules and declaration files

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

A TypeScript file with a top-level import or export is a module, and modules share code by exporting and importing names. Follow one small library, math.ts, as tsc --declaration splits it into two files: math.js, the code with the types removed, and math.d.ts, the types with the code removed. Then watch tsc check another module against the .d.ts file alone, catch a bad call, and Node.js run the result without ever loading the types.

11 دقيقة9 خطوات5 أسئلةAdvanced
شكل 13 · تفاعلي
جارٍ تحميل الرسم…
أو ← →

اختبار يتاح بعد الخطوة الأخيرة.