Merge pull request #1212 from cjmling/patch-1

Add typedef shorthand in jsdoc
This commit is contained in:
Rico Sta. Cruz 2019-10-15 20:31:31 +11:00 committed by GitHub
commit 4da6b9adbe
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