Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document object parameter's default values #38

Closed
Blackbaud-SteveBrush opened this issue Mar 2, 2020 · 1 comment
Closed

Document object parameter's default values #38

Blackbaud-SteveBrush opened this issue Mar 2, 2020 · 1 comment

Comments

@Blackbaud-SteveBrush
Copy link
Member

Blackbaud-SteveBrush commented Mar 2, 2020

We need to figure out a way to document object-type parameters' default values:

interface Config {
  foo?: string;
}

// How to document the default value for Config.foo?
public foobar(config: Config): void {

Related TypeDoc issue(s):
TypeStrong/typedoc#567

Currently, TypeDoc does not support bracketed defaults for @param tag. It simply ignores everything after the first @param tag.
(Brackets are used by JSDoc to signify defaults, see: https://devhints.io/jsdoc)

/**
 * This is the init function.
 * @param args The init args.
 * - `args.foo` This defaults to 'bar'.
 */
public init(args: FooInitArgs): void { }
@Blackbaud-SteveBrush
Copy link
Member Author

For the time being let's use this format:

/**
 * Some description here. Default values for the `args`:
 * - `args.bar` If you don't set this... The default is `'foobar'`.
 */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant