How do I document the useState call using typedoc?

30 Views Asked by At

I have a documented hook that returns a state and several functions. The functions in typedoc have been documented, but the status in the final documentation is displayed simply as boolean without a description

export default function useDrag(data: json | string, title: string) {
    /** Состояние, определяющее перемещается ли элемент в данный момент (drag) */
    const [isDragging, setDragging] = useState<boolean>(false)

    /**
     * Функция переопределяет базовые реакции на drag event
     * @param e
     */
    function onDragOver(e: React.DragEvent<HTMLDivElement>) {
        e.preventDefault()
    }

    /**
     * Функция устанавливает состояние isDragging и устанаваливает данные в dataTransfer
     * @param e
     */
    function onDragStart(e: React.DragEvent<HTMLDivElement>) {
        setDragging(true)
        e.dataTransfer.setData('BlankJSONElement', JSON.stringify({
            data: data,
            title: title
        }))
    }

    /**
     * Функция устанавливает состояние isDragging и устанаваливает данные в dataTransfer
     * @param e
     */
    function onDragEnd(e: React.DragEvent<HTMLDivElement>) {
        setDragging(false)
    }

    return {
        isDragging,
        onDragOver,
        onDragStart,
        onDragEnd
    }
}

I found only old answers on a similar topic, but with jsdoc, in which they just type the state, but this does not help to add a description in the documentation

0

There are 0 best solutions below