Skip to content

Parsing TypeScript members at the class-level doesn't retain types or defaults #66

@bigtimebuddy

Description

@bigtimebuddy

Trying to reorganize the documentation in PixiJS so that member documentation is at the class-level. Historically with JSDoc these were added in the constructor when the property was initialized.

Here's an example of what I'd like to do:

class MyClass {
  /** Run in debug mode. */
  public debug: boolean = false;
}

I would expect the output from webdoc to infer the type and default from the TypeScript definition, but it does not.

This, however, works fine:

class MyClass {
  /**
   * Run in debug mode.
   * @type {boolean}
   * @default false
   */
  public debug: boolean = false;
}

One quick note: access-modifiers are handled correctly (public, private, protected).

Metadata

Metadata

Assignees

Labels

TransformerIssue due to transformer stage of parsing📦 @webdoc/parserIssue related to @webdoc/parser🕷 BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions