Skip to content

Support referencing TS type definitions for type: 'json' fields #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
schickling opened this issue Nov 8, 2021 · 3 comments
Open
Labels
feature New feature or request pkg/source-files
Milestone

Comments

@schickling
Copy link
Collaborator

schickling commented Nov 8, 2021

In some cases where you're using type: 'json' you'd like to reference some existing TS type definitions instead of the any type that's currently used for json fields. This applies to both regular fields and computedFields.

Example:

image

Rough API idea:

{
  // ...  
  typescriptType: { name: 'IReadTimeResults', from: 'reading-time' }
}

Notes

@essential-randomness
Copy link

Is there any sense of what would be needed for this? Is it something a drive-through contributor could take care of?

@schickling
Copy link
Collaborator Author

schickling commented Nov 7, 2022

Thanks for your question @essential-randomness. Unfortunately I think this is part of some medium-to-large iteration on the current schema/typing-system and thus not a good candidate for any "drive-by contribution".

Please leave a 👍 in the main comment though to express your "demand". :)

@essential-randomness
Copy link

Done!

Is there anywhere to go to better understand the future iteration of the schema/typing system that you envision? There are some project I have in mind that where contentlayer would be helpful (mostly so I don't have to reimplement typed MDX + the build pipelines myself :P), but I'd like to have a clearer picture of where you want to be when you reach 1.0 before I start building on top of your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request pkg/source-files
Projects
None yet
Development

No branches or pull requests

2 participants