Update jsdoc.md

Add a section demonstrating how to import types from typescript libraries.
This commit is contained in:
Ben 2019-01-10 08:33:55 -06:00 committed by GitHub
parent 79f35133f0
commit fa9f16c5ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions

View File

@ -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