Skip to content

getSelection may return null but type definition does not reflect this #1788

Description

@trrk

I noticed that getSelection can return null in the implementation, but the type definition in index.d.ts does not reflect this possibility.

Source code (shows possible null return):

return null;

Type definition (does not include null in its type):

getSelection: () => [number, number, number, number];

The type definition should be updated to indicate that getSelection may return null. For example:

getSelection: () => [number, number, number, number] | null;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions