@revenuecat/purchases-ui-js
Version:
Web components for Paywalls. Powered by RevenueCat
31 lines (30 loc) • 949 B
TypeScript
import type { BaseComponent } from "../base";
import type { StackProps } from "./stack";
type PurchaseButtonOpenMethod = "deep_link" | "external_browser" | "in_app_browser";
export type PurchaseButtonAction = "in_app_checkout" | "web_checkout" | "web_product_selection";
type PurchaseButtonWebMethod = {
auto_dismiss?: boolean;
open_method?: PurchaseButtonOpenMethod;
};
export type PurchaseButtonMethod = {
type: "in_app_checkout";
} | ({
type: "web_checkout";
} & PurchaseButtonWebMethod) | ({
type: "web_product_selection";
} & PurchaseButtonWebMethod) | ({
type: "custom_web_checkout";
custom_url: {
url_lid: string;
package_param?: string;
};
} & PurchaseButtonWebMethod) | {
type: "unknown";
};
export interface PurchaseButtonProps extends BaseComponent {
type: "purchase_button";
stack: StackProps;
action?: PurchaseButtonAction;
method?: PurchaseButtonMethod;
}
export {};