Add type declarations for simple-mode #8

Merged
stof merged 1 commit from patch-1 into main 2022-07-02 08:38:32 +02:00
stof commented 2022-07-01 15:54:50 +02:00 (Migrated from github.com)

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)

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 commented 2022-07-02 08:38:39 +02:00 (Migrated from github.com)

Thanks!

Thanks!
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/legacy-modes!8
No description provided.