interfaceName on array fields is somehow misleading.
#14803
tobiastom
started this conversation in
Feature Requests & Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
A long time ago #2709 introduced the
interfaceNameproperty on array and other combined files. While this is excellent, I can currently let Payload generate a specific Typescript type to represent one of the items.Given the example from the pull request, modified to the array case, this is the current behavior:
payload will generate something like this:
Unfortunately with this, I cannot use the type of one of the items in other parts of the code. I also tried to use
Array<SharedMeta>andSharedMeta[], but special characters are just filtered out. Would it make sense to change the behaviors for array types to use theinterfaceNameas an inner type, or allow the usage of some kind of array notation in it?Right now I'm defining my own type like this:
but this feels kind of wrong. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions