Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Document JSDoc examples with decorators #1084

Open
edjm1971 opened this issue Jul 31, 2019 · 1 comment
Open

Document JSDoc examples with decorators #1084

edjm1971 opened this issue Jul 31, 2019 · 1 comment

Comments

@edjm1971
Copy link

Suggestion

I would like to see your page https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html#supported-jsdoc updated to reflect what the proper format is for comments when annotations are in use.

Examples

The only example I can find out on the web with comments and annotations is on the Comdoc site https://compodoc.app/guides/jsdoc-tags.html which would be the 1st entry below.

/**
 * Description.
 */
@Component({...})
class MyClass{...}

Or would this be written as

@Component({...})
/**
 * Description.
 */
class MyClass{...}
@RyanCavanaugh RyanCavanaugh changed the title TypeScript commenting with Annotations Document JSDoc examples with decorators Jul 31, 2019
@orta
Copy link
Contributor

orta commented Jul 31, 2019

It looks like it's the first one only

/** You should see this when you hover on greeter */
@sealed
class Greeter {}

@sealed
/** You won't see this when you hover on greeter */
class GreeterTwo {}


function sealed(constructor: Function) {
  Object.seal(constructor);
  Object.seal(constructor.prototype);
}

Playground link.

Would you like to send a PR to our Handbook adding that example?

@orta orta transferred this issue from microsoft/TypeScript Jul 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants