babel-plugin-jsdoc-closure
Advanced tools
Comparing version 1.5.0 to 1.5.1
{ | ||
"name": "babel-plugin-jsdoc-closure", | ||
"version": "1.5.0", | ||
"version": "1.5.1", | ||
"description": "Transpiles JSDoc types from namepaths to types for Closure Compiler", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -117,3 +117,3 @@ # babel-plugin-jsdoc-closure | ||
### Convert JSDoc typedefs to Closure typedefs | ||
### Convert JSDoc object typedefs to Closure structural interfaces | ||
@@ -133,8 +133,12 @@ JSDoc uses a nice, documentable format for `{Object}` typedefs: | ||
```js | ||
/** | ||
* @typedef {{bar: (string), baz: (_types_Baz)}} | ||
*/ | ||
export let Foo; | ||
/** @interface */ | ||
export function Foo() {}; | ||
/** @type {(string)} */ | ||
Foo.prototype.bar; | ||
/** @type {(_types_Baz)} */ | ||
Foo.prototype.baz; | ||
``` | ||
Properties marked as optional with JSDoc notation are also handled. The plugin will transforms `@property {number} [foo] Foo.` or `@property {number=} foo Foo.` to `foo: (undefined|number)`. |
21723
143