如何在Typescript中使用jsdoc类型?
我开始在“明确类型化”中更新类型定义。我最近意识到ChartList中填充了JsDoc,其类型参数如下:如何在Typescript中使用jsdoc类型?,typescript,Typescript,我开始在“明确类型化”中更新类型定义。我最近意识到ChartList中填充了JsDoc,其类型参数如下: /** * Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them. * * @memberof Chartist.Svg * @cons
/**
* Chartist.Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.
*
* @memberof Chartist.Svg
* @constructor
* @param {String|Element} name The name of the SVG element to create or an SVG dom element which should be wrapped into Chartist.Svg
* @param {Object} attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.
* @param {String} className This class or class list will be added to the SVG element
* @param {Object} parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child
* @param {Boolean} insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element
*/
function Svg(name, attributes, className, parent, insertFirst) {
可以告诉Typescript使用JsDoc参数类型吗?如果没有,是否可以像上面那样从JsDoc生成声明文件?我发现了类似的第三方库,但我对官方的打字脚本立场很好奇。我在Typescript回购协议中也发现了这一点,该协议称大部分工作都已涵盖,但从相关问题来看,我并不清楚结果是什么。我认为它已经涵盖了@JeffMercado对于我正在编写的代码,我能够使用JsDoc/Typescript,但不能使用库代码(包含在package.json中)。如果这是我的问题的关键,我将非常感谢关于如何告诉编译器我的库代码中使用了JsDoc的说明。