Comments (4)
@jacksonopp You’re right. Resolved inks in rich text fields are currently not covered by the types in contentful.js. Feel free to file a feature request in contentful.js itself.
from cf-content-types-generator.
Closing this issue in favor of contentful/contentful.js#1921
from cf-content-types-generator.
TypeCeTextBlockSkeleton
is an abstract description of how the entry looks like using the EntryFieldTypes
. It can be used in two ways:
- Pass it to the CDA methods to get the correct return type which matches your fetched entry data.
- Pass it to the
Entry
type together with the client configuration you’re using if you want to use the types in other parts of your code. The resulting type again matches your entry data. The generator creates theTypeCeTextBlock
to make this a bit more convenient.
from cf-content-types-generator.
I'm running up against a similar issue when it comes to resolved links within embedded entries inside rich text fields. Not sure if this is an issue with this library or with the ngx-contentful-rich-text
library I'm using.
In this example, I'm creating a hero component based off of a hero content type.
The data that I have access to inside the component I'm rendering for the embedded asset matches the TypeHeroFields
. I access this by essentially casting that data into the TypeHeroFields
type. One of the fields in TypeHeroFields
is a image
content type, which is a wrapper content type around an asset (we're just adding some SEO fields to an asset basically). Since we're resolving that data in the CDA method, the type mismatches, since it's no longer a link, but the actual data.
I'm able to work around this by doing data.heroImage as unknown as Entry<TypeImageSkeleton>
, but this doesn't seem to be the right pattern.
Sorry if this description is a little confusing. I can elaborate if you need me to.
from cf-content-types-generator.
Related Issues (20)
- "Type does not satisfy the constraint 'EntrySkeletonType'." HOT 7
- Type error after Contentful `10.0.0-beta-v10.32` HOT 4
- oclif dependencies are deprecated HOT 2
- How to actually use fields? HOT 13
- Use with Contentful GraphQL endpoint? HOT 1
- 2.12.3 introduces bug HOT 2
- Property does not exist on type {} | {} HOT 2
- Include description and help text in JSDoc comments? HOT 5
- Support a config file
- Support custom prefixes of generics and interfaces HOT 2
- Command hangs after generating the export
- Generated TypeScript Models Lack File Extensions in Import Statements When Using Node 16 Module Resolution HOT 1
- Fields not typed correctly HOT 2
- Generated field interface does not satisfy the constraint 'EntrySkeletonType' HOT 5
- Generated types don't seem to match those expected by Contentful v10 HOT 2
- Support EU Data Center HOT 2
- Release a new version with updated contentful and allow minor version differences if possible HOT 1
- Type Not Satisfying Entry Requirements HOT 6
- Why can `EntryFieldTypes.Array<EntryFieldTypes.EntryLink<EntrySkeletonType>>` array include `undefined`? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cf-content-types-generator.