block-content-to-hyperscript
                                
                                
                                
                                    block-content-to-hyperscript copied to clipboard
                            
                            
                            
                        Convert to TypeScript
This is loosely related to https://sanity-io-land.slack.com/archives/C9Z7RC3V1/p1601637650136800
I probably should have opened an issue instead, but I got the impression that this would be a welcome change, so I proceed.
If the team has any suggestions/ideas/wishes how things should be done, please leave a comment under! Thanks :slightly_smiling_face:
- [x] ~convert files~
 - [x] ~fix all TS errors~
 - [x] ~get tests working~
 - [x] ~create multiple bundles~
 - [ ] fix imports/exports
 
This is a minimal conversion to TS, meaning I extensively used any to silence the TypeScript checker. I added some types though, where it seemed to be doable easily.
Probably the inner data structure types could have been written a bit better and exposed, so the generated .d.ts files could be used for example to create new parsers compatible with Portable Text.
~Some of the tests are failing, and I need some feedback/help to fix those. Also to fix the bundling part, I am not totally sure how it should be set up so multiple bundles are created for different environments.~
@rexxars @bjoerge @saasen This is ready for review!
Would accept some suggestions for the imports and exports, it is a bit messy, and I probably did not get it right. Not 100% sure where and what should be imported/exported 🙈.