Skip to content

Bad Typing of Return Type with Union #93

Closed
@dsanders11

Description

@dsanders11

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions