Microsoft/TypeScript

JSDoc support for destructured parameters

Open

#11.859 aperta il 26 ott 2016

Vedi su GitHub
 (12 commenti) (44 reazioni) (0 assegnatari)TypeScript (6726 fork)batch import
Domain: JSDocHelp WantedIn DiscussionSuggestionVS Code Tracked

Metriche repository

Star
 (48.455 star)
Metriche merge PR
 (Merge medio 6g 17h) (9 PR mergiate in 30 g)

Descrizione

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

Guida contributor