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 CellBookmark typing #178

Merged
merged 2 commits into from
Jul 20, 2022
Merged

Conversation

MH4GF
Copy link
Contributor

@MH4GF MH4GF commented Jul 20, 2022

#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) });

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) });
```
EditorState.create({
doc: table,
selection: CellSelection.create(table, 0),
});
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added it to the test, but currently test-typescript.js is not working correctly.

https://github.com/MH4GF/prosemirror-tables/blob/371af26f950612c7a4ca0046a94a65ce970c0eb5/test/test-typescript.js

Here's the PR we're going to fix: #177

@MH4GF
Copy link
Contributor Author

MH4GF commented Jul 20, 2022

@ocavue sorry, I would like to request a review of the corrections made in the last PR #160 , as they were incorrect.

@MH4GF MH4GF changed the title fix CellBookmark typings fix CellBookmark typing Jul 20, 2022
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 3756fd4 into ProseMirror:master Jul 20, 2022
@MH4GF MH4GF deleted the fix-typings-cell-bookmark branch July 20, 2022 22:49
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.

None yet

2 participants