Update jsdoc.md
Add a section demonstrating how to import types from typescript libraries.
This commit is contained in:
parent
79f35133f0
commit
fa9f16c5ee
14
jsdoc.md
14
jsdoc.md
|
@ -2,7 +2,7 @@
|
||||||
title: Jsdoc
|
title: Jsdoc
|
||||||
category: JavaScript
|
category: JavaScript
|
||||||
layout: 2017/sheet
|
layout: 2017/sheet
|
||||||
updated: 2017-10-29
|
updated: 2019-01-10
|
||||||
weight: -1
|
weight: -1
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -79,6 +79,18 @@ function play (song) {
|
||||||
|
|
||||||
See: <http://usejsdoc.org/tags-typedef.html>
|
See: <http://usejsdoc.org/tags-typedef.html>
|
||||||
|
|
||||||
|
### Importing Types
|
||||||
|
```js
|
||||||
|
/**
|
||||||
|
* @typedef {import('Foo').default} Bar
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Bar} x
|
||||||
|
*/
|
||||||
|
function test(x) { }
|
||||||
|
```
|
||||||
|
|
||||||
### Other keywords
|
### Other keywords
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|
Loading…
Reference in New Issue