@revenuecat/purchases-js 0.5.0 → 0.7.0
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.
- package/dist/Purchases.es.d.ts +35 -2
- package/dist/Purchases.es.js +1829 -1721
- package/dist/Purchases.umd.js +4 -4
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/Purchases.es.d.ts
CHANGED
|
@@ -170,6 +170,18 @@ export declare enum ErrorCode {
|
|
|
170
170
|
InvalidEmailError = 38
|
|
171
171
|
}
|
|
172
172
|
|
|
173
|
+
/**
|
|
174
|
+
* Parameters for the {@link Purchases.getOfferings} method.
|
|
175
|
+
* @public
|
|
176
|
+
*/
|
|
177
|
+
export declare interface GetOfferingsParams {
|
|
178
|
+
/**
|
|
179
|
+
* The currency code in ISO 4217 to fetch the offerings for.
|
|
180
|
+
* If not specified, the default currency will be used.
|
|
181
|
+
*/
|
|
182
|
+
readonly currency?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
173
185
|
/**
|
|
174
186
|
* Parameters used to customise the http requests executed by purchases-js.
|
|
175
187
|
* @public
|
|
@@ -415,9 +427,14 @@ export declare interface PresentedOfferingContext {
|
|
|
415
427
|
*/
|
|
416
428
|
export declare interface Price {
|
|
417
429
|
/**
|
|
418
|
-
* Price in
|
|
430
|
+
* Price in cents of the currency.
|
|
431
|
+
* @deprecated - Use {@link Price.amountMicros} instead.
|
|
419
432
|
*/
|
|
420
433
|
readonly amount: number;
|
|
434
|
+
/**
|
|
435
|
+
* Price in micro-units of the currency. For example, $9.99 is represented as 9990000.
|
|
436
|
+
*/
|
|
437
|
+
readonly amountMicros: number;
|
|
421
438
|
/**
|
|
422
439
|
* Returns ISO 4217 currency code for price.
|
|
423
440
|
* For example, if price is specified in British pounds sterling,
|
|
@@ -497,6 +514,10 @@ export declare interface Product {
|
|
|
497
514
|
* The context from which this product was obtained.
|
|
498
515
|
*/
|
|
499
516
|
readonly presentedOfferingContext: PresentedOfferingContext;
|
|
517
|
+
/**
|
|
518
|
+
* The default purchase option for this product.
|
|
519
|
+
*/
|
|
520
|
+
readonly defaultPurchaseOption: PurchaseOption;
|
|
500
521
|
/**
|
|
501
522
|
* The default subscription option for this product. Null if no subscription
|
|
502
523
|
* options are available like in the case of consumables and non-consumables.
|
|
@@ -523,6 +544,10 @@ export declare interface PurchaseOption {
|
|
|
523
544
|
* The unique id for a purchase option
|
|
524
545
|
*/
|
|
525
546
|
readonly id: string;
|
|
547
|
+
/**
|
|
548
|
+
* The public price id for this subscription option.
|
|
549
|
+
*/
|
|
550
|
+
readonly priceId: string;
|
|
526
551
|
}
|
|
527
552
|
|
|
528
553
|
/**
|
|
@@ -582,11 +607,19 @@ export declare class Purchases {
|
|
|
582
607
|
* @throws {@link PurchasesError} if the API key or user id are invalid.
|
|
583
608
|
*/
|
|
584
609
|
static configure(apiKey: string, appUserId: string, httpConfig?: HttpConfig): Purchases;
|
|
610
|
+
/**
|
|
611
|
+
* Loads and caches some optional data in the Purchases SDK.
|
|
612
|
+
* Currently only fetching branding information. You can call this method
|
|
613
|
+
* after configuring the SDK to speed up the first call to
|
|
614
|
+
* {@link Purchases.purchase}.
|
|
615
|
+
*/
|
|
616
|
+
preload(): Promise<void>;
|
|
617
|
+
private hasLoadedResources;
|
|
585
618
|
/**
|
|
586
619
|
* Fetch the configured offerings for this user. You can configure these
|
|
587
620
|
* in the RevenueCat dashboard.
|
|
588
621
|
*/
|
|
589
|
-
getOfferings(): Promise<Offerings>;
|
|
622
|
+
getOfferings(params?: GetOfferingsParams): Promise<Offerings>;
|
|
590
623
|
/**
|
|
591
624
|
* Convenience method to check whether a user is entitled to a specific
|
|
592
625
|
* entitlement. This will use {@link Purchases.getCustomerInfo} under the hood.
|