contentlayerdev / contentlayerdev/contentlayer
Support referencing TS type definitions for `type: 'json'` fields
- Vorherrschende Sprache
- TypeScript
- Sterne
- 3.5k
- Forks
- 192
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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:

Rough API idea:
```ts
{
// ...
typescriptType: { name: 'IReadTimeResults', from: 'reading-time' }
}
```
## Notes
- A potential other direction/idea for this could be to "derive" nested document types based on existing TS types. (Would address #149)
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.