@typedef

Syntax

@typedef {<data_type>} <name>

Overview

This tag can be used to declare a type definition, which is an alias of an existing type. In conjunction with @property, it can be used to define object types.

Example(s)

The very simple use case is to define an alias:

/**
 * @typedef {string} uuid_t
 */

You can also declare object types by aliasing object:

/**
 * @typedef {object} Point
 * @property {number} x
 * @property {number} y
 */

/** @type {Point} */
const point = { x: 0, y: 0 }
Powered by webdoc!