Skip to content

Commit

Permalink
Updated types
Browse files Browse the repository at this point in the history
  • Loading branch information
divanc committed Oct 20, 2023
1 parent 5a8abfa commit 46c398c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { AdaptyProfile, AdaptyError } from 'react-native-adapty';
import type {
AdaptyProfile,
AdaptyError,
AdaptyPaywallProduct,
} from 'react-native-adapty';

export type ArgType<T> = T extends () => any
? void
Expand Down Expand Up @@ -33,19 +37,19 @@ export interface EventHandlers {
*
* If you return `true` from this callback, the paywall view will be closed.
*/
onProductSelected: () => EventHandlerResult;
onProductSelected: (product: AdaptyPaywallProduct) => EventHandlerResult;
/**
* Called when a user taps the purchase button in the paywall view
*
* If you return `true` from this callback, the paywall view will be closed.
*/
onPurchaseStarted: () => EventHandlerResult;
onPurchaseStarted: (product: AdaptyPaywallProduct) => EventHandlerResult;
/**
* Called if a user cancels the purchase
*
* If you return `true` from this callback, the paywall view will be closed.
*/
onPurchaseCancelled: () => EventHandlerResult;
onPurchaseCancelled: (product: AdaptyPaywallProduct) => EventHandlerResult;
/**
* Called when a purchase is completed
*
Expand Down
1 change: 0 additions & 1 deletion src/view-emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export class ViewEmitter {
callback;

return $bridge.addEventListener(event, function (arg) {
console.log(`[UIEVENT]: ${event}; \n\targ: ${arg}; \n\t`);
const eventView = this.rawValue['view'] ?? null;
if (viewId !== eventView) {
return;
Expand Down

0 comments on commit 46c398c

Please sign in to comment.