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 Quill.getText() arguments #3737

Merged
merged 1 commit into from
Jun 2, 2023
Merged

🏷️ Fix Quill.getText() arguments #3737

merged 1 commit into from
Jun 2, 2023

Conversation

alecgibson
Copy link
Contributor

Quill.getText() is allowed to be called with no arguments, since it defaults to returning the whole document.

However, the overload declarations require arguments, resulting in a compilation error when trying to call getText() with no arguments:

(method) Quill.getText(range: {
    index: number;
    length: number;
}): string (+1 overload)
Expected 1-2 arguments, but got 0.ts(2554)

This change makes all the arguments in the overloads optional to match the implementation.

`Quill.getText()` is allowed to be called with no arguments, since it
[defaults][1] to returning the whole document.

However, the overload declarations require arguments, resulting in a
compilation error when trying to call `getText()` with no arguments:

```
(method) Quill.getText(range: {
    index: number;
    length: number;
}): string (+1 overload)
Expected 1-2 arguments, but got 0.ts(2554)
```

This change makes all the arguments in the overloads optional to match
the implementation.

[1]: https://github.com/quilljs/quill/blob/d2f689fb4744cdada96c632a8bccf6d476932d7b/core/quill.ts#L501-L502
@luin luin merged commit 6420da5 into slab:develop Jun 2, 2023
@alecgibson alecgibson deleted the get-text branch June 2, 2023 06:59
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.

2 participants