forked from ianstormtaylor/slate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom TypeScript Types (ianstormtaylor#3835)
This PR adds better TypeScript types into Slate and is based on the proposal here: ianstormtaylor#3725 * Extend Slate's types like Element and Text * Supports type discrimination (ie. if an element has type === "table" then we get a reduced set of properties) * added custom types * files * more extensions * files * changed fixtures * changes eslint file * changed element.children to descendant * updated types * more type changes * changed a lot of typing, still getting building errors * extended text type in slate-react * removed type assertions * Clean up of custom types and a couple uneeded comments. * Rename headingElement-true.tsx.tsx to headingElement-true.tsx * moved basetext and baselement * Update packages/slate/src/interfaces/text.ts Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com> * Fix some type issues with core functions. * Clean up text and element files. * Convert other types to extended types. * Change the type of editor.marks to the appropriate type. * Add version 100.0.0 to package.json * Revert "Add version 100.0.0 to package.json" This reverts commit 329e44e. * added custom types * files * more extensions * files * changed fixtures * changes eslint file * changed element.children to descendant * updated types * more type changes * changed a lot of typing, still getting building errors * extended text type in slate-react * removed type assertions * Clean up of custom types and a couple uneeded comments. * Rename headingElement-true.tsx.tsx to headingElement-true.tsx * moved basetext and baselement * Update packages/slate/src/interfaces/text.ts Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com> * Fix some type issues with core functions. * Clean up text and element files. * Convert other types to extended types. * Change the type of editor.marks to the appropriate type. * Run linter. * Remove key:string uknown from the base types. * Clean up types after removing key:string unknown. * Lint and prettier fixes. * Implement custom-types Co-authored-by: mdmjg <mdj308@nyu.edu> * added custom types to examples * reset yarn lock * added ts to fixtures * examples custom types * Working fix * ts-thesunny-try * Extract interface types. * Fix minor return type in create-editor. * Fix the typing issue with Location having compile time CustomTypes * Extract types for Transforms. * Update README. * Fix dependency on slate-history in slate-react Co-authored-by: mdmjg <mdj308@nyu.edu> Co-authored-by: Brent Farese <brentfarese@gmail.com> Co-authored-by: Brent Farese <25846953+BrentFarese@users.noreply.github.com> Co-authored-by: Tim Buckley <timothypbuckley@gmail.com>
- Loading branch information
1 parent
a5f4170
commit 08275f6
Showing
61 changed files
with
3,121 additions
and
3,397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Slate Hyperscript | ||
|
||
This package contains a hyperscript helper for creating Slate documents with JSX! | ||
This package contains a hyperscript helper for creating Slate documents with JSX! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.