this repo has no description
1import * as models from "./index";
2import * as metrics from "./metrics/metrics";
3export function marketingItemContextFromString(context) {
4 var _a, _b;
5 if (preprocessor.GAMES_TARGET) {
6 switch (context) {
7 case "generic":
8 return "gameCenterGeneric";
9 case "groupingLockup":
10 return "gameCenterLockup";
11 case "arcadeTabHeader":
12 return "gameCenterEditorialPageHeader";
13 case "productPage":
14 return "gameCenterProductPage";
15 case "arcadeComingSoon":
16 return "gameCenterComingSoon";
17 case "gameCenterEditorialPage": // TBD
18 return "gameCenterEditorialPage";
19 default:
20 return (_a = context) !== null && _a !== void 0 ? _a : "gameCenterGeneric";
21 }
22 }
23 switch (context) {
24 case "askToBuy":
25 return "arcadeAskToBuy";
26 case "generic":
27 return "arcadeGeneric";
28 case "groupingLockup":
29 return "arcadeGroupingLockup";
30 case "launchRepair":
31 return "arcadeLaunchRepair";
32 case "productPage":
33 return "arcadeProductPage";
34 case "topShelfATV":
35 return "arcadeTopShelfATV";
36 case "topShelfATVClickThrough":
37 return "arcadeTopShelfATVClickThrough";
38 case "editorialItem":
39 return "arcadeTodayCard";
40 case "editorialItemCanvas":
41 return "arcadeStoryCanvas";
42 case "arcadeComingSoon":
43 return "arcadeComingSoon";
44 case "arcadeTabHeader":
45 return "arcadeTabHeader";
46 case "arcadeTabNavBar":
47 return "arcadeTabNavBar";
48 default:
49 return (_b = context) !== null && _b !== void 0 ? _b : "arcadeGeneric";
50 }
51}
52export function isContextualUpsellContext(context) {
53 if (preprocessor.GAMES_TARGET) {
54 switch (context) {
55 case "gameCenterLockup":
56 case "gameCenterProductPage":
57 return true;
58 default:
59 return false;
60 }
61 }
62 switch (context) {
63 case "arcadeGroupingLockup":
64 case "arcadeProductPage":
65 case "productPage":
66 case "groupingLockup":
67 return true;
68 default:
69 return false;
70 }
71}
72/** @public */
73export class ArcadeSubscribePage extends models.Model {
74 constructor(details, dismissButtonTitle, offerButtonAction, offerDisplayProperties) {
75 super();
76 this.details = details;
77 this.dismissButtonTitle = dismissButtonTitle;
78 this.offerButtonAction = offerButtonAction;
79 this.offerDisplayProperties = offerDisplayProperties;
80 this.pageMetrics = new metrics.PageMetrics();
81 this.pageRenderMetrics = {};
82 }
83}
84/** @public */
85export class ArcadeWelcomeItem extends models.Model {
86 constructor(headline, body, artwork) {
87 super();
88 this.headline = headline;
89 this.body = body;
90 this.artwork = artwork;
91 }
92}
93/** @public */
94export class ArcadeWelcomeContent extends models.Model {
95 constructor(title, subtitle, items, continueAction, familyAction) {
96 super();
97 this.title = title;
98 this.subtitle = subtitle;
99 this.items = items;
100 this.continueAction = continueAction;
101 this.familyAction = familyAction;
102 }
103}
104/** @public */
105export class ArcadeWelcomePage extends models.Model {
106 constructor(individualContent, familyMemberContent) {
107 super();
108 this.individualContent = individualContent;
109 this.familyMemberContent = familyMemberContent;
110 this.pageMetrics = new metrics.PageMetrics();
111 this.pageRenderMetrics = {};
112 }
113}
114/** @public */
115export class MarketingItemRequestInfo extends models.Model {
116 constructor(serviceType, placement, metricsTopic, seed, clientOptions) {
117 super();
118 this.serviceType = serviceType;
119 this.placement = placement;
120 this.seed = seed;
121 this.clientOptions = clientOptions;
122 this.metricsOverlay = { topic: metricsTopic };
123 }
124}
125/** @public */
126export class DynamicUIRequestInfo extends models.Model {
127 constructor(metricsTopic, clientOptions) {
128 super();
129 this.clientOptions = clientOptions;
130 this.metricsOverlay = { topic: metricsTopic };
131 }
132}
133/** @public */
134export class UpsellGridContent extends models.Model {
135 constructor(primaryIcon, icons) {
136 super();
137 this.primaryIcon = primaryIcon;
138 this.icons = icons;
139 }
140}
141/** @public */
142export class AppStoreEngagementTask extends models.Model {
143 constructor(action) {
144 super();
145 this.action = action;
146 }
147}
148/** @public
149 * A model for game category button on Arcade download pack screen.
150 */
151export class ArcadeDownloadPackCategory extends models.ViewModel {
152 constructor(id, title, artwork, gradientStartColor, gradientEndColor) {
153 super();
154 this.id = id;
155 this.title = title;
156 this.artwork = artwork;
157 this.gradientStartColor = gradientStartColor;
158 this.gradientEndColor = gradientEndColor;
159 this.selectActionMetrics = new models.ActionMetrics();
160 this.deselectActionMetrics = new models.ActionMetrics();
161 }
162}
163/** @public
164 * Initial Arcade download pack screen with game categories to select by user.
165 */
166export class ArcadeDownloadPackCategoriesPage extends models.Model {
167 constructor(title, categories, maxNumberOfCategoriesToChoose, maxNumberOfCategoriesToChooseTemplate, numberOfChosenCategoriesTemplate, primaryAction, dismissAction) {
168 super();
169 this.title = title;
170 this.categories = categories;
171 this.maxNumberOfCategoriesToChoose = maxNumberOfCategoriesToChoose;
172 this.maxNumberOfCategoriesToChooseTemplate = maxNumberOfCategoriesToChooseTemplate;
173 this.numberOfChosenCategoriesTemplate = numberOfChosenCategoriesTemplate;
174 this.primaryAction = primaryAction;
175 this.dismissAction = dismissAction;
176 this.pageMetrics = new metrics.PageMetrics();
177 this.pageRenderMetrics = {};
178 }
179}
180/** @public
181 * A lockup model for Arcade download suggestions pack screen with linked Arcade category.
182 */
183export class ArcadeDownloadPackSuggestion extends models.Model {
184 constructor(lockup, categoryId) {
185 super();
186 this.lockup = lockup;
187 this.categoryId = categoryId;
188 }
189}
190/** @public
191 * Follow up Arcade download pack screen with the list of suggested games.
192 */
193export class ArcadeDownloadPackSuggestionsPage extends models.Model {
194 constructor(title, suggestions, getAllAction, getAllButtonStyle, primaryAction, primaryActionKind, primaryActionSecondaryTitle) {
195 super();
196 this.title = title;
197 this.suggestions = suggestions;
198 this.getAllAction = getAllAction;
199 this.getAllButtonStyle = getAllButtonStyle;
200 this.primaryAction = primaryAction;
201 this.primaryActionKind = primaryActionKind;
202 this.primaryActionSecondaryTitle = primaryActionSecondaryTitle;
203 this.pageMetrics = new metrics.PageMetrics();
204 this.pageRenderMetrics = {};
205 }
206}
207/**
208 * Matches untyped string with `ArcadeOnboardingSubscriptionStatus` typed value.
209 * It is used to convert opaque `string` value that is passed across JS bridge from native code.
210 * @param value `string` value with the same content.
211 */
212export function arcadeOnboardingSubscriptionStatusFromString(value) {
213 switch (value) {
214 case "new":
215 return "new";
216 case "existing":
217 return "existing";
218 default:
219 return "unknown";
220 }
221}
222/** @public
223 * Purchase params to use in`ASDPurchaseManager.purchaseBatch` call.
224 */
225export class BatchPurchaseParams {
226 constructor(items, commonBuyParams) {
227 this.items = items;
228 this.commonBuyParams = commonBuyParams;
229 }
230}
231/** @public
232 * Decorated purchase for a product with a separate buyParams map.
233 */
234export class BatchPurchaseItem {
235 constructor(purchase, buyParams) {
236 this.purchase = purchase;
237 this.buyParams = buyParams;
238 }
239}
240//# sourceMappingURL=arcade.js.map