/** * @public */ export declare interface AdminIframeSrcOptions extends IframeSrcDefaultOptions { token: string; type: AdminWidgetType; locale?: 'fr' | 'en'; campaignId?: string; accountId?: string; } /** * @public */ export declare type AdminWidgetOptions = AdminIframeSrcOptions & { container: HTMLElement; size?: 'fillContainer' | 'fitContent'; id?: string; }; /** * @public */ export declare type AdminWidgetType = 'fiscal-receipts' | 'campaign-metrics' | 'global-metrics' | 'charities-selection'; /** * @public */ export declare interface B2CPaymentIframeSrcOptions extends IframeSrcDefaultOptions { charityId: string; publicKey: string; locale?: 'fr' | 'en'; fullscreen?: boolean; hideSuccessScreen?: boolean; hideImpactIndicator?: boolean; } /** * @public */ export declare type B2CPaymentWidgetOptions = B2CPaymentIframeSrcOptions & { container: HTMLElement; size?: 'fillContainer' | 'fitContent'; onSuccess: (payload: { donationId: string; charityId: string; amount: number; }) => unknown; }; /** * @public */ export declare interface BillingIframeSrcOptions extends IframeSrcDefaultOptions { secret: string; } /** * @public */ export declare type BillingWidgetOptions = BillingIframeSrcOptions & { container: HTMLElement; size?: 'fillContainer' | 'fitContent'; onSuccess: () => void; }; /** * @public */ export declare function createAdminWidget({ container, size, id, // Needed to avoid creating duplicate modals ...options }: AdminWidgetOptions): HTMLIFrameElement & { destroy: () => void; }; /** * @public */ export declare function createB2CPaymentWidget({ container, onSuccess, size, ...options }: B2CPaymentWidgetOptions): HTMLIFrameElement & { destroy: () => void; }; /** * @public */ export declare function createBillingWidget({ container, onSuccess, size, ...options }: BillingWidgetOptions): HTMLIFrameElement & { destroy: () => void; }; /** * @public */ export declare function createCharityModalWidget({ onCharitySelected, disableSuccessModal, charity, ...options }: ModalWidgetOptions): HTMLIFrameElement & { open: (options: { charity: { slug: string; }; }) => void; close: () => void; destroy: () => void; } & { setAmount: (amount: number) => void; }; /** * @public */ export declare function createDonorPlatformWidget({ container, size, id, // Needed to avoid creating duplicate modals ...options }: DonorPlatformWidgetOptions): HTMLIFrameElement & { destroy: () => void; }; /** * @public */ export declare function createDonorWidget({ container, size, id, // Needed to avoid creating duplicate modals onSuccess, onAmountUpdate, ...options }: DonorWidgetOptions): HTMLIFrameElement & { destroy: () => void; }; /** * @public */ export declare function createWidget({ container, onDonationClaimed, onCharitySelected, onCharityPreselected, size, disableSuccessModal, onPaymentSuccess, onCloseSuccess, onAmountUpdate, id, ...options }: WidgetOptions): HTMLIFrameElement & { setAmount: (amount: number) => void; } & { destroy: () => void; }; /** * @public */ export declare type DonationType = 'ONE_TIME' | 'RECURRING'; /** * @public */ export declare interface DonorIframeSrcOptions extends IframeSrcDefaultOptions { token: string; type: DonorWidgetType; locale?: 'fr' | 'en'; charityId?: string; publicKey?: string; hideSuccessScreen?: boolean; hideImpactIndicator?: boolean; availableDonationTypes?: DonationType[]; initialAmount?: number; } /** * @public */ export declare interface DonorPlatformIframeSrcOptions extends IframeSrcDefaultOptions { token: string; type: DonorPlatformWidgetType; locale?: 'fr' | 'en'; } /** * @public */ export declare type DonorPlatformWidgetOptions = DonorPlatformIframeSrcOptions & { container: HTMLElement; size?: 'fillContainer' | 'fitContent'; id?: string; }; /** * @public */ export declare type DonorPlatformWidgetType = 'home' | 'payroll-donations' | 'pto-donations' | 'donations' | 'fiscal-receipts' | 'profile' | 'billing'; /** * @public */ export declare type DonorWidgetOptions = DonorIframeSrcOptions & { container: HTMLElement; size?: 'fillContainer' | 'fitContent'; id?: string; onSuccess?: (payload: { donationId: string; charityId: string; amount: number; }) => void; onAmountUpdate?: (amount: number) => void; }; /** * @public */ export declare type DonorWidgetType = 'payment' | 'charity-selection-and-payment'; /** * @public */ export declare interface IframeSrcDefaultOptions { baseUrl: string; } /** * @public */ export declare interface IframeSrcOptions extends IframeSrcDefaultOptions { publicKey: string; donationSecret?: string; voteSecret?: string; hideSearch?: boolean; withInstructions?: boolean; withDescription?: boolean; withDiscoverButton?: boolean; amount?: number; currencySymbol?: string; currencyValue?: number; balance?: number; type?: WidgetType; locale?: 'fr' | 'en'; charitySlug?: string; fullscreen?: boolean; withoutPagination?: boolean; termsOfServiceLink?: string; termsOfSalesLink?: string; privacyPolicyLink?: string; layout?: 'grid' | 'row'; preselectedCharityId?: string; token?: string; availableDonationTypes?: DonationType[]; } /** * @public */ export declare type ModalWidgetOptions = Omit & { charity?: { slug: string; }; fullscreen?: boolean; withoutPagination?: boolean; onClose?: () => void; }; /** * @public */ export declare type WidgetOptions = Omit & { container: HTMLElement; size?: 'fillContainer' | 'fitContent'; onCharitySelected?: (payload: { charityId: string; amount?: number; }) => Promise<{ donationId?: string; voteId?: string; recurrringDonationId?: string; }>; onDonationClaimed?: (payload: { charityId: string; }) => void; disableSuccessModal?: boolean; onPaymentSuccess?: (payload: { donationId: string; charityId: string; amount: number; }) => unknown; onCharityPreselected?: (payload: { charityId: string; name: string; logoUrl: string; }) => void; id?: string; onCloseSuccess?: () => void; onAmountUpdate?: (amount: number) => void; }; /** * @public */ export declare type WidgetType = 'presentation' | 'claim' | 'charity_selection' | 'charity_and_amount_selection' | 'donate' | 'charity_preselection'; export { }