Microsoft/TypeScript

JSDoc support for destructured parameters

Open

#11,859 创建于 2016年10月26日

在 GitHub 查看
 (12 评论) (44 反应) (0 负责人)TypeScript (6,726 fork)batch import
Domain: JSDocHelp WantedIn DiscussionSuggestionVS Code Tracked

仓库指标

Star
 (48,455 star)
PR 合并指标
 (平均合并 6天 17小时) (30 天内合并 9 个 PR)

描述

TypeScript Version: 2.0.3

Code

interface Foo {
    /**
     * A bar value
     */
    bar?: string;
}

/**
 * A function
 *
 * @param foo A param
 * @param { bar } Another param
 * @param bar Another param
 */
function foo(foo: string, { bar }: Foo): void {
    bar;
    foo;
}

foo('bar', { bar: 'play' });

Expected behavior:

Intellisense for the second argument, or the second argument properties.

Actual behavior:

No way of providing a description for the destructured elements of a destructured parameter.

destructured

贡献者指南