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

Add type declarations for simple-mode #8

Merged
merged 1 commit into from
Jul 2, 2022
Merged

Conversation

stof
Copy link
Contributor

@stof stof commented Jul 1, 2022

Those are based on the type definitions in wrote for codemirror5 in DefinitelyTyped, omitting the mode property of the rule that does not exist anymore, and changing meta to languageData.

The weird generic on simpleMode<K extends string>() is because typescript does not allow defining a different type for languageData when using P in string instead of a generic (that will be inferred as the the union of state names instead of the full string type)

@marijnh marijnh merged commit 31553ac into codemirror:main Jul 2, 2022
@marijnh
Copy link
Member

marijnh commented Jul 2, 2022

Thanks!

@stof stof deleted the patch-1 branch July 4, 2022 06:57
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