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

Improve typings for methods that return a Delta #4136

Merged
merged 2 commits into from
Apr 30, 2024
Merged

Conversation

younggglcy
Copy link
Contributor

@younggglcy younggglcy commented Apr 24, 2024

my current quill version: v2.0.0.

as in v2, quill provides its own bundled dts file for developers, but some methods under the Quill scope are incorrectly typed due to Function.call() will returns an any type.

e.g., quill.updateContents(), its return type should be Delta, but in quill.d.ts, the signature is

declare class Quill {
  updateContents(delta: Delta | Op[], source?: EmitterSource): any;
}

this pr solves the problem by explicitly declaring the return type, and improve dts type tests

@luin luin merged commit dbaa1e0 into slab:main Apr 30, 2024
5 checks passed
@luin luin changed the title feat: explicitly declare the return type for methods return modify.call() Improve typings for methods that return a Delta Apr 30, 2024
@luin
Copy link
Member

luin commented Apr 30, 2024

Thanks for the contribution!

@younggglcy younggglcy deleted the feat/dts branch April 30, 2024 16:06
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