Repository: TypeScript
Issue: Expose JsDoc default value for optional parameters in AST
Labels: Suggestion,In Discussion,API,Domain: JSDoc

Copied from my [SO](https://stackoverflow.com/questions/54272321/does-the-typescript-compiler-expose-the-default-value-of-jsdoc-param/54273202#54273202) question:

I expected to be able to extract the default value of a JsDoc param but I'm actually unable to find the default value on the JsDoc node. For example, give this:
```js
/** * @param [bar=42] Bar comment. */
```
I'd like to extract `42` from the node. Yet I find no default value field on the ts node:

![image](https://user-images.githubusercontent.com/4120386/51505771-b755ef00-1d8c-11e9-8c63-d4eba25246f1.png)

It exposes `isBracketed` but I cannot find the `42`. Typescript does claim to support default JsDoc arguments:

https://github.com/Microsoft/TypeScript/wiki/JSDoc-support-in-JavaScript#param-and-returns

Yet I cannot seem to find the exposed in the AST... And that's because, it's not currently in the AST! The parser currently skips over the expression without storing the return value anywhere.

```ts
// May have an optional default, e.g. '[foo = 42]'
if (parseOptionalToken(SyntaxKind.EqualsToken)) {
    parseExpression();
}
```

[Source](https://github.com/Microsoft/TypeScript/blob/3a2f6a3ed1a598a241e7c750873105f22e7a2463/src/compiler/parser.ts#L6711)

## Use Cases
I'm automating harvesting JsDoc comments for inclusion in my NPM `README.md` files. I'm coding in pure JS but using the TypeScript parser to dig out the JsDoc. (I would use TS except I cannot express that a key must be a symbol! So you guys owe me! jk)

## Examples
I'd like to expose via the TS AST that `isFunction` is default false:
```
/**
 * @description Creates a descriptor that is an alias of another accessor or function.
 * 
 * @param name The name of the accessor or function being aliased.
 * @param [isFunction=false] True, if the alias target is a function. 
 * 
 * @returns A descriptor which will access or invoke a member of the specified name.
 */
```
Then my glorious `@kingjs\expand-readme` [npm package](https://www.npmjs.com/package/@kingjs/property-descriptor.create-alias) can harvest that from the AST [here](https://github.com/kingces95/kingjs/blob/7b3fd2b94cb2e77d612555916bb362d6750a535a/expand-readme/first-jsdoc.js#L127). And then my equally glorious documentation can include the default value: 
````
## API
```ts
alias(name[, isFunction=false])
```
### Parameters
- `name`: The name of the accessor or function being aliased.
- `isFunction`: True, if the alias target is a function.
### Returns
A descriptor which will access or invoke a member of the specified name.
````

I'd guess this would be fairly trivial to expose on the AST. Just have to decide on a name. Maybe `defaultValue`? Or `rawDefaultValue` just so I can return the string without concern for its type? Or maybe just a node that I can pull the raw text out of? Maybe you guys could make it an "up for grabs".
## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).