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

Fix types for cellSelection #160

Merged
merged 5 commits into from
Jul 19, 2022
Merged

Fix types for cellSelection #160

merged 5 commits into from
Jul 19, 2022

Conversation

MH4GF
Copy link
Contributor

@MH4GF MH4GF commented Jan 28, 2022

Closes #159

because getBookmark() does not imprements Selection's type
@MH4GF
Copy link
Contributor Author

MH4GF commented Jul 19, 2022

Hi @ocavue , thanks for restarting maintenance.
I am having trouble with CellSelection not applying to setSelection() and would like to incorporate this patch.
I have imported the latest master branch and would like you to review it.

Copy link
Collaborator

@ocavue ocavue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ocavue ocavue merged commit c8aa83b into ProseMirror:master Jul 19, 2022
MH4GF added a commit to MH4GF/prosemirror-tables that referenced this pull request Jul 20, 2022
ProseMirror#160
The CellBookmark type added here was incorrect and the following error is fixed.

```
index.ts:25:43 - error TS2322: Type 'CellSelection' is not assignable to type 'Selection'.
  The types of 'getBookmark().map' are incompatible between these types.
    Type '(mapping: Mapping) => CellBookmark' is not assignable to type '(mapping: Mappable) => SelectionBookmark'.
      Types of parameters 'mapping' and 'mapping' are incompatible.
        Type 'Mappable' is missing the following properties from type 'Mapping': maps, from, to, slice, and 5 more.

1      let state = EditorState.create({ doc, selection: CellSelection.create(table, 0) });
```
MH4GF added a commit to MH4GF/prosemirror-tables that referenced this pull request Jul 20, 2022
ProseMirror#160
The CellBookmark type added here was incorrect and the following error is fixed.

```
index.ts:25:43 - error TS2322: Type 'CellSelection' is not assignable to type 'Selection'.
  The types of 'getBookmark().map' are incompatible between these types.
    Type '(mapping: Mapping) => CellBookmark' is not assignable to type '(mapping: Mappable) => SelectionBookmark'.
      Types of parameters 'mapping' and 'mapping' are incompatible.
        Type 'Mappable' is missing the following properties from type 'Mapping': maps, from, to, slice, and 5 more.

1      let state = EditorState.create({ doc, selection: CellSelection.create(table, 0) });
```
@MH4GF MH4GF mentioned this pull request Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CellSelection is extends Selection, but typescript definitions are not extends it
3 participants