1 | import type { CollectionProp, DefaultElements, EntryMetaSysProps, KeyValueMap, MakeRequest, MetadataProps } from '../common-types';
|
2 | import type { ContentfulEntryApi } from '../create-entry-api';
|
3 | import type { AssetProps } from './asset';
|
4 | export type EntryProps<T = KeyValueMap> = {
|
5 | sys: EntryMetaSysProps;
|
6 | metadata?: MetadataProps;
|
7 | fields: T;
|
8 | };
|
9 | export type CreateEntryProps<TFields = KeyValueMap> = Omit<EntryProps<TFields>, 'sys'>;
|
10 | export type EntryReferenceError = {
|
11 | sys: {
|
12 | type: 'error';
|
13 | id: 'notResolvable';
|
14 | };
|
15 | details: {
|
16 | type: 'Link';
|
17 | linkType: 'Entry' | 'Asset';
|
18 | id: string;
|
19 | };
|
20 | };
|
21 | export interface EntryReferenceProps extends CollectionProp<EntryProps> {
|
22 | includes?: {
|
23 | Entry?: EntryProps[];
|
24 | Asset?: AssetProps[];
|
25 | };
|
26 | errors?: EntryReferenceError[];
|
27 | }
|
28 | export type EntryReferenceOptionsProps = {
|
29 | include?: number;
|
30 | };
|
31 | export interface Entry extends EntryProps, DefaultElements<EntryProps>, ContentfulEntryApi {
|
32 | }
|
33 | export type WithResourceName<T extends {
|
34 | sys: unknown;
|
35 | }> = T extends {
|
36 | sys: infer Sys;
|
37 | } ? Omit<T, 'sys'> & {
|
38 | sys: Sys & {
|
39 | urn: string;
|
40 | };
|
41 | } : never;
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | export declare function wrapEntry(makeRequest: MakeRequest, data: EntryProps): Entry;
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | export declare const wrapEntryCollection: (makeRequest: MakeRequest, data: CollectionProp<EntryProps<KeyValueMap>>) => import("../common-types").Collection<Entry, EntryProps<KeyValueMap>>;
|