UNPKG

@beamimpact/web-sdk

Version:

The Beam SDK enables brands to connect with their customers over shared values, not transactional discounts, to build stronger loyalty. Our integration achieves this by allowing customers to (a) choose a nonprofit where the brand will donate part of their

201 lines (197 loc) 7.3 kB
import * as lit from 'lit'; import { LitElement, PropertyValues } from 'lit'; import * as lit_html from 'lit-html'; import * as lodash from 'lodash'; import { c as TUrl, T as TNumericId, a as TId } from '../chunks/types-CPxMwnoR.esm.js'; import { L as LANGUAGES } from '../chunks/types-DfRc36jU.esm.js'; import '../chunks/progress-bar-CveZ8E6Q.esm.js'; import '../chunks/share-button-CDVVaxEc.esm.js'; declare class BeamInfoPill extends LitElement { infoText: string; static get styles(): lit.CSSResult; render(): lit_html.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { "beam-info-pill": BeamInfoPill; } } type RequiredConfig = { apiKey: string; nonprofitId: TNumericId; beamUserId: TId; }; declare class BeamSubscriptionImpact extends LitElement { static tagName: string; baseUrl: TUrl; apiKey?: RequiredConfig["apiKey"]; storeId?: number; nonprofitId?: RequiredConfig["nonprofitId"]; beamUserId?: RequiredConfig["beamUserId"]; lang: LANGUAGES; debug: boolean; draftConfig: boolean; private isMobile; get configLang(): LANGUAGES; getImpactData: () => Promise<{ chain: { name: string; logoUrl: string | null; logoLockupUrl?: string | null | undefined; communityImpactUrl: string | null; donationTypeName: string | null; matchDonationTypeName: string | null; }; store: { name: string | null; displayName: string | null; communityPageURL: string | null; }; config: { web: { title: string; description: string; promoDescriptionPrefix?: string | undefined; promoDescription?: string | undefined; confirmButton?: string | undefined; confirmedButton?: string | undefined; collapsedButton?: string | undefined; theme?: { [key: string]: unknown; } | null | undefined; nonprofitSelectedHeader?: string | undefined; nonprofitUnselectedHeader?: string | undefined; dynamicStrings?: { [key: string]: string; } | null | undefined; additionalStrings?: { [key: string]: string; } | null | undefined; disableAnimation?: boolean | undefined; promo?: { "promo-text-long": string; "promo-text-short": string; "promo-cause-alt-text": string; } | undefined; }; mobileWeb?: { title: string; description: string; nonprofitSelectedHeader?: string | undefined; nonprofitUnselectedHeader?: string | undefined; } | undefined; mobile: { title: string; description: string; nonprofitSelectedHeader?: string | undefined; nonprofitUnselectedHeader?: string | undefined; }; enableNonprofitDeselection?: boolean | undefined; }; personal: { imageUrl: string | null; nonprofit: { id: number; name: string; cause: string | null; causeIconUrl: string | null; causeIconSelectedUrl: string | null; causeColor: string | null; extensibility?: { causeIconUrl?: string | null | undefined; causeIconSelectedUrl?: string | null | undefined; causeIconAndBackgroundUrl?: string | null | undefined; } | undefined; website: string | null; websiteLinkText: string; badge?: string | undefined; includeInPersonalImpact?: boolean | undefined; }; impact: { description: string | null; goalCompletionText: string; goalProgressText: string; goalProgressPercentage: number; }; share: { imageUrl: string | null; }; filters?: string[] | undefined; }[]; community: { imageUrl: string | null; nonprofit: { id: number; name: string; cause: string | null; causeIconUrl: string | null; causeIconSelectedUrl: string | null; causeColor: string | null; extensibility?: { causeIconUrl?: string | null | undefined; causeIconSelectedUrl?: string | null | undefined; causeIconAndBackgroundUrl?: string | null | undefined; } | undefined; website: string | null; websiteLinkText: string; badge?: string | undefined; includeInPersonalImpact?: boolean | undefined; }; impact: { description: string | null; goalCompletionText: string; goalProgressText: string; goalProgressPercentage: number; }; share: { imageUrl: string | null; }; filters?: string[] | undefined; }[]; promo: { type?: string | undefined; isActive: boolean; multiplier: number | null; } | null; promoAssetUrl: string | null; personalImpactAssetUrl: string | null; settings?: { excludeDonationsForRecurringTransactions: boolean; } | undefined; }>; private impactDataController; impactTitleRefs: HTMLElement[]; impactLinkRefs: HTMLElement[]; connectedCallback(): void; updated(changedProperties: PropertyValues): Promise<void>; disconnectedCallback(): void; /** * Safari does not fire loading events on the document FontFaceSet, but it does implement the .ready Promise * Call this method to wait for font loads that may be triggered by content changes */ handleFontLoad<T = any>(callback: () => T | void): Promise<void | T>; get cssVariables(): any; evaluateBreakPoints: lodash.DebouncedFuncLeading<() => void>; resizeElements: lodash.DebouncedFuncLeading<() => void>; render(): "" | lit_html.TemplateResult<1>; renderInlineCard(impactCard: { title: string; description: string; image: string | null; link: string | null; linkText: string; progressBarValue?: number; progressBarText?: string; infoPill: string; imageType: "'image'" | "'icon'" | "'selected_icon'"; cardType: "personal" | "community"; imagePosition: "'inline'" | "'block'"; }): lit_html.TemplateResult<1>; static styles: lit.CSSResult[]; } declare global { interface HTMLElementTagNameMap { "beam-subscription-impact": BeamSubscriptionImpact; } } export { BeamSubscriptionImpact };