Add typedef shorthand in jsdoc

This commit is contained in:
Chandrajeet Maurya 2019-10-01 12:29:36 +07:00 committed by GitHub
parent 1e927dccfc
commit a001fdcc00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

View File

@ -80,6 +80,27 @@ function play (song) {
See: <http://usejsdoc.org/tags-typedef.html> See: <http://usejsdoc.org/tags-typedef.html>
### Typedef Shorthand
```js
/**
* A song
* @typedef {{title: string, artist: string, year: number}} Song
*/
```
```js
/**
* Plays a song
* @param {Song} song - The {@link Song} to be played
*/
function play (song) {
}
```
See: <http://usejsdoc.org/tags-typedef.html>
### Importing types ### Importing types
```js ```js