zoukankan      html  css  js  c++  java
  • TypeScript 学习笔记-JSDoc

    使用JSDoc

     /**基础类型*/
     /**@type {string} */
    
     /**联合类型 */
     /**@type {string | number} */
    
     /**数组类型 */
     /**@type {string[]} */
     /**@type {Array.<string>} */
    
     /**对象字面量类型 */
     /**@type {a:string,b:number} */
    
     /**map-like 类型 */
     /**@type {Object.<string,number>} */
    
     /**array-like 类型 */
     /**@type {Object.<number,object>} */
    
     /**closure 语法 */
     /**@type {function(string,boolean):number} */
     /**TypeScript 语法 */
     /**@type {(a:string,b:string) => number} */
    
     /**函数类型 */
     /**@type {function} */
    
     /**任意类型 */
     /**@type {*} */
     /**@type {?} */
    
     /**导入类型 */
     /**@param {import('./a').Pet} */
     /**@typedef Pet {import("./a").Pet} */
     /**@type {Pet} */
    
     /**params语法类似于type,唯一区别于可选属性 ,arg可选且默认值为test*/
     /**@param [arg = 'test'] */
    
     /**返回值类型 */
     /**@return {string} */
    
     /**复杂类型 */
     /**@typedef {prop1:string,prop2:string,prop3?:number} SpecialType */
     /**@typedef {(prop1:string,prop2?:number) => number} Predicate*/
    
     /**泛型类型 */
     /**@template T */
     /**@param {T} */
     /**@return {T} */
     function id(x) {return x;}
    
     /**指定this的类型 */
     /**@this {HTMLElement} */
    
     
    /**基础类型*/
    /**@type{string} */

    /**联合类型 */
    /**@type{string | number} */

    /**数组类型 */
    /**@type{string[]} */
    /**@type{Array.<string>} */

    /**对象字面量类型 */
    /**@type{a:string,b:number} */

    /**map-like 类型 */
    /**@type{Object.<string,number>} */

    /**array-like 类型 */
    /**@type{Object.<number,object>} */

    /**closure 语法 */
    /**@type{function(string,boolean):number} */
    /**TypeScript 语法 */
    /**@type{(a:string,b:string) => number} */

    /**函数类型 */
    /**@type{function} */

    /**任意类型 */
    /**@type{*} */
    /**@type{?} */

    /**导入类型 */
    /**@param{import('./a').Pet} */
    /**@typedefPet {import("./a").Pet} */
    /**@type{Pet} */

    /**params语法类似于type,唯一区别于可选属性 ,arg可选且默认值为test*/
    /**@param [arg = 'test'] */

    /**返回值类型 */
    /**@return{string} */

    /**复杂类型 */
    /**@typedef{prop1:string,prop2:string,prop3?:number}SpecialType */
    /**@typedef{(prop1:string,prop2?:number) => number}Predicate*/

    /**泛型类型 */
    /**@templateT */
    /**@param{T} */
    /**@return{T} */
    function id(x) {return x;}

    /**指定this的类型 */
    /**@this{HTMLElement} */

     
  • 相关阅读:
    socket套接字
    popen:让进程看似文件
    fdopen:让文件描述符像文件一样使用
    计算机"右击"管理,不出现界面,解决方案
    javaEE版本的eclipse中导入工程,发现server里面找不到工程,根本发布不了也不能运行
    初识springMVC
    数据库系统
    Red hat 下nfs服务器的搭建
    Linux下MySQL安装和配置
    复习Hibernate(1)
  • 原文地址:https://www.cnblogs.com/goOtter/p/9774567.html
Copyright © 2011-2022 走看看