@revenuecat/purchases-capacitor 6.0.0-beta.1

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,657 @@
1
+ import type { CustomerInfo, CustomerInfoUpdateListener, GoogleProductChangeInfo, IntroEligibility, LogHandler, LogInResult, MakePurchaseResult, PurchasesConfiguration, PurchasesEntitlementInfo, PurchasesOfferings, PurchasesPackage, PurchasesPromotionalOffer, PurchasesStoreProduct, PurchasesStoreProductDiscount, SubscriptionOption, BILLING_FEATURE, LOG_LEVEL, PRODUCT_CATEGORY, REFUND_REQUEST_STATUS } from '@revenuecat/purchases-typescript-internal';
2
+ export * from '@revenuecat/purchases-typescript-internal';
3
+ export declare type PurchasesCallbackId = string;
4
+ export interface GetProductOptions {
5
+ /**
6
+ * Array of product identifiers to obtain
7
+ */
8
+ productIdentifiers: string[];
9
+ /**
10
+ * Optional type of products to fetch, can be SUBSCRIPTION or NON_SUBSCRIPTION. SUBSCRIPTION by default. Ignored in iOS.
11
+ */
12
+ type?: PRODUCT_CATEGORY;
13
+ }
14
+ export interface PurchaseStoreProductOptions {
15
+ /**
16
+ * The product you want to purchase
17
+ */
18
+ product: PurchasesStoreProduct;
19
+ /**
20
+ * Android only. Optional GoogleProductChangeInfo you
21
+ * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
22
+ */
23
+ googleProductChangeInfo?: GoogleProductChangeInfo | null;
24
+ /**
25
+ * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
26
+ * For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true.
27
+ * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
28
+ */
29
+ googleIsPersonalizedPrice?: boolean | null;
30
+ }
31
+ export interface PurchaseDiscountedProductOptions {
32
+ /**
33
+ * The product you want to purchase
34
+ */
35
+ product: PurchasesStoreProduct;
36
+ /**
37
+ * Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
38
+ */
39
+ discount: PurchasesPromotionalOffer;
40
+ }
41
+ export interface PurchasePackageOptions {
42
+ /**
43
+ * The Package you wish to purchase. You can get the Packages by calling getOfferings
44
+ */
45
+ aPackage: PurchasesPackage;
46
+ /**
47
+ * Android only. Optional GoogleProductChangeInfo you
48
+ * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
49
+ */
50
+ googleProductChangeInfo?: GoogleProductChangeInfo | null;
51
+ /**
52
+ * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
53
+ * For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true.
54
+ * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
55
+ */
56
+ googleIsPersonalizedPrice?: boolean | null;
57
+ }
58
+ export interface PurchaseSubscriptionOptionOptions {
59
+ /**
60
+ * The SubscriptionOption you wish to purchase. You can get the SubscriptionOption from StoreProducts by calling getOfferings
61
+ */
62
+ subscriptionOption: SubscriptionOption;
63
+ /**
64
+ * Android only. Optional GoogleProductChangeInfo you
65
+ * wish to upgrade from containing the oldProductIdentifier and the optional prorationMode.
66
+ */
67
+ googleProductChangeInfo?: GoogleProductChangeInfo | null;
68
+ /**
69
+ * Android and Google only. Optional boolean indicates personalized pricing on products available for purchase in the EU.
70
+ * For compliance with EU regulations. User will see "This price has been customized for you" in the purchase dialog when true.
71
+ * See https://developer.android.com/google/play/billing/integrate#personalized-price for more info.
72
+ */
73
+ googleIsPersonalizedPrice?: boolean | null;
74
+ }
75
+ export interface PurchaseDiscountedPackageOptions {
76
+ /**
77
+ * The Package you wish to purchase. You can get the Packages by calling getOfferings
78
+ */
79
+ aPackage: PurchasesPackage;
80
+ /**
81
+ * Discount to apply to this package. Retrieve this discount using getPromotionalOffer.
82
+ */
83
+ discount: PurchasesPromotionalOffer;
84
+ }
85
+ export interface SyncObserverModeAmazonPurchaseOptions {
86
+ /**
87
+ * Product ID associated to the purchase.
88
+ */
89
+ productID: string;
90
+ /**
91
+ * ReceiptId that represents the Amazon purchase.
92
+ */
93
+ receiptID: string;
94
+ /**
95
+ * Amazon's userID. This parameter will be ignored when syncing a Google purchase.
96
+ */
97
+ amazonUserID: string;
98
+ /**
99
+ * Product's currency code in ISO 4217 format.
100
+ */
101
+ isoCurrencyCode?: string | null;
102
+ /**
103
+ * Product's price.
104
+ */
105
+ price?: number | null;
106
+ }
107
+ export interface GetPromotionalOfferOptions {
108
+ /**
109
+ * The `PurchasesStoreProduct` the user intends to purchase.
110
+ */
111
+ product: PurchasesStoreProduct;
112
+ /**
113
+ * The `PurchasesStoreProductDiscount` to apply to the product.
114
+ */
115
+ discount: PurchasesStoreProductDiscount;
116
+ }
117
+ export interface PurchasesPlugin {
118
+ /**
119
+ * Sets up Purchases with your API key and an app user id.
120
+ * @param {PurchasesConfiguration} configuration RevenueCat configuration object including the API key and other optional parameters. See {@link PurchasesConfiguration}
121
+ */
122
+ configure(configuration: PurchasesConfiguration): Promise<void>;
123
+ /**
124
+ * @param options Set finishTransactions to false if you aren't using Purchases SDK to
125
+ * make the purchase
126
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
127
+ */
128
+ setFinishTransactions(options: {
129
+ finishTransactions: boolean;
130
+ }): Promise<void>;
131
+ /**
132
+ * iOS only.
133
+ * @param options Set this property to true *only* when testing the ask-to-buy / SCA
134
+ * purchases flow. More information: http://errors.rev.cat/ask-to-buy
135
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
136
+ */
137
+ setSimulatesAskToBuyInSandbox(options: {
138
+ simulatesAskToBuyInSandbox: boolean;
139
+ }): Promise<void>;
140
+ /**
141
+ * Sets a function to be called on updated customer info
142
+ * @param {CustomerInfoUpdateListener} customerInfoUpdateListener CustomerInfo update listener
143
+ */
144
+ addCustomerInfoUpdateListener(customerInfoUpdateListener: CustomerInfoUpdateListener): Promise<PurchasesCallbackId>;
145
+ /**
146
+ * Removes a given CustomerInfoUpdateListener
147
+ * @param {CustomerInfoUpdateListener} listenerToRemove CustomerInfoUpdateListener reference of the listener to remove
148
+ * @returns Promise with boolean. True if listener was removed, false otherwise
149
+ */
150
+ removeCustomerInfoUpdateListener(listenerToRemove: PurchasesCallbackId): Promise<{
151
+ wasRemoved: boolean;
152
+ }>;
153
+ /**
154
+ * Gets the map of entitlements -> offerings -> products
155
+ * @returns {Promise<PurchasesOfferings>} Promise of entitlements structure. The promise will be rejected if configure
156
+ * has not been called yet.
157
+ */
158
+ getOfferings(): Promise<PurchasesOfferings>;
159
+ /**
160
+ * Fetch the product info
161
+ * @returns {Promise<PurchasesStoreProduct[]>} A promise containing an array of products. The promise will be rejected
162
+ * if the products are not properly configured in RevenueCat or if there is another error retrieving them.
163
+ * Rejections return an error code, and a userInfo object with more information. The promise will also be rejected
164
+ * if configure has not been called yet.
165
+ */
166
+ getProducts(options: GetProductOptions): Promise<{
167
+ products: PurchasesStoreProduct[];
168
+ }>;
169
+ /**
170
+ * Make a purchase
171
+ *
172
+ * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
173
+ * a customer info object and a product identifier. Rejections return an error code,
174
+ * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will
175
+ * also be rejected if configure has not been called yet.
176
+ */
177
+ purchaseStoreProduct(options: PurchaseStoreProductOptions): Promise<MakePurchaseResult>;
178
+ /**
179
+ * iOS only. Purchase a product applying a given discount.
180
+ *
181
+ * @returns {Promise<{ productIdentifier: string, customerInfo:CustomerInfo }>} A promise of an object containing
182
+ * a customer info object and a product identifier. Rejections return an error code,
183
+ * a boolean indicating if the user cancelled the purchase, and an object with more information. The promise will be
184
+ * rejected if configure has not been called yet.
185
+ */
186
+ purchaseDiscountedProduct(options: PurchaseDiscountedProductOptions): Promise<MakePurchaseResult>;
187
+ /**
188
+ * Make a purchase
189
+ *
190
+ * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
191
+ * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
192
+ * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
193
+ * has not been called yet.
194
+ */
195
+ purchasePackage(options: PurchasePackageOptions): Promise<MakePurchaseResult>;
196
+ /**
197
+ * Google only. Make a purchase of a subscriptionOption
198
+ *
199
+ * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
200
+ * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
201
+ * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
202
+ * has not been called yet.
203
+ */
204
+ purchaseSubscriptionOption(options: PurchaseSubscriptionOptionOptions): Promise<MakePurchaseResult>;
205
+ /**
206
+ * iOS only. Purchase a package applying a given discount.
207
+ *
208
+ * @returns {Promise<{ productIdentifier: string, customerInfo: CustomerInfo }>} A promise of an object containing
209
+ * a customer info object and a product identifier. Rejections return an error code, a boolean indicating if the
210
+ * user cancelled the purchase, and an object with more information. The promise will be also be rejected if configure
211
+ * has not been called yet.
212
+ */
213
+ purchaseDiscountedPackage(options: PurchaseDiscountedPackageOptions): Promise<MakePurchaseResult>;
214
+ /**
215
+ * Restores a user's previous purchases and links their appUserIDs to any user's also using those purchases.
216
+ * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code, and an
217
+ * userInfo object with more information. The promise will be also be rejected if configure has not been called yet.
218
+ */
219
+ restorePurchases(): Promise<{
220
+ customerInfo: CustomerInfo;
221
+ }>;
222
+ /**
223
+ * Get the appUserID
224
+ * @returns {Promise<string>} The app user id in a promise
225
+ */
226
+ getAppUserID(): Promise<{
227
+ appUserID: string;
228
+ }>;
229
+ /**
230
+ * This function will log in the current user with an appUserID. Typically, this would be used after a log in
231
+ * to identify a user without calling configure.
232
+ * @param options The appUserID that should be linked to the current user
233
+ * @returns {Promise<LogInResult>} A promise of an object that contains the customerInfo after logging in, as well
234
+ * as a boolean indicating whether the user has just been created for the first time in the RevenueCat backend. The
235
+ * promise will be rejected if configure has not been called yet or if there's an issue logging in.
236
+ */
237
+ logIn(options: {
238
+ appUserID: string;
239
+ }): Promise<LogInResult>;
240
+ /**
241
+ * Logs out the Purchases client clearing the saved appUserID. This will generate a random user id and save it in the cache.
242
+ * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code,
243
+ * and a userInfo object with more information. The promise will be rejected if configure has not been called yet or if
244
+ * there's an issue logging out.
245
+ */
246
+ logOut(): Promise<{
247
+ customerInfo: CustomerInfo;
248
+ }>;
249
+ /**
250
+ * Used to set the log level. Useful for debugging issues with the lovely team @RevenueCat.
251
+ * The default is {LOG_LEVEL.INFO} in release builds and {LOG_LEVEL.DEBUG} in debug builds.
252
+ * @param options Log level to use to display logs.
253
+ */
254
+ setLogLevel(options: {
255
+ level: LOG_LEVEL;
256
+ }): Promise<void>;
257
+ /**
258
+ * Set a custom log handler for redirecting logs to your own logging system.
259
+ * By default, this sends info, warning, and error messages.
260
+ * If you wish to receive Debug level messages, see [setLogLevel].
261
+ * @param {LogHandler} logHandler It will get called for each log event.
262
+ * Use this function to redirect the log to your own logging system
263
+ */
264
+ setLogHandler(logHandler: LogHandler): Promise<void>;
265
+ /**
266
+ * Gets current customer info
267
+ * @returns {Promise<{ customerInfo: CustomerInfo }>} A promise of a customer info object. Rejections return an error code, and an
268
+ * userInfo object with more information. The promise will be rejected if configure has not been called yet or if
269
+ * there's an issue getting the customer information.
270
+ */
271
+ getCustomerInfo(): Promise<{
272
+ customerInfo: CustomerInfo;
273
+ }>;
274
+ /**
275
+ * This method will send all the purchases to the RevenueCat backend. Call this when using your own implementation
276
+ * for subscriptions anytime a sync is needed, like after a successful purchase.
277
+ *
278
+ * @warning This function should only be called if you're not calling purchaseProduct/purchaseStoreProduct/purchasePackage/purchaseSubscriptionOption.
279
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
280
+ * syncing purchases.
281
+ */
282
+ syncPurchases(): Promise<void>;
283
+ /**
284
+ * This method will send a purchase to the RevenueCat backend. This function should only be called if you are
285
+ * in Amazon observer mode or performing a client side migration of your current users to RevenueCat.
286
+ *
287
+ * The receipt IDs are cached if successfully posted, so they are not posted more than once.
288
+ *
289
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
290
+ * syncing purchases.
291
+ */
292
+ syncObserverModeAmazonPurchase(options: SyncObserverModeAmazonPurchaseOptions): Promise<void>;
293
+ /**
294
+ * Enable automatic collection of Apple Search Ad attribution on iOS. Disabled by default. Supported in iOS 14.3+ only
295
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet.
296
+ */
297
+ enableAdServicesAttributionTokenCollection(): Promise<void>;
298
+ /**
299
+ * @returns { Promise<boolean> } If the `appUserID` has been generated by RevenueCat or not.
300
+ * The promise will be rejected if configure has not been called yet.
301
+ */
302
+ isAnonymous(): Promise<{
303
+ isAnonymous: boolean;
304
+ }>;
305
+ /**
306
+ * iOS only. Computes whether a user is eligible for the introductory pricing period of a given product.
307
+ * You should use this method to determine whether you show the user the normal product price or the
308
+ * introductory price. This also applies to trials (trials are considered a type of introductory pricing).
309
+ *
310
+ * @note Subscription groups are automatically collected for determining eligibility. If RevenueCat can't
311
+ * definitively compute the eligibility, most likely because of missing group information, it will return
312
+ * `INTRO_ELIGIBILITY_STATUS_UNKNOWN`. The best course of action on unknown status is to display the non-intro
313
+ * pricing, to not create a misleading situation. To avoid this, make sure you are testing with the latest version of
314
+ * iOS so that the subscription group can be collected by the SDK. Android always returns INTRO_ELIGIBILITY_STATUS_UNKNOWN.
315
+ *
316
+ * @param options Array of product identifiers for which you want to compute eligibility
317
+ * @returns { Promise<[productId: string]: IntroEligibility> } A map of IntroEligility per productId. The promise
318
+ * will be rejected if configure has not been called yet or if there's in an error checking eligibility.
319
+ */
320
+ checkTrialOrIntroductoryPriceEligibility(options: {
321
+ productIdentifiers: string[];
322
+ }): Promise<{
323
+ [productId: string]: IntroEligibility;
324
+ }>;
325
+ /**
326
+ * iOS only. Use this function to retrieve the `PurchasesPromotionalOffer` for a given `PurchasesPackage`.
327
+ *
328
+ * @returns { Promise<PurchasesPromotionalOffer | undefined> } Returns when the `PurchasesPaymentDiscount` is returned.
329
+ * Null is returned for Android and incompatible iOS versions. The promise will be rejected if configure has not been
330
+ * called yet or if there's an error getting the payment discount.
331
+ */
332
+ getPromotionalOffer(options: GetPromotionalOfferOptions): Promise<PurchasesPromotionalOffer | undefined>;
333
+ /**
334
+ * Invalidates the cache for customer information.
335
+ *
336
+ * Most apps will not need to use this method; invalidating the cache can leave your app in an invalid state.
337
+ * Refer to https://docs.revenuecat.com/docs/customer-info#section-get-user-information for more information on
338
+ * using the cache properly.
339
+ *
340
+ * This is useful for cases where customer information might have been updated outside the app, like if a
341
+ * promotional subscription is granted through the RevenueCat dashboard.
342
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
343
+ * invalidating the customer info cache.
344
+ */
345
+ invalidateCustomerInfoCache(): Promise<void>;
346
+ /** iOS 14.0+ only. Presents a code redemption sheet, useful for redeeming offer codes
347
+ * Refer to https://docs.revenuecat.com/docs/ios-subscription-offers#offer-codes for more information on how
348
+ * to configure and use offer codes
349
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
350
+ * presenting the code redemption sheet.
351
+ */
352
+ presentCodeRedemptionSheet(): Promise<void>;
353
+ /**
354
+ * Subscriber attributes are useful for storing additional, structured information on a user.
355
+ * Since attributes are writable using a public key they should not be used for
356
+ * managing secure or sensitive information such as subscription status, coins, etc.
357
+ *
358
+ * Key names starting with "$" are reserved names used by RevenueCat. For a full list of key
359
+ * restrictions refer to our guide: https://docs.revenuecat.com/docs/subscriber-attributes
360
+ *
361
+ * @param attributes Map of attributes by key. Set the value as an empty string to delete an attribute.
362
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or there's an error
363
+ * setting the subscriber attributes.
364
+ */
365
+ setAttributes(attributes: {
366
+ [key: string]: string | null;
367
+ }): Promise<void>;
368
+ /**
369
+ * Subscriber attribute associated with the email address for the user
370
+ *
371
+ * @param options Empty String or null will delete the subscriber attribute.
372
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
373
+ * setting the email.
374
+ */
375
+ setEmail(options: {
376
+ email: string | null;
377
+ }): Promise<void>;
378
+ /**
379
+ * Subscriber attribute associated with the phone number for the user
380
+ *
381
+ * @param options Empty String or null will delete the subscriber attribute.
382
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
383
+ * setting the phone number.
384
+ */
385
+ setPhoneNumber(options: {
386
+ phoneNumber: string | null;
387
+ }): Promise<void>;
388
+ /**
389
+ * Subscriber attribute associated with the display name for the user
390
+ *
391
+ * @param options Empty String or null will delete the subscriber attribute.
392
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
393
+ * setting the display name.
394
+ */
395
+ setDisplayName(options: {
396
+ displayName: string | null;
397
+ }): Promise<void>;
398
+ /**
399
+ * Subscriber attribute associated with the push token for the user
400
+ *
401
+ * @param options null will delete the subscriber attribute.
402
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
403
+ * setting the push token.
404
+ */
405
+ setPushToken(options: {
406
+ pushToken: string | null;
407
+ }): Promise<void>;
408
+ /**
409
+ * Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value
410
+ * from your RevenueCat contact.
411
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
412
+ * setting the proxy url.
413
+ */
414
+ setProxyURL(options: {
415
+ url: string;
416
+ }): Promise<void>;
417
+ /**
418
+ * Automatically collect subscriber attributes associated with the device identifiers.
419
+ * $idfa, $idfv, $ip on iOS
420
+ * $gpsAdId, $androidId, $ip on Android
421
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
422
+ * setting collecting the device identifiers.
423
+ */
424
+ collectDeviceIdentifiers(): Promise<void>;
425
+ /**
426
+ * Subscriber attribute associated with the Adjust ID for the user
427
+ * Required for the RevenueCat Adjust integration
428
+ *
429
+ * @param options Adjust ID to use in Adjust integration. Empty String or null will delete the subscriber attribute.
430
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
431
+ * setting Adjust ID.
432
+ */
433
+ setAdjustID(options: {
434
+ adjustID: string | null;
435
+ }): Promise<void>;
436
+ /**
437
+ * Subscriber attribute associated with the AppsFlyer ID for the user
438
+ * Required for the RevenueCat AppsFlyer integration
439
+ * @param options Appsflyer ID to use in Appsflyer integration. Empty String or null will delete the subscriber attribute.
440
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
441
+ * setting the Appsflyer ID.
442
+ */
443
+ setAppsflyerID(options: {
444
+ appsflyerID: string | null;
445
+ }): Promise<void>;
446
+ /**
447
+ * Subscriber attribute associated with the Facebook SDK Anonymous ID for the user
448
+ * Recommended for the RevenueCat Facebook integration
449
+ *
450
+ * @param options Facebook Anonymous ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
451
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
452
+ * setting the Facebook Anonymous ID.
453
+ */
454
+ setFBAnonymousID(options: {
455
+ fbAnonymousID: string | null;
456
+ }): Promise<void>;
457
+ /**
458
+ * Subscriber attribute associated with the mParticle ID for the user
459
+ * Recommended for the RevenueCat mParticle integration
460
+ *
461
+ * @param options Mparticle ID to use in Mparticle integration. Empty String or null will delete the subscriber attribute.
462
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
463
+ * setting the Mparticle ID.
464
+ */
465
+ setMparticleID(options: {
466
+ mparticleID: string | null;
467
+ }): Promise<void>;
468
+ /**
469
+ * Subscriber attribute associated with the CleverTap ID for the user
470
+ * Required for the RevenueCat CleverTap integration
471
+ *
472
+ * @param options CleverTap user ID to use in CleverTap integration. Empty String or null will delete the subscriber attribute.
473
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
474
+ * setting the CleverTap ID.
475
+ */
476
+ setCleverTapID(options: {
477
+ cleverTapID: string | null;
478
+ }): Promise<void>;
479
+ /**
480
+ * Subscriber attribute associated with the Mixpanel Distinct ID for the user
481
+ * Required for the RevenueCat Mixpanel integration
482
+ *
483
+ * @param options Mixpanel Distinct ID to use in Mixpanel integration. Empty String or null will delete the subscriber attribute.
484
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
485
+ * setting the Mixpanel Distinct ID.
486
+ */
487
+ setMixpanelDistinctID(options: {
488
+ mixpanelDistinctID: string | null;
489
+ }): Promise<void>;
490
+ /**
491
+ * Subscriber attribute associated with the Firebase App Instance ID for the user
492
+ * Required for the RevenueCat Firebase integration
493
+ *
494
+ * @param options Firebase App Instance ID to use in Firebase integration. Empty String or null will delete the subscriber attribute.
495
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
496
+ * setting the Firebase App Instance ID.
497
+ */
498
+ setFirebaseAppInstanceID(options: {
499
+ firebaseAppInstanceID: string | null;
500
+ }): Promise<void>;
501
+ /**
502
+ * Subscriber attribute associated with the OneSignal Player ID for the user
503
+ * Required for the RevenueCat OneSignal integration
504
+ *
505
+ * @param options OneSignal Player ID to use in OneSignal integration. Empty String or null will delete the subscriber attribute.
506
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
507
+ * setting the OneSignal ID.
508
+ */
509
+ setOnesignalID(options: {
510
+ onesignalID: string | null;
511
+ }): Promise<void>;
512
+ /**
513
+ * Subscriber attribute associated with the Airship Channel ID for the user
514
+ * Required for the RevenueCat Airship integration
515
+ *
516
+ * @param options Airship Channel ID to use in Airship integration. Empty String or null will delete the subscriber attribute.
517
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
518
+ * setting the Airship Channel ID.
519
+ */
520
+ setAirshipChannelID(options: {
521
+ airshipChannelID: string | null;
522
+ }): Promise<void>;
523
+ /**
524
+ * Subscriber attribute associated with the install media source for the user
525
+ *
526
+ * @param options Empty String or null will delete the subscriber attribute.
527
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
528
+ * setting the media source.
529
+ */
530
+ setMediaSource(options: {
531
+ mediaSource: string | null;
532
+ }): Promise<void>;
533
+ /**
534
+ * Subscriber attribute associated with the install campaign for the user
535
+ *
536
+ * @param options Empty String or null will delete the subscriber attribute.
537
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
538
+ * setting the campaign.
539
+ */
540
+ setCampaign(options: {
541
+ campaign: string | null;
542
+ }): Promise<void>;
543
+ /**
544
+ * Subscriber attribute associated with the install ad group for the user
545
+ *
546
+ * @param options Empty String or null will delete the subscriber attribute.
547
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
548
+ * setting ad group.
549
+ */
550
+ setAdGroup(options: {
551
+ adGroup: string | null;
552
+ }): Promise<void>;
553
+ /**
554
+ * Subscriber attribute associated with the install ad for the user
555
+ *
556
+ * @param options Empty String or null will delete the subscriber attribute.
557
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
558
+ * setting the ad subscriber attribute.
559
+ */
560
+ setAd(options: {
561
+ ad: string | null;
562
+ }): Promise<void>;
563
+ /**
564
+ * Subscriber attribute associated with the install keyword for the user
565
+ *
566
+ * @param options Empty String or null will delete the subscriber attribute.
567
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
568
+ * setting the keyword.
569
+ */
570
+ setKeyword(options: {
571
+ keyword: string | null;
572
+ }): Promise<void>;
573
+ /**
574
+ * Subscriber attribute associated with the install ad creative for the user
575
+ *
576
+ * @param options Empty String or null will delete the subscriber attribute.
577
+ * @returns {Promise<void>} The promise will be rejected if configure has not been called yet or if there's an error
578
+ * setting the creative subscriber attribute.
579
+ */
580
+ setCreative(options: {
581
+ creative: string | null;
582
+ }): Promise<void>;
583
+ /**
584
+ * Check if billing is supported for the current user (meaning IN-APP purchases are supported)
585
+ * and optionally, whether a list of specified feature types are supported.
586
+ *
587
+ * Note: Billing features are only relevant to Google Play Android users.
588
+ * For other stores and platforms, billing features won't be checked.
589
+ *
590
+ * @param options An array of feature types to check for support. Feature types must be one of
591
+ * [BILLING_FEATURE]. By default, is an empty list and no specific feature support will be checked.
592
+ * @returns promise with boolean response. True if billing is supported, false otherwise.
593
+ */
594
+ canMakePayments(options?: {
595
+ features?: BILLING_FEATURE[];
596
+ }): Promise<{
597
+ canMakePayments: boolean;
598
+ }>;
599
+ /**
600
+ * iOS 15+ only. Presents a refund request sheet in the current window scene for
601
+ * the latest transaction associated with the active entitlement.
602
+ *
603
+ * If the request was unsuccessful, no active entitlements could be found for
604
+ * the user, or multiple active entitlements were found for the user,
605
+ * the promise will return an error.
606
+ * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.
607
+ *
608
+ * Important: This method should only be used if your user can only have a single active entitlement at a given time.
609
+ * If a user could have more than one entitlement at a time, use `beginRefundRequestForEntitlement` instead.
610
+ *
611
+ * @returns Returns refundRequestStatus: The status of the
612
+ * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
613
+ */
614
+ beginRefundRequestForActiveEntitlement(): Promise<{
615
+ refundRequestStatus: REFUND_REQUEST_STATUS;
616
+ }>;
617
+ /**
618
+ * iOS 15+ only. Presents a refund request sheet in the current window scene for
619
+ * the latest transaction associated with the `entitlement`.
620
+ *
621
+ * If the request was unsuccessful, the promise will return an error.
622
+ * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.
623
+ *
624
+ * @param options The entitlement to begin a refund request for.
625
+ * @returns Returns refundRequestStatus: The status of the
626
+ * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
627
+ */
628
+ beginRefundRequestForEntitlement(options: {
629
+ entitlementInfo: PurchasesEntitlementInfo;
630
+ }): Promise<{
631
+ refundRequestStatus: REFUND_REQUEST_STATUS;
632
+ }>;
633
+ /**
634
+ * iOS 15+ only. Presents a refund request sheet in the current window scene for
635
+ * the latest transaction associated with the `product`.
636
+ *
637
+ * If the request was unsuccessful, the promise will return an error.
638
+ * If called in an unsupported platform (Android or iOS < 15), an `UnsupportedPlatformException` will be thrown.
639
+ *
640
+ * @param options The StoreProduct to begin a refund request for.
641
+ * @returns {Promise<REFUND_REQUEST_STATUS>} Returns a REFUND_REQUEST_STATUS: The status of the
642
+ * refund request. Keep in mind the status could be REFUND_REQUEST_STATUS.USER_CANCELLED
643
+ */
644
+ beginRefundRequestForProduct(options: {
645
+ storeProduct: PurchasesStoreProduct;
646
+ }): Promise<{
647
+ refundRequestStatus: REFUND_REQUEST_STATUS;
648
+ }>;
649
+ /**
650
+ * Check if configure has finished and Purchases has been configured.
651
+ *
652
+ * @returns promise with boolean response
653
+ */
654
+ isConfigured(): Promise<{
655
+ isConfigured: boolean;
656
+ }>;
657
+ }
@@ -0,0 +1,2 @@
1
+ export * from '@revenuecat/purchases-typescript-internal';
2
+ //# sourceMappingURL=definitions.js.map