import { ApolloClient } from '@apollo/client/core'; import { DocumentNode } from 'graphql/language/ast'; import { Dropin } from 'braintree-web-drop-in'; import { default as KvPaymentSelect } from './components/KvPaymentSelect.js'; import { MutationOptions } from '@apollo/client/core'; import { ObservableQuery } from '@apollo/client/core'; import { PaymentMethodPayload } from 'braintree-web-drop-in'; import { QueryOptions } from '@apollo/client/core'; import { Ref } from 'vue'; import { TransactionData } from '@kiva/kv-analytics'; import { WatchQueryOptions } from '@apollo/client/core'; export declare function addCustomGivingFund({ apollo, savedSearchId, name, userId, organizationId, }: AddCustomGivingFundOptions): Promise; export declare interface AddCustomGivingFundData { addCustomGivingFund: { id: string; } | null; } export declare const addCustomGivingFundMutation: DocumentNode; export declare interface AddCustomGivingFundOptions { apollo: ApolloClient; savedSearchId: string; name?: string; userId?: string; organizationId?: string; } export declare function addGivingFund({ apollo, fundTarget, userId, organizationId, }: AddGivingFundOptions): Promise; export declare interface AddGivingFundData { addGivingFund: { id: string; } | null; } export declare const addGivingFundMutation: DocumentNode; export declare interface AddGivingFundOptions { apollo: ApolloClient; userId?: string; organizationId?: string; fundTarget: string; } export declare function addKivaCardToBasket({ kivaCard, apollo }: AddKivaCardToBasketOptions): Promise; export declare interface AddKivaCardToBasketData { shop: { id: string; addKivaCardToBasket: boolean | null; } | null; } export declare interface AddKivaCardToBasketOptions { kivaCard: KivaCardInput; apollo: ApolloClient; } export declare function applyKivaCredit(apollo: ApolloClient): Promise; export declare interface ApplyKivaCreditData { shop: { id: string; addCreditByType: boolean; } | null; } export declare function applyPromoCredit(apollo: ApolloClient, options: MutationOptions): Promise; export declare interface ApplyPromoCreditData { shop: { id: string; addCreditByType: boolean; } | null; } export declare interface BasketTotalsData { shop: { id: string; basket: { id: string; totals: { bonusAppliedTotal: string; bonusAvailableTotal: string; creditAmountNeeded: string; creditAppliedTotal: string; creditAvailableTotal: string; donationTotal: string; itemTotal: string; freeTrialAppliedTotal: string; freeTrialAvailableTotal: string; loanReservationTotal: string; kivaCardTotal: string; kivaCreditAppliedTotal: string; kivaCreditAvailableTotal: string; kivaCreditRemaining: string; kivaCreditToReapply: string; redemptionCodeAppliedTotal: string; redemptionCodeAvailableTotal: string; universalCodeAppliedTotal: string; universalCodeAvailableTotal: string; } | null; } | null; } | null; } export declare const basketTotalsQuery: DocumentNode; export declare function callShopMutation(apollo: ApolloClient, options: MutationOptions, maxretries?: number): Promise; export declare function callShopQuery(apollo: ApolloClient, options: QueryOptions, maxretries?: number): Promise; export declare interface CheckoutStatusQueryResult { data: { checkoutStatus: any; } | null; errors?: any; } export declare function checkSubscriptionStatus(apollo: any): Promise; export declare function createBasket(apollo: ApolloClient): Promise; export declare const defaultPaymentTypes: readonly ["paypal", "card", "applePay", "googlePay"]; export declare interface DropInInitOptions { amount: string | number; authToken: string; container: string | HTMLElement; googlePayMerchantId: string; paymentTypes?: PaymentType[]; preselectVaultedPaymentMethod?: boolean; paypalFlow?: PayPalFlowType; } export declare interface DropInWrapper { initDropIn: (options: DropInInitOptions) => Promise; paymentMethodRequestable: Ref; requestPaymentMethod: () => Promise; updateAmount: (amount: string | number) => void; } export declare function executeNewSubscriptionCheckout({ amount, apollo, dayOfMonth, donateAmount, paymentMethod, }: SubscriptionCheckoutOptions): Promise; export declare function executeOneTimeCheckout({ apollo, braintree, emailAddress, emailOptIn, valetInviter, deactivateRedirect, }: OneTimeCheckoutOptions): Promise; export declare function executeOneTimeCheckoutForGivingFund({ amount, apollo, braintree, emailAddress, emailOptIn, fundTarget, savedSearchId, name, userId, useKivaCredit, }: OneTimeCheckoutForGivingFundOptions): Promise; export declare function getBasketID(): string; export declare function getCheckoutStatus({ apollo, transactionSagaId }: GetCheckoutStatusOptions): Promise; export declare interface GetCheckoutStatusOptions { apollo: ApolloClient; transactionSagaId: string; } export declare function getCheckoutTrackingData(apollo: ApolloClient, checkoutId: string, paymentType: string): Promise; export declare function getClientToken(apollo: any): Promise; export declare function getFTDStatus(apollo: ApolloClient): Promise; export declare function getPromoFromBasket(apollo: ApolloClient, options: QueryOptions): Promise; export declare function getReceiptItems(apollo: ApolloClient, checkoutId: number): Promise; export declare function getReceiptTotals(apollo: ApolloClient, checkoutId: number): Promise; export declare function hasBasketExpired(error: any): boolean; export declare function isBasketVerified(state: VerificationState): boolean; export declare enum KivaCardDeliveryTypeEnum { Email = "email", Lender = "lender", Postal = "postal", Print = "print" } export declare interface KivaCardInput { deliveryType: KivaCardDeliveryTypeEnum; giftAmount: string | number; message?: string | null; recipient: KivaCardRecipientInput; senderEmail?: string | null; senderName?: string | null; giftsPerRecipient?: number | null; } export declare interface KivaCardRecipientInput { email?: string; name?: string; address?: string; city?: string; state?: string; postalCode?: string; country?: string; lenderId?: string | number; scheduledDeliveryDate?: string; } export { KvPaymentSelect } export declare interface OneTimeCheckoutForGivingFundOptions { amount: string; apollo: ApolloClient; braintree?: DropInWrapper; emailAddress?: string; emailOptIn?: boolean; fundTarget?: string; savedSearchId?: string; name?: string; userId?: string; useKivaCredit?: boolean; } export declare interface OneTimeCheckoutForGivingFundResult { data: { checkoutStatus: any; donation: any; givingFund: { id: string; }; } | null; errors?: any; } export declare interface OneTimeCheckoutOptions { apollo: ApolloClient; braintree?: DropInWrapper; emailAddress?: string; emailOptIn?: boolean; valetInviter?: ValetInviter; deactivateRedirect?: boolean; } export declare function parseShopError(error: any): ShopError; export declare type PaymentType = 'card' | 'paypal' | 'paypalCredit' | 'venmo' | 'applePay' | 'googlePay'; export declare type PayPalFlowType = 'checkout' | 'vault'; export declare interface PollForCheckoutStatusOptions extends GetCheckoutStatusOptions { interval?: number; timeout?: number; } export declare function pollForFinishedCheckout({ apollo, transactionSagaId, interval, timeout, }: PollForCheckoutStatusOptions): Promise; declare interface ReceiptItem { id: string; price: string; __typename: string; isTip?: boolean; isUserEdited?: boolean; } export declare function removeKivaCredit(apollo: ApolloClient): Promise; export declare interface RemoveKivaCreditData { shop: { id: string; removeCreditByType: boolean; } | null; } export declare function removePromoCredit(apollo: ApolloClient, options: MutationOptions): Promise; export declare interface RemovePromoCreditData { shop: { id: string; removeCreditByType: boolean; } | null; } export declare function setBasketID(basketId: any): void; export declare function setTipDonation({ amount, apollo, metadata }: SetTipDonationOptions): Promise<{ id: string; price: string; isTip: boolean; metadata: string | null; }>; export declare interface SetTipDonationData { shop: { id: string; updateDonation: { id: string; price: string; isTip: boolean; metadata: string | null; } | null; } | null; } export declare interface SetTipDonationOptions { amount: string | number; metadata?: string | null; apollo: ApolloClient; } export declare class ShopError extends Error { code: string; original?: object; errors?: Array; constructor({ code, original }: ShopErrorOptions, ...params: any[]); aggregateErrors(errors: Array): void; } export declare interface ShopErrorOptions { code: string; original?: object; } export declare interface ShopPromoCampaignData { shop?: { id: string; promoCampaign?: { promoFund?: { id: number; displayName: string; displayDescription: string; promoPrice: string; }; promoGroup?: { id: number; type: string; teamId: number; }; managedAccount?: { managementType: string; audience: string; allowDonations: string; sendKivaNewsletter: string; id: number; isEmployee: boolean; formId: string; pageId: string; loanSearchCriteria: { filters: { cityState: [string]; country: [string]; currencyLossPossible: boolean; dafEligible: boolean; distributionModel: any | string; excludeNonRated: boolean; expiringSoon: boolean; gender: any | string; hasResearchScore: boolean; isGroup: boolean; lenderFavorite: number; loanLimit: number; loanTags: [number]; isMatched: boolean; sector: [number]; status: any | string; theme: [string]; }; sortBy: any | string | null; } | any | null; } | any | null; } | any | null; } | null; } export declare interface ShopPromoCampaignError { shop?: any; error?: string | null; } export declare interface SubscriptionCheckoutOptions { amount: string; apollo: any; dayOfMonth?: number; donateAmount: string; paymentMethod: PaymentMethodPayload; } export declare interface TrackTransactionData { shop: { id: string; trackTransaction: boolean; } | null; } export declare function trackTransactionEvent({ apollo, transactionId, }: TrackTransactionOptions): Promise; export declare const trackTransactionMutation: DocumentNode; export declare interface TrackTransactionOptions { apollo: ApolloClient; transactionId: number; } export declare function useBraintreeDropIn(key?: string): DropInWrapper; export declare type ValetInviter = { inviterId: string; invitationUrl: string; }; export declare function validatePreCheckout({ apollo, emailAddress, emailOptIn, valetInviter, }: ValidatePreCheckoutOptions): Promise; export declare interface ValidatePreCheckoutData { shop: { id: string; validatePreCheckout: Array<{ error: string; success: boolean; value: string; }>; } | null; } export declare const validatePreCheckoutMutation: DocumentNode; export declare interface ValidatePreCheckoutOptions { apollo: ApolloClient; emailAddress?: string; emailOptIn?: boolean; valetInviter?: ValetInviter; } export declare enum VerificationState { VERIFIED = "verified", PENDING = "pending", REQUIRED = "required", MAY_BE_NEEDED = "may_be_needed", NOT_NEEDED = "not_needed" } export declare function watchBasketTotals(apollo: ApolloClient): ObservableQuery; export declare function watchShopQuery(apollo: ApolloClient, options: WatchQueryOptions, maxretries?: number): ObservableQuery; export { }