@virex-tech/paywallo-sdk 2.2.6 → 2.3.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/index.d.mts CHANGED
@@ -166,6 +166,7 @@ interface PaywallConfig {
166
166
  content?: string | Record<string, unknown>;
167
167
  primaryProductId?: string;
168
168
  secondaryProductId?: string;
169
+ tertiaryProductId?: string;
169
170
  }
170
171
  interface PaywallBlockConfig {
171
172
  type: string;
@@ -314,6 +315,14 @@ interface PaywalloConfig {
314
315
  * or `DeviceInfo.getVersion()` (bare RN) here.
315
316
  */
316
317
  appVersion?: string;
318
+ /**
319
+ * Placements de paywall a serem pré-carregados (config + produtos) em
320
+ * background logo após o init. Quando `presentPaywall` é chamado com
321
+ * um placement preloadado, a apresentação pula o round-trip de
322
+ * `getPaywall` + `loadProducts` e fica quase instantânea.
323
+ * TTL: 5 minutos em memória, com stale-while-revalidate.
324
+ */
325
+ preloadPaywalls?: string[];
317
326
  }
318
327
  interface UserProperties {
319
328
  [key: string]: string | number | boolean | null;
@@ -1090,6 +1099,10 @@ interface PreloadCampaignResult {
1090
1099
  success: boolean;
1091
1100
  error?: Error;
1092
1101
  }
1102
+ interface PreloadPaywallResult {
1103
+ success: boolean;
1104
+ error?: Error;
1105
+ }
1093
1106
  interface PaywallErrorStrings {
1094
1107
  title?: string;
1095
1108
  retry?: string;
@@ -1133,6 +1146,9 @@ interface IPaywalloClient {
1133
1146
  gateContentWithCampaign<T>(content: () => T | Promise<T>, placement: string, context?: Record<string, unknown>): Promise<T | null>;
1134
1147
  preloadCampaign(placement: string, context?: Record<string, unknown>): Promise<PreloadCampaignResult>;
1135
1148
  getPreloadedCampaign(placement: string): CampaignResponse | null;
1149
+ preloadPaywall(placement: string): Promise<PreloadPaywallResult>;
1150
+ preloadPaywalls(placements: string[]): Promise<void>;
1151
+ isPaywallPreloaded(placement: string): boolean;
1136
1152
  reset(): Promise<void>;
1137
1153
  fullReset(): Promise<void>;
1138
1154
  requestPushPermission(options?: {
@@ -1586,6 +1602,7 @@ interface PaywallContextValue {
1586
1602
  selectedProductId: string | null;
1587
1603
  primaryProductId: string | null;
1588
1604
  secondaryProductId: string | null;
1605
+ tertiaryProductId: string | null;
1589
1606
  currentNavigationIndex: number;
1590
1607
  currentTabIndex: number;
1591
1608
  trialEnabled: boolean;
@@ -1634,6 +1651,7 @@ interface PaywallModalProps {
1634
1651
  config: Record<string, unknown>;
1635
1652
  primaryProductId?: string;
1636
1653
  secondaryProductId?: string;
1654
+ tertiaryProductId?: string;
1637
1655
  };
1638
1656
  preloadedProducts?: Map<string, Product>;
1639
1657
  variantKey?: string;
@@ -1844,6 +1862,7 @@ interface VariableContext {
1844
1862
  selectedProductId?: string;
1845
1863
  primaryProductId?: string;
1846
1864
  secondaryProductId?: string;
1865
+ tertiaryProductId?: string;
1847
1866
  products: Map<string, Product>;
1848
1867
  customVariables?: Record<string, string>;
1849
1868
  deviceInfo?: {
package/dist/index.d.ts CHANGED
@@ -166,6 +166,7 @@ interface PaywallConfig {
166
166
  content?: string | Record<string, unknown>;
167
167
  primaryProductId?: string;
168
168
  secondaryProductId?: string;
169
+ tertiaryProductId?: string;
169
170
  }
170
171
  interface PaywallBlockConfig {
171
172
  type: string;
@@ -314,6 +315,14 @@ interface PaywalloConfig {
314
315
  * or `DeviceInfo.getVersion()` (bare RN) here.
315
316
  */
316
317
  appVersion?: string;
318
+ /**
319
+ * Placements de paywall a serem pré-carregados (config + produtos) em
320
+ * background logo após o init. Quando `presentPaywall` é chamado com
321
+ * um placement preloadado, a apresentação pula o round-trip de
322
+ * `getPaywall` + `loadProducts` e fica quase instantânea.
323
+ * TTL: 5 minutos em memória, com stale-while-revalidate.
324
+ */
325
+ preloadPaywalls?: string[];
317
326
  }
318
327
  interface UserProperties {
319
328
  [key: string]: string | number | boolean | null;
@@ -1090,6 +1099,10 @@ interface PreloadCampaignResult {
1090
1099
  success: boolean;
1091
1100
  error?: Error;
1092
1101
  }
1102
+ interface PreloadPaywallResult {
1103
+ success: boolean;
1104
+ error?: Error;
1105
+ }
1093
1106
  interface PaywallErrorStrings {
1094
1107
  title?: string;
1095
1108
  retry?: string;
@@ -1133,6 +1146,9 @@ interface IPaywalloClient {
1133
1146
  gateContentWithCampaign<T>(content: () => T | Promise<T>, placement: string, context?: Record<string, unknown>): Promise<T | null>;
1134
1147
  preloadCampaign(placement: string, context?: Record<string, unknown>): Promise<PreloadCampaignResult>;
1135
1148
  getPreloadedCampaign(placement: string): CampaignResponse | null;
1149
+ preloadPaywall(placement: string): Promise<PreloadPaywallResult>;
1150
+ preloadPaywalls(placements: string[]): Promise<void>;
1151
+ isPaywallPreloaded(placement: string): boolean;
1136
1152
  reset(): Promise<void>;
1137
1153
  fullReset(): Promise<void>;
1138
1154
  requestPushPermission(options?: {
@@ -1586,6 +1602,7 @@ interface PaywallContextValue {
1586
1602
  selectedProductId: string | null;
1587
1603
  primaryProductId: string | null;
1588
1604
  secondaryProductId: string | null;
1605
+ tertiaryProductId: string | null;
1589
1606
  currentNavigationIndex: number;
1590
1607
  currentTabIndex: number;
1591
1608
  trialEnabled: boolean;
@@ -1634,6 +1651,7 @@ interface PaywallModalProps {
1634
1651
  config: Record<string, unknown>;
1635
1652
  primaryProductId?: string;
1636
1653
  secondaryProductId?: string;
1654
+ tertiaryProductId?: string;
1637
1655
  };
1638
1656
  preloadedProducts?: Map<string, Product>;
1639
1657
  variantKey?: string;
@@ -1844,6 +1862,7 @@ interface VariableContext {
1844
1862
  selectedProductId?: string;
1845
1863
  primaryProductId?: string;
1846
1864
  secondaryProductId?: string;
1865
+ tertiaryProductId?: string;
1847
1866
  products: Map<string, Product>;
1848
1867
  customVariables?: Record<string, string>;
1849
1868
  deviceInfo?: {