@revenuecat/purchases-js 1.12.1 → 1.13.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 +62 -0
- package/dist/Purchases.es.js +2568 -2394
- package/dist/Purchases.umd.js +56 -45
- package/package.json +1 -1
package/dist/Purchases.es.d.ts
CHANGED
|
@@ -978,6 +978,29 @@ export declare class Purchases {
|
|
|
978
978
|
* @returns Whether the current user is anonymous.
|
|
979
979
|
*/
|
|
980
980
|
isAnonymous(): boolean;
|
|
981
|
+
/**
|
|
982
|
+
* Fetches the virtual currencies for the current subscriber.
|
|
983
|
+
*
|
|
984
|
+
* @returns {Promise<VirtualCurrencies>} A VirtualCurrencies object containing the subscriber's virtual currencies.
|
|
985
|
+
*/
|
|
986
|
+
getVirtualCurrencies(): Promise<VirtualCurrencies>;
|
|
987
|
+
/**
|
|
988
|
+
* The currently cached {@link VirtualCurrencies} if one is available.
|
|
989
|
+
* This value will remain null until virtual currencies have been fetched at
|
|
990
|
+
* least once with {@link Purchases.getVirtualCurrencies} or an equivalent function.
|
|
991
|
+
*
|
|
992
|
+
* @returns {VirtualCurrencies | null} A {@link VirtualCurrencies} object containing the subscriber's virtual currencies,
|
|
993
|
+
* or null if no cached data is available.
|
|
994
|
+
*/
|
|
995
|
+
getCachedVirtualCurrencies(): VirtualCurrencies | null;
|
|
996
|
+
/**
|
|
997
|
+
* Invalidates the cache for virtual currencies.
|
|
998
|
+
*
|
|
999
|
+
* This is useful for cases where a virtual currency's balance might have been updated
|
|
1000
|
+
* in a different part of your system, like if you decreased a user's balance from the user spending a virtual currency,
|
|
1001
|
+
* or if you increased the balance from your backend using the server APIs.
|
|
1002
|
+
*/
|
|
1003
|
+
invalidateVirtualCurrenciesCache(): void;
|
|
981
1004
|
/**
|
|
982
1005
|
* Closes the Purchases instance. You should never have to do this normally.
|
|
983
1006
|
*/
|
|
@@ -1449,4 +1472,43 @@ export declare class Purchases {
|
|
|
1449
1472
|
constructor();
|
|
1450
1473
|
}
|
|
1451
1474
|
|
|
1475
|
+
/**
|
|
1476
|
+
* The VirtualCurrencies object contains all the virtual currencies associated to the user.
|
|
1477
|
+
*
|
|
1478
|
+
* @public
|
|
1479
|
+
*/
|
|
1480
|
+
export declare interface VirtualCurrencies {
|
|
1481
|
+
/**
|
|
1482
|
+
* Map of all {@link VirtualCurrency} objects keyed by virtual currency code.
|
|
1483
|
+
*/
|
|
1484
|
+
readonly all: {
|
|
1485
|
+
[key: string]: VirtualCurrency;
|
|
1486
|
+
};
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
/**
|
|
1490
|
+
* The VirtualCurrency object represents information about a virtual currency in the app.
|
|
1491
|
+
* Use this object to access information about a virtual currency, such as its current balance.
|
|
1492
|
+
*
|
|
1493
|
+
* @public
|
|
1494
|
+
*/
|
|
1495
|
+
export declare interface VirtualCurrency {
|
|
1496
|
+
/**
|
|
1497
|
+
* The virtual currency's balance.
|
|
1498
|
+
*/
|
|
1499
|
+
readonly balance: number;
|
|
1500
|
+
/**
|
|
1501
|
+
* The virtual currency's name.
|
|
1502
|
+
*/
|
|
1503
|
+
readonly name: string;
|
|
1504
|
+
/**
|
|
1505
|
+
* The virtual currency's code.
|
|
1506
|
+
*/
|
|
1507
|
+
readonly code: string;
|
|
1508
|
+
/**
|
|
1509
|
+
* The virtual currency's description defined in the RevenueCat dashboard.
|
|
1510
|
+
*/
|
|
1511
|
+
readonly serverDescription: string | null;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1452
1514
|
export { }
|