/** * External dependencies */ import type { Brand } from 'ts-brand'; export type CommercialOpportunity = | { readonly type: 'none' } | { readonly type: UpgradeOpportunity; readonly action: Action }; export type SubscriptionPromoId = Brand< string, 'SubscriptionPromoId' >; export type SubscriptionPromo = { readonly id: SubscriptionPromoId; readonly coupon: string; readonly defaultPeriod: 'monthly' | 'yearly'; readonly topButtonLabel?: string; readonly banner: { readonly title: string; readonly message: string; readonly buttonLabel: string; }; }; // ============ // HELPER TYPES // ============ type UpgradeOpportunity = 'boost-expiring' | 'low-quota' | 'quota-exhausted'; type Action = 'subscribe' | 'purchase-quota-or-upgrade' | 'upgrade';