contentful 11.12.4 → 11.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/types/entry.d.ts +14 -3
- package/package.json +1 -1
|
@@ -121,6 +121,17 @@ export type BaseEntry = {
|
|
|
121
121
|
* @category Entry
|
|
122
122
|
*/
|
|
123
123
|
export type BaseFieldMap<Field extends EntryFieldType<EntrySkeletonType>> = Field extends EntryFieldTypes.Symbol<infer Values> ? EntryFields.Symbol<Values> : Field extends EntryFieldTypes.Text<infer Values> ? EntryFields.Text<Values> : Field extends EntryFieldTypes.Integer<infer Values> ? EntryFields.Integer<Values> : Field extends EntryFieldTypes.Number<infer Values> ? EntryFields.Number<Values> : Field extends EntryFieldTypes.Date ? EntryFields.Date : Field extends EntryFieldTypes.Boolean ? EntryFields.Boolean : Field extends EntryFieldTypes.Location ? EntryFields.Location : Field extends EntryFieldTypes.RichText ? EntryFields.RichText : Field extends EntryFieldTypes.Object<infer Data> ? EntryFields.Object<Data> : never;
|
|
124
|
+
/**
|
|
125
|
+
* Resolves a (possibly union) linked-entry skeleton into the corresponding
|
|
126
|
+
* `Entry` type, distributing over the union so that `EntryLink<A | B>` becomes
|
|
127
|
+
* `Entry<A> | Entry<B>` instead of collapsing `fields` to the keys common to
|
|
128
|
+
* every member. `Entry` itself is intentionally non-distributive to remain
|
|
129
|
+
* inferrable in `getEntry`/`getEntries`, so distribution is applied here at the
|
|
130
|
+
* link-resolution boundary where the linked skeleton is already known.
|
|
131
|
+
* @category Entry
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
export type DistributiveEntry<EntrySkeleton extends EntrySkeletonType, Modifiers extends ChainModifiers, Locales extends LocaleCode> = EntrySkeleton extends EntrySkeletonType ? Entry<EntrySkeleton, Modifiers, Locales> : never;
|
|
124
135
|
/**
|
|
125
136
|
* A single resolved link to another entry in the same space
|
|
126
137
|
* If the current client configuration includes `withoutLinkResolution` chain option,
|
|
@@ -133,7 +144,7 @@ export type BaseFieldMap<Field extends EntryFieldType<EntrySkeletonType>> = Fiel
|
|
|
133
144
|
* @typeParam LinkedEntry - Shape of the linked entry used to calculate dynamic keys
|
|
134
145
|
* @internal
|
|
135
146
|
*/
|
|
136
|
-
export type ResolvedEntryLink<Modifiers extends ChainModifiers, Locales extends LocaleCode, LinkedEntry extends EntrySkeletonType> = ChainModifiers extends Modifiers ?
|
|
147
|
+
export type ResolvedEntryLink<Modifiers extends ChainModifiers, Locales extends LocaleCode, LinkedEntry extends EntrySkeletonType> = ChainModifiers extends Modifiers ? DistributiveEntry<LinkedEntry, Modifiers, Locales> | UnresolvedLink<'Entry'> | undefined : 'WITHOUT_LINK_RESOLUTION' extends Modifiers ? UnresolvedLink<'Entry'> : 'WITHOUT_UNRESOLVABLE_LINKS' extends Modifiers ? DistributiveEntry<LinkedEntry, Modifiers, Locales> | undefined : DistributiveEntry<LinkedEntry, Modifiers, Locales> | UnresolvedLink<'Entry'>;
|
|
137
148
|
/**
|
|
138
149
|
* A single resolved reference link to another entry in a different space
|
|
139
150
|
* If the current client configuration includes `withoutLinkResolution` chain option,
|
|
@@ -146,11 +157,11 @@ export type ResolvedEntryLink<Modifiers extends ChainModifiers, Locales extends
|
|
|
146
157
|
* @typeParam LinkedEntry - Shape of the linked entry used to calculate dynamic keys
|
|
147
158
|
* @internal
|
|
148
159
|
*/
|
|
149
|
-
export type ResolvedEntryResourceLink<Modifiers extends ChainModifiers, Locales extends LocaleCode, LinkedEntry extends EntrySkeletonType> = ChainModifiers extends Modifiers ?
|
|
160
|
+
export type ResolvedEntryResourceLink<Modifiers extends ChainModifiers, Locales extends LocaleCode, LinkedEntry extends EntrySkeletonType> = ChainModifiers extends Modifiers ? DistributiveEntry<LinkedEntry, Modifiers, Locales> | {
|
|
150
161
|
sys: ResourceLink;
|
|
151
162
|
} | undefined : 'WITHOUT_LINK_RESOLUTION' extends Modifiers ? {
|
|
152
163
|
sys: ResourceLink;
|
|
153
|
-
} : 'WITHOUT_UNRESOLVABLE_LINKS' extends Modifiers ?
|
|
164
|
+
} : 'WITHOUT_UNRESOLVABLE_LINKS' extends Modifiers ? DistributiveEntry<LinkedEntry, Modifiers, Locales> | undefined : DistributiveEntry<LinkedEntry, Modifiers, Locales> | {
|
|
154
165
|
sys: ResourceLink;
|
|
155
166
|
};
|
|
156
167
|
/**
|
package/package.json
CHANGED