This repository has been archived by the owner on Jan 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
174 lines (154 loc) · 3.31 KB
/
types.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import type { CustomParams } from '@guardian/commercial-core';
import type { ArticleTheme } from '@guardian/libs';
export type AdTargeting =
| {
adUnit: string;
customParams: CustomParams;
disableAds?: false;
}
| {
disableAds: true;
};
export type AudioAtomType = {
id: string;
trackUrl: string;
kicker: string;
title?: string;
pillar: ArticleTheme;
shouldUseAcast?: boolean;
duration: number;
};
export type ChartAtomType = {
id: string;
html: string;
};
export type ExplainerAtomType = {
id: string;
title: string;
html: string;
};
export type GuideAtomType = {
id: string;
label?: string;
title: string;
image?: string;
html: string;
credit?: string;
pillar: ArticleTheme;
expandForStorybook?: boolean;
likeHandler?: () => void;
dislikeHandler?: () => void;
expandCallback?: () => void;
};
export type InteractiveAtomBlockElementType = {
_type: string;
css: string;
js: string;
html: string;
id: string;
url: string;
};
export type InteractiveLayoutAtomType = {
_type: string;
css: string;
js: string;
html: string;
id: string;
url: string;
};
export type ProfileAtomType = {
id: string;
label?: string;
title: string;
image?: string;
html: string;
credit?: string;
pillar: ArticleTheme;
expandForStorybook?: boolean;
likeHandler?: () => void;
dislikeHandler?: () => void;
expandCallback?: () => void;
};
export type QandaAtomType = {
id: string;
title: string;
image?: string;
html: string;
credit?: string;
pillar: ArticleTheme;
expandForStorybook?: boolean;
likeHandler?: () => void;
dislikeHandler?: () => void;
expandCallback?: () => void;
};
export type TimelineAtomType = {
id: string;
events?: TimelineEvent[];
title: string;
pillar: ArticleTheme;
description?: string;
expandForStorybook?: boolean;
likeHandler?: () => void;
dislikeHandler?: () => void;
expandCallback?: () => void;
};
export interface TimelineEvent {
title: string;
date: string;
unixDate: number;
body?: string;
toDate?: string;
toUnixDate?: number;
}
type AssetType = {
url: string;
mimeType: string;
};
export type VideoAtomType = {
assets: AssetType[];
poster?: string;
height?: number;
width?: number;
};
export type SrcSetItem = { src: string; width: number };
export type ImageSource = {
srcSet: SrcSetItem[];
};
// aka weighting. RoleType affects how an image is placed. It is called weighting
// in Composer but role in CAPI. We respect CAPI so we maintain this nomenclature
// in DCR
export type RoleType =
| 'immersive'
| 'supporting'
| 'showcase'
| 'inline'
| 'thumbnail'
| 'halfWidth';
export type SharePlatformType =
| 'facebook'
| 'twitter'
| 'email'
| 'linkedIn'
| 'pinterest'
| 'whatsApp'
| 'messenger';
export type SharingUrlsType = {
[K in SharePlatformType]?: {
url: string;
userMessage: string;
};
};
export type VideoEventKey =
| 'play'
| '25'
| '50'
| '75'
| 'end'
| 'skip'
| 'cued'
| 'resume'
| 'pause';
export type RecipeSchemaAtomType = {
id: string;
json: string;
};