@20minutes/tyr 0.1.2

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.
@@ -0,0 +1,320 @@
1
+ /// <reference types="react" />
2
+ import { AwsRumConfig, AwsRum } from 'aws-rum-web';
3
+ import * as React$1 from 'react';
4
+ import { LayoutType } from '@20minutes/hela';
5
+
6
+ interface ContentDataLayerType {
7
+ signature?: string;
8
+ nbParagraphs?: number;
9
+ pageType?: string;
10
+ tags?: string;
11
+ article_section?: string;
12
+ content_id?: string;
13
+ }
14
+
15
+ interface DefaultDataLayerType {
16
+ page_uri: string;
17
+ page_type?: string;
18
+ libelle?: string;
19
+ chapter1?: string;
20
+ chapter2?: string;
21
+ chapter3?: string;
22
+ chapter4?: string;
23
+ ac?: string;
24
+ an?: string;
25
+ }
26
+
27
+ interface UserDataLayerType {
28
+ darkmode: string;
29
+ adblock: string;
30
+ referrer: string;
31
+ source_type: string;
32
+ user_status: string;
33
+ }
34
+
35
+ interface DataLayerType extends DefaultDataLayerType, UserDataLayerType, ContentDataLayerType {
36
+ }
37
+
38
+ declare type VariablesDataLayerType = ContentDataLayerType;
39
+
40
+ interface AwsRumVariablesType {
41
+ APPLICATION_ID: string;
42
+ APPLICATION_VERSION: string;
43
+ APPLICATION_REGION: string;
44
+ config: AwsRumConfig;
45
+ }
46
+
47
+ declare type Slot = {
48
+ slotElementId: string;
49
+ path: string;
50
+ sizes: string;
51
+ };
52
+
53
+ declare enum AdSizesType {
54
+ HEADER_AD = "[[1,1], \"fluid\"]",
55
+ BAN_ATF = "[[1,1], [728,90], [970,250], [980,250], [1000,90], [1000,250], [1600,1200]]",
56
+ PAVE_ATF = "[[1,1], [300,250], [300,600], [600,250], [600,600], [770,250]]",
57
+ BAN_BTF = "[[1,1], [728,90], [970,90], [970,250], [980,250], [1000,90], [1000,250]]",
58
+ ARTICLE_BTF = "[[1,1], [300,168], [300,250], [320,50], [320,100], [320,480]]"
59
+ }
60
+ declare type AdSizesTypeKey = keyof typeof AdSizesType;
61
+
62
+ declare enum pageType {
63
+ UNKNOWN = "Non connu",
64
+ SLIDESHOW_COVER = "Slideshow cover",
65
+ SLIDESHOW_COVER_LISTING_PAGE = "Slideshow listing page",
66
+ SLIDESHOW_PAGE = "Slideshow page",
67
+ ARTICLE = "article",
68
+ MISC = "divers",
69
+ HOME = "home",
70
+ LIVE = "live",
71
+ SECTION = "section",
72
+ TAG = "tag"
73
+ }
74
+ declare enum tagsType {
75
+ MISC = "divers",
76
+ HOME = "home",
77
+ LOCAL = "local",
78
+ PLANET = "plan\u00E8te"
79
+ }
80
+ declare enum TargetingKeys {
81
+ PAGETYPE = "pageType",
82
+ TAGS = "tags"
83
+ }
84
+ declare type Targeting = {
85
+ pageType: string;
86
+ tags: string;
87
+ };
88
+
89
+ declare type DfpDataLayerType = Targeting;
90
+
91
+ declare type Purposes = 'Cookies' | 'CookiesAnalytics' | 'CookiesMarketing' | 'CookiesSocial' | 'AdvertisingPersonalization' | 'CookiesMarketing' | 'Analytics' | 'ContentPersonalization' | 'AdDelivery' | 'DeviceAccess' | 'OfflineMatch' | 'LinkDevices' | 'PreciseGeo' | 'SelectBasicAds' | 'CreateAdsProfile' | 'SelectPersonalizedAds' | 'CreateContentProfile' | 'SelectPersonalizedContent' | 'MeasureAdPerformance' | 'MeasureContentPerformance' | 'MarketResearch' | 'ImproveProducts' | 'mesureda-6qyqaZXC' | 'publicite-Nfb9aWMW';
92
+ declare type PurposesList = {
93
+ [key in Purposes]: string;
94
+ };
95
+ declare type Notice = {
96
+ show: () => void;
97
+ };
98
+ interface Didomi {
99
+ CCPA: string[];
100
+ Purposes: PurposesList;
101
+ notice: Notice;
102
+ preferences: string[];
103
+ theme: string[];
104
+ version: string;
105
+ getUserConsentStatusForPurpose: (purpose: Purposes) => boolean;
106
+ reset: () => void;
107
+ }
108
+ declare type DidomiOnReady = (() => void)[];
109
+ declare type EventListener = {
110
+ event: string;
111
+ listener: () => void;
112
+ };
113
+ declare type DidomiEventListeners = EventListener[];
114
+ declare type CmpType = {
115
+ consentEventsCount: number;
116
+ };
117
+
118
+ declare type VariablesCmpType = {
119
+ Didomi: Didomi;
120
+ didomiOnReady: DidomiOnReady;
121
+ disapproveDidomiGTMEvents: boolean;
122
+ didomiEventListeners: DidomiEventListeners;
123
+ };
124
+
125
+ declare type Privacy = {
126
+ setVisitorMode: (authority: string, mode: string) => void;
127
+ getVisitorMode: () => Record<string, unknown>;
128
+ setVisitorOptin: () => void;
129
+ };
130
+ declare type CustomVars = {
131
+ set: (arg0: {
132
+ site: Record<number, unknown>;
133
+ }) => void;
134
+ };
135
+ declare type Props = Record<string, string | boolean>;
136
+ declare type IdentifiedVisitor = {
137
+ set: (arg0: Record<string, unknown>) => void;
138
+ };
139
+ declare type PageDefaultKeys = {
140
+ name: string;
141
+ chapter1: string;
142
+ chapter2: string;
143
+ chapter3: string;
144
+ customObject: {
145
+ device: string;
146
+ };
147
+ };
148
+ declare type Tag = {
149
+ privacy: Privacy;
150
+ identifiedVisitor: IdentifiedVisitor;
151
+ customVars: CustomVars;
152
+ page: {
153
+ set: (pageDefaultKeys: PageDefaultKeys) => void;
154
+ };
155
+ setProps: (props: Props, persistent: boolean) => void;
156
+ dispatch: () => void;
157
+ };
158
+ interface TagConstructor {
159
+ new (): Tag;
160
+ }
161
+ interface Tracker {
162
+ Tag: TagConstructor;
163
+ instances: Tag[];
164
+ }
165
+ declare type ATInternetType = {
166
+ Tracker?: Tracker;
167
+ onTrackerLoad: () => void;
168
+ };
169
+
170
+ declare global {
171
+ interface Window extends VariablesDataLayerType, VariablesCmpType {
172
+ datalayer: Partial<DataLayerType>;
173
+ gtmDatalayer: Record<number, unknown>;
174
+ awsRumVariables: AwsRumVariablesType;
175
+ dfpVariables: DfpDataLayerType;
176
+ awsRum?: AwsRum;
177
+ dfp: {
178
+ slotsReady: boolean;
179
+ slots: Slot[];
180
+ targeting: Partial<Targeting>;
181
+ } | Record<string, never>;
182
+ cmpVariables: CmpType;
183
+ ATInternet: ATInternetType;
184
+ }
185
+ }
186
+
187
+ declare const enum ComponentNameCommon {
188
+ COMMON_HEADER = "common/header",
189
+ COMMON_FOOTER = "common/footer",
190
+ COMMON_NEWSLETTER = "common/newsletter"
191
+ }
192
+ declare const enum ComponentNameRubric {
193
+ RUBRIC_CATEGORY_CARDS = "rubric/category-cards",
194
+ RUBRIC_NEWS_CARDS = "rubric/news-cards",
195
+ RUBRIC_MOST_READ_ARTICLES = "rubric/most-read-articles",
196
+ RUBRIC_PARTNER_CARDS = "rubric/partner-cards",
197
+ ARTICLE_SCROLL_PROGRESS_BAR = "rubric/scroll-progress-bar"
198
+ }
199
+ declare const enum ComponentNameArticle {
200
+ ARTICLE_BREADCRUMB = "article/breadcrumb",
201
+ ARTICLE_OVERVIEW_BAR = "article/overview-bar",
202
+ ARTICLE_HEADER = "article/article-header",
203
+ ARTICLE_IMAGE_COVER = "article/article-image-cover",
204
+ ARTICLE_SOCIAL_BAR = "article/social-bar",
205
+ ARTICLE_SUMMARY = "article/article-summary",
206
+ ARTICLE_CONTENT = "article/article-content",
207
+ ARTICLE_TAG_BAR = "article/tag-bar",
208
+ ARTICLE_SIGNATURE = "article/signature"
209
+ }
210
+ declare const enum ComponentNameHoroscope {
211
+ HOROSCOPE_BREADCRUMB = "horoscope/breadcrumb",
212
+ HOROSCOPE_HEADER_PAGE = "horoscope/header-page",
213
+ HOROSCOPE_HEADER_BANNER = "horoscope/header-banner",
214
+ HOROSCOPE_HOROSCOPE_CONTENT = "horoscope/horoscope-content",
215
+ HOROSCOPE_HOMEPAGE_CONTENT = "horoscope/horoscope-homepage-content",
216
+ HOROSCOPE_LINK = "horoscope/link",
217
+ HOROSCOPE_HOROSCOPE_TILES = "horoscope/horoscope-tiles",
218
+ HOROSCOPE_HOROSCOPE_LINK_NEXT_TYPE = "horoscope/horoscope-link-next-type"
219
+ }
220
+ interface ComponentConfig<TComponentName = ComponentNameCommon | ComponentNameRubric | ComponentNameArticle | ComponentNameHoroscope, TComponent = React$1.FC<any>> {
221
+ componentName: TComponentName;
222
+ component: TComponent;
223
+ expiration?: number;
224
+ }
225
+
226
+ interface PageTemplateProps {
227
+ stylesheets?: {
228
+ name: string;
229
+ url: string;
230
+ }[];
231
+ criticalCss?: string;
232
+ didomiScript: string;
233
+ gtmScript: string;
234
+ gtmNoScript: string;
235
+ mainInlineScript?: string;
236
+ awsRum?: {
237
+ variables: AwsRumVariablesType;
238
+ inlineScript: string;
239
+ };
240
+ datalayerInlineScript?: string;
241
+ dfpInlineScript?: string;
242
+ gtmInlineScript: string;
243
+ callCriticalScripts?: string;
244
+ children: React$1.ReactNode;
245
+ datalayerVariables?: VariablesDataLayerType;
246
+ header: React$1.ReactNode;
247
+ footer: React$1.ReactNode;
248
+ }
249
+ declare const PageTemplate: React$1.FC<PageTemplateProps>;
250
+
251
+ interface ArticlePageProps extends PageTemplateProps {
252
+ overviewBar: React$1.ReactNode;
253
+ breadcrumb: React$1.ReactNode;
254
+ articleHeader: React$1.ReactNode;
255
+ articleImageCover: React$1.ReactNode;
256
+ socialBarAdvanced: React$1.ReactNode;
257
+ signature: React$1.ReactNode;
258
+ articleSummary: React$1.ReactNode;
259
+ articleContent: React$1.ReactNode;
260
+ mostReadArticles: React$1.ReactNode;
261
+ tagBar: React$1.ReactNode;
262
+ categoryCards: React$1.ReactNode;
263
+ newsCards: React$1.ReactNode;
264
+ newsletter: React$1.ReactNode;
265
+ partnerCards: React$1.ReactNode;
266
+ scrollProgressBar: React$1.ReactNode;
267
+ layout?: LayoutType;
268
+ }
269
+ declare const ArticlePage: React$1.FC<ArticlePageProps>;
270
+
271
+ interface HoroscopePageProps extends PageTemplateProps {
272
+ breadcrumb: React$1.ReactNode;
273
+ headerPage: React$1.ReactNode;
274
+ headerBanner: React$1.ReactNode;
275
+ horoscopeContent: React$1.ReactNode;
276
+ link: React$1.ReactNode;
277
+ horoscopeTiles: React$1.ReactNode;
278
+ horoscopeLinkNextType: React$1.ReactNode;
279
+ layout?: LayoutType;
280
+ }
281
+ declare const HoroscopePage: React$1.FC<HoroscopePageProps>;
282
+
283
+ interface HoroscopeHomePageProps extends PageTemplateProps {
284
+ breadcrumb: React$1.ReactNode;
285
+ headerPage: React$1.ReactNode;
286
+ horoscopeTiles: React$1.ReactNode;
287
+ horoscopeLinkNextType: React$1.ReactNode;
288
+ horoscopeHomepageContent: React$1.ReactNode;
289
+ layout?: LayoutType;
290
+ }
291
+ declare const HoroscopeHomePage: React$1.FC<HoroscopeHomePageProps>;
292
+
293
+ declare type PageComponentConfig<TComponentName = string, TPropName = string> = {
294
+ name: TComponentName;
295
+ propName: TPropName;
296
+ useKey: boolean;
297
+ required: boolean;
298
+ };
299
+ declare type PageConfig<TPageName = string, TComponentPage = React.FC<any>, TComponentName = string, TPropName = string> = {
300
+ name: TPageName;
301
+ component: TComponentPage;
302
+ expiration: number;
303
+ components: PageComponentConfig<TComponentName, TPropName>[];
304
+ };
305
+ declare type PageTemplateComponentConfigs = PageComponentConfig<ComponentNameCommon, keyof PageTemplateProps>[];
306
+ declare type ArticlePageConfig = PageConfig<'article', typeof ArticlePage, ComponentNameCommon | ComponentNameRubric | ComponentNameArticle, keyof ArticlePageProps>;
307
+ declare type HoroscopePageConfig = PageConfig<'horoscope', typeof HoroscopePage, ComponentNameCommon | ComponentNameRubric | ComponentNameHoroscope, keyof HoroscopePageProps>;
308
+ declare type HoroscopeHomePageConfig = PageConfig<'horoscopeHome', typeof HoroscopeHomePage, ComponentNameCommon | ComponentNameRubric | ComponentNameHoroscope, keyof HoroscopeHomePageProps>;
309
+ declare type PageConfigs = [ArticlePageConfig, HoroscopePageConfig, HoroscopeHomePageConfig];
310
+ declare type PageConfigAvailable = PageConfigs[number];
311
+
312
+ declare type HeaderScriptsType = 'callCriticalScripts' | 'dfpInlineScript' | 'datalayerInlineScript' | 'didomiScript' | 'gtmInlineScript' | 'gtmScript';
313
+
314
+ declare type BodyScriptsType = 'gtmNoScript';
315
+
316
+ declare const COMPONENT_CONFIGS: ComponentConfig[];
317
+
318
+ declare const PAGE_CONFIGS: PageConfigs;
319
+
320
+ export { AdSizesType, AdSizesTypeKey, ArticlePage, ArticlePageConfig, ArticlePageProps, BodyScriptsType, COMPONENT_CONFIGS, CmpType, ComponentConfig, ComponentNameArticle, ComponentNameCommon, ComponentNameHoroscope, ComponentNameRubric, ContentDataLayerType, DataLayerType, DefaultDataLayerType, DfpDataLayerType, Didomi, DidomiEventListeners, DidomiOnReady, HeaderScriptsType, HoroscopeHomePage, HoroscopeHomePageConfig, HoroscopeHomePageProps, HoroscopePage, HoroscopePageConfig, HoroscopePageProps, PAGE_CONFIGS, PageComponentConfig, PageConfig, PageConfigAvailable, PageConfigs, PageTemplate, PageTemplateComponentConfigs, PageTemplateProps, Slot, Targeting, TargetingKeys, UserDataLayerType, VariablesCmpType, VariablesDataLayerType, pageType, tagsType };