-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathelements.ts
67 lines (53 loc) · 2 KB
/
elements.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { IContentItem, ILink, IRichTextImage } from '../models';
import { ElementModels } from './element-models';
export namespace Elements {
export type TextElement = ElementModels.IElement<string>;
export type LinkedItemsElement<TContentItem extends IContentItem = IContentItem> = ElementModels.IElement<
string[]
> & {
/**
* Linked items
*/
linkedItems: TContentItem[];
};
export type MultipleChoiceElement = ElementModels.IElement<ElementModels.MultipleChoiceOption[]>;
export type DateTimeElement = ElementModels.IElement<string | null> & {
/**
* Display time zone
*/
displayTimeZone: string | null;
};
export type RichTextElement = ElementModels.IElement<string> & {
/**
* Links
*/
links: ILink[];
/**
* Images included within rich text element
*/
images: IRichTextImage[];
/**
* Array of linked item codenames
*/
linkedItemCodenames: string[];
/**
* Array of linked items retrieved from `modular_content` part of the response. Not all items might be here
* as it depends on the `depth` parameter of query.
* The `linkedItemsReferenceHandler` configuration can be used to disable mapping of linked items
*/
linkedItems: IContentItem[];
};
export type NumberElement = ElementModels.IElement<number | null>;
export type AssetsElement = ElementModels.IElement<ElementModels.AssetModel[]>;
export type UrlSlugElement = ElementModels.IElement<string>;
export type TaxonomyElement<TaxonomyCodename extends string = string> = ElementModels.IElement<
ElementModels.TaxonomyTerm<TaxonomyCodename>[]
> & {
/**
* Taxonomy group
*/
taxonomyGroup: string | null;
};
export type UnknownElement = ElementModels.IElement<any>;
export type CustomElement<TValue = string> = ElementModels.IElement<TValue>;
}