Is it possible to generate more accurate types in the richText.content? #833
Replies: 2 comments 1 reply
-
Hey @Stupidism — this should be completely possible and would be a great feature to add. Could be fairly complex to implement, because Payload doesn't necessarily know the shape of custom elements / leaves, but we could certainly extend custom elements / leaves to allow a developer to define the shape of data that is stored within them. Then, we could use that data shape in our type generation. If this is something you are interested in taking on in a PR, we would happily accept it and we can point you in the right direction! Otherwise, not sure when we would be able to get to it. Good question! |
Beta Was this translation helpful? Give feedback.
-
My temporary solution is to import a customized PayloadRichText definition and replace all the object code to PayloadRichText:
|
Beta Was this translation helpful? Give feedback.
-
For example:
Current generated code:
Expected generated code:
Beta Was this translation helpful? Give feedback.
All reactions