docs-parser icon indicating copy to clipboard operation
docs-parser copied to clipboard

Bad Typing of Return Type with Union

Open dsanders11 opened this issue 2 years ago • 0 comments

There's been some cases in the docs where return types are listed as Returns `<foo>` | `<bar>` which gets turned into a return type of just <foo>, and | `<foo>` gets added to the description. Can be fixed in the docs by typing as Returns `<foo> | <bar>` instead (which is how most return type unions are written in the docs), but we should either handle the case here or detect it and throw an error.

Example:

#### `ses.getExtension(extensionId)`

* `extensionId` string - ID of extension to query

Returns `Extension` | `null` - The loaded extension with the given ID.

**Note:** This API cannot be called before the `ready` event of the `app` module
is emitted.

Gets typed as:

/**
 * | `null` - The loaded extension with the given ID.
 *
 * **Note:** This API cannot be called before the `ready` event of the `app` module
 * is emitted.
 */
getExtension(extensionId: string): Extension;

dsanders11 avatar Aug 30 '23 22:08 dsanders11