(Legacy)
Ts to Jsdoc#
Generics#
https://medium.com/@antonkrinitsyn/jsdoc-generic-types-typescript-db213cf48640 ↗
type List<T> = []T
ts/**
* @template T
* @typedef {[]T} List
*/
jsreducer#
const reducer = (state: number[], action: number) => [...state, action]
tsis equivalent to
const reducer = (
/** @type {number[]} */ state,
/** @type {number} */ action
) => [...state, action]
js