兼收并蓄 TypeScript - 第三方库: 类型声明

源码 https://github.com/webabcd/TypeScriptDemo
作者 webabcd

兼收并蓄 TypeScript - 第三方库: 类型声明

示例如下:

third\typeDeclaration.ts

/*
 * 类型声明用于 TypeScript 调用 JavaScript
 * 类型声明定义在 .d.ts 声明文件中
 * 比如 aes.js 文件,其对应的声明文件为 aes.d.ts
 * .d.ts 文件是仅包含类型信息的声明文件,它不会被编译为 .js 文件,它的作用是让 TypeScript 编译器能够对相关的 .js 代码进行类型检查和代码提示
 * 
 * 
 * 类型声明的相关语法有 declare var, declare function, declare class, declare enum, declare namespace, declare global, declare module, /// <reference /> 等
 */

源码 https://github.com/webabcd/TypeScriptDemo
作者 webabcd

posted @ 2024-09-20 12:27  webabcd  阅读(0)  评论(0编辑  收藏  举报