/*! * @preserve * Add to Calendar Button * Public type declarations (generated from src - do not edit) * Creator: Jens Kuerschner (https://jekuer.com) * Project: https://github.com/add2cal/add-to-calendar-button * License: Elastic License 2.0 (ELv2) (https://github.com/add2cal/add-to-calendar-button/blob/main/LICENSE.txt) * Version: 3.6.0 * Note: DO NOT REMOVE THE COPYRIGHT NOTICE ABOVE! */ /** * Shared internal types for the add-to-calendar-button source. * * Two config shapes flow through the code: * - ATCBInputConfig: what users provide (attributes arrive as strings, flags may be * string-y booleans, options may be JSON strings). Aligned with the public * AddToCalendarButtonType in index.d.ts (asserted by the type compatibility test). * - ATCBConfig: the decorated shape produced by decorate_data (flags coerced to * real booleans, options normalized, dates array populated, internal fields added). * * Decorated fields stay optional on purpose: the decoration pipeline fills them at * runtime and consuming functions guard or assert presence where needed. Tightening * them to required fields would be a type-only change with a large diff surface - * a candidate for a later minor release, not something to mix into feature work. */ export type ATCBOptionName = "apple" | "google" | "ical" | "ms365" | "msteams" | "outlookcom" | "yahoo"; /** * Legacy v2 option spellings. Still fully supported as aliases: the runtime * normalizes any casing (plus the "Microsoft ..." / "Outlook.com" long forms) * to the official lowercase keys above. */ export type ATCBOptionNameLegacy = "Apple" | "Google" | "iCal" | "Microsoft365" | "MicrosoftTeams" | "Outlook.com" | "Yahoo"; export type ATCBEventStatus = "tentative" | "confirmed" | "cancelled"; /** * Legacy v2 status spelling. Still fully supported: status input is * case-insensitive and normalized to lowercase during decoration. */ export type ATCBEventStatusLegacy = Uppercase; /** * Button style options. List style options. Light mode options. Custom Labels. Normalized during decoration, but the input accepts any string (for forward compatibility with new styles). */ export type ATCBButtonStyle = "default" | "simple" | "3d" | "flat" | "round" | "neumorphism" | "text" | "date" | "custom" | "none"; export type ATCBListStyle = "dropdown" | "dropdown-static" | "dropup-static" | "overlay" | "modal"; export type ATCBLightMode = "system" | "dark" | "light" | "bodyScheme"; export type CustomLabelsObject = { [key: string]: string | null | undefined; }; export interface ATCBGroupOverviewConfig { "years-only"?: boolean; type?: "list" | "cards" | "compact"; from?: string; to?: string; "no-details"?: boolean; "no-add"?: boolean; "no-subscribe-button"?: boolean; "custom-domain"?: string; "add-via-list"?: boolean; } /** * One event date entry (multi-date configs carry several). * Post-decoration, entries also carry computed internals (e.g. overdue). */ export interface ATCBDateEntryInput { name?: string; description?: string; startDate?: string; startTime?: string; endDate?: string; endTime?: string; timeZone?: string; useUserTZ?: boolean; location?: string; status?: ATCBEventStatus | ATCBEventStatusLegacy | string; sequence?: number | string; uid?: string; organizer?: string; attendee?: string; icsReminder?: number | string; icsUrl?: string; icsCategories?: string[] | string; icsClass?: string; icsPriority?: number | string; icsGeo?: string; icsAttach?: string[] | string; icsCreated?: string; icsUpdated?: string; } /** * Decorated date entry: input fields plus computed internals and the dynamic-access * escape hatch the decoration pipeline relies on. The input variant stays CLOSED * (no index signature) so public closed interfaces like EventDate remain assignable. */ export interface ATCBDateEntry extends ATCBDateEntryInput { overdue?: boolean; timeZoneDisplay?: string; [key: string]: unknown; } /** * Raw input config (web component attributes or atcb_action argument). * Attribute values arrive as strings; boolean-ish fields accept both. */ export interface ATCBInputConfig { prokey?: string; groupOverview?: boolean | string; groupOverviewConfig?: ATCBGroupOverviewConfig | string; name?: string; dates?: ATCBDateEntryInput[] | string; description?: string; startDate?: string; startTime?: string; endDate?: string; endTime?: string; timeZone?: string; useUserTZ?: boolean | string; location?: string; status?: ATCBEventStatus | ATCBEventStatusLegacy | string; sequence?: number | string; uid?: string; organizer?: string; attendee?: string; icsFile?: string; images?: string[] | string; recurrence?: string; recurrence_interval?: number | string; recurrence_until?: string; recurrence_count?: number | string; recurrence_byDay?: string[] | string; recurrence_byMonth?: string[] | string | number[] | number; recurrence_byMonthDay?: string[] | string | number[] | number; recurrence_weekstart?: string; availability?: "busy" | "free" | string; icsCreated?: string; icsUpdated?: string; identifier?: string; subscribe?: boolean | string; options?: (ATCBOptionName | ATCBOptionNameLegacy)[] | string[] | string; optionsMobile?: (ATCBOptionName | ATCBOptionNameLegacy)[] | string[] | string; optionsIOS?: (ATCBOptionName | ATCBOptionNameLegacy)[] | string[] | string; iCalFileName?: string; listStyle?: ATCBListStyle | string; buttonStyle?: ATCBButtonStyle | string; trigger?: "hover" | "click" | string; inline?: boolean | string; inlineRsvp?: string; buttonsList?: boolean | string; hideIconButton?: boolean | string; hideIconList?: boolean | string; hideIconModal?: boolean | string; hideTextLabelButton?: boolean | string; hideTextLabelList?: boolean | string; hideBackground?: boolean | string; hideCheckmark?: boolean | string; hideBranding?: boolean | string; hideButton?: boolean | string; hideRichData?: boolean | string; size?: string; label?: string; customLabels?: CustomLabelsObject | string; customCss?: string; lightMode?: ATCBLightMode | string; language?: string; ty?: object | string; rsvp?: object | string; bypassWebViewCheck?: boolean | string; debug?: boolean | string; cspnonce?: string; blockInteraction?: boolean | string; styleLight?: string; styleDark?: string; styleSource?: string; loadAllStyles?: boolean | string; icsReminder?: number | string; icsUrl?: string; icsCategories?: string[] | string; icsClass?: string; icsPriority?: number | string; icsGeo?: string; icsAttach?: string[] | string; icsExdate?: string[] | string; disabled?: boolean | string; hidden?: boolean | string; pastDateHandling?: string; proxy?: boolean | string; fakeMobile?: boolean | string; fakeIOS?: boolean | string; fakeAndroid?: boolean | string; proOverride?: boolean | string; forceOverlay?: boolean | string; instance?: number | string; customVar?: CustomLabelsObject | string; domain?: string; dev?: boolean | string; } /** * Decorated config as produced by decorate_data and consumed by * validation, generation, links, and control code. */ export interface ATCBConfig { proKey?: string; public_event_overview?: boolean; groupOverview?: boolean; groupOverviewConfig?: ATCBGroupOverviewConfig; name?: string; dates?: ATCBDateEntry[]; description?: string; descriptionHtmlFree?: string; startDate?: string; startTime?: string; endDate?: string; endTime?: string; timeZone?: string; useUserTZ?: boolean; location?: string; onlineEvent?: boolean; status?: string; sequence?: number | string; uid?: string; organizer?: string; attendee?: string; icsFile?: string; images?: string[]; recurrence?: string; recurrence_interval?: number | string; recurrence_until?: string; recurrence_count?: number | string; recurrence_byDay?: string; recurrence_byMonth?: string; recurrence_byMonthDay?: string; recurrence_weekstart?: string; recurrence_frequency?: string; recurrence_simplified?: boolean; availability?: string; icsCreated?: string; icsUpdated?: string; identifier?: string; subscribe?: boolean; options?: string[]; optionsMobile?: string[]; optionsIOS?: string[]; iCalFileName?: string; listStyle?: ATCBListStyle | string; buttonStyle?: ATCBButtonStyle | string; trigger?: "hover" | "click" | string; inline?: boolean; inlineRsvp?: string; inlineRSVP?: boolean; buttonsList?: boolean; hideIconButton?: boolean; hideIconList?: boolean; hideIconModal?: boolean; hideTextLabelButton?: boolean; hideTextLabelList?: boolean; hideBackground?: boolean; hideCheckmark?: boolean; hideBranding?: boolean; hideButton?: boolean; hideRichData?: boolean; size?: string; sizes?: { [key: string]: number | string; }; label?: string; customLabels?: CustomLabelsObject; customCss?: string; lightMode?: string; language?: string; formatLocale?: string; translationLocale?: string; rtl?: boolean; ty?: { [key: string]: unknown; }; rsvp?: { [key: string]: unknown; }; bypassWebViewCheck?: boolean; debug?: boolean; cspnonce?: string; blockInteraction?: boolean; styleLight?: string; styleDark?: string; styleSource?: string; loadAllStyles?: boolean; icsExdate?: string[] | string; disabled?: boolean; hidden?: boolean; pastDateHandling?: string; proxy?: boolean; fakeMobile?: boolean; fakeIOS?: boolean; fakeAndroid?: boolean; proOverride?: boolean; forceOverlay?: boolean; instance?: number | string; customVar?: CustomLabelsObject; dev?: boolean; landingpage?: { [key: string]: unknown; }; domain?: string; allOverdue?: boolean; allCancelled?: boolean; js?: boolean; [key: string]: unknown; } /** * Translation map shape: language code -> key -> string. */ export type I18nStrings = { [language: string]: { [key: string]: string; }; }; export type ATCBLanguage = "en" | "de" | "nl" | "fa" | "fr" | "es" | "et" | "pt" | "pt_BR" | "tr" | "zh" | "zh_hant" | "ar" | "hi" | "pl" | "ro" | "id" | "no" | "nb" | "nn" | "fi" | "sv" | "cs" | "ja" | "it" | "ko" | "vi" | "hu" | "he" | "uk" | "az" | "be" | "bg" | "bs" | "da" | "el" | "hr" | "hy" | "ka" | "lt" | "lv" | "mk" | "mt" | "ru" | "sk" | "sl" | "sq" | "sr" | "sr_latin"; export type CustomLabelsObjectType = { [key: string]: string | null; }; export type GroupOverviewConfig = ATCBGroupOverviewConfig; export interface EventDate { name?: string; description?: string; startDate?: string; startTime?: string; endDate?: string; endTime?: string; timeZone?: string; useUserTZ?: boolean; location?: string; status?: ATCBEventStatus | ATCBEventStatusLegacy; sequence?: number; uid?: string; organizer?: string; attendee?: string; icsReminder?: number | string; icsUrl?: string; icsCategories?: string[] | string; icsClass?: "public" | "private" | "confidential"; icsPriority?: number; icsGeo?: string; icsAttach?: string[] | string; } export interface ATCBActionEventConfig { prokey?: string; name?: string; dates?: EventDate[]; description?: string; startDate?: string; startTime?: string; endDate?: string; endTime?: string; timeZone?: string; useUserTZ?: boolean; location?: string; status?: ATCBEventStatus | ATCBEventStatusLegacy; sequence?: number; uid?: string; organizer?: string; attendee?: string; icsFile?: string; recurrence?: string; recurrence_interval?: number; recurrence_until?: string; recurrence_count?: number; recurrence_byDay?: string[] | string; recurrence_byMonth?: string[] | string | number[] | number; recurrence_byMonthDay?: string[] | string | number[] | number; recurrence_weekstart?: string; availability?: "busy" | "free"; icsCreated?: string; icsUpdated?: string; subscribe?: boolean; options?: (ATCBOptionName | ATCBOptionNameLegacy)[]; optionsMobile?: (ATCBOptionName | ATCBOptionNameLegacy)[]; optionsIOS?: (ATCBOptionName | ATCBOptionNameLegacy)[]; iCalFileName?: string; listStyle?: "overlay" | "modal"; buttonStyle?: ATCBButtonStyle; hideIconList?: boolean; hideIconModal?: boolean; hideTextLabelList?: boolean; hideBackground?: boolean; hideButton?: boolean; hideCheckmark?: boolean; hideBranding?: boolean; size?: string; customLabels?: CustomLabelsObjectType; customCss?: string; lightMode?: ATCBLightMode; language?: ATCBLanguage; hideRichData?: boolean; ty?: object; bypassWebViewCheck?: boolean; debug?: boolean; cspnonce?: string; styleLight?: string; styleDark?: string; styleSource?: string; loadAllStyles?: boolean; icsReminder?: number | string; icsUrl?: string; icsCategories?: string[] | string; icsClass?: "public" | "private" | "confidential"; icsPriority?: number; icsGeo?: string; icsAttach?: string[] | string; icsExdate?: string[] | string; proxy?: boolean; fakeMobile?: boolean; fakeIOS?: boolean; fakeAndroid?: boolean; proOverride?: boolean; forceOverlay?: boolean; customVar?: CustomLabelsObjectType; dev?: boolean; } export type AddToCalendarButtonType = { prokey?: string; groupOverview?: boolean | string; groupOverviewConfig?: GroupOverviewConfig | string; name?: string; dates?: EventDate[] | string; description?: string; startDate?: string; startTime?: string; endDate?: string; endTime?: string; timeZone?: string; useUserTZ?: boolean; location?: string; status?: ATCBEventStatus | ATCBEventStatusLegacy; sequence?: number | string; uid?: string; organizer?: string; attendee?: string; icsFile?: string; images?: string[] | string; recurrence?: string; recurrence_interval?: number | string; recurrence_until?: string; recurrence_count?: number | string; recurrence_byDay?: string[] | string; recurrence_byMonth?: string[] | string | number[] | number; recurrence_byMonthDay?: string[] | string | number[] | number; recurrence_weekstart?: string; availability?: "busy" | "free"; icsCreated?: string; icsUpdated?: string; identifier?: string; subscribe?: boolean | string; options?: (ATCBOptionName | ATCBOptionNameLegacy)[] | string; optionsMobile?: (ATCBOptionName | ATCBOptionNameLegacy)[] | string; optionsIOS?: (ATCBOptionName | ATCBOptionNameLegacy)[] | string; iCalFileName?: string; listStyle?: ATCBListStyle; buttonStyle?: ATCBButtonStyle; trigger?: "hover" | "click"; inline?: boolean | string; buttonsList?: boolean | string; hideIconButton?: boolean | string; hideIconList?: boolean | string; hideIconModal?: boolean | string; hideTextLabelButton?: boolean | string; hideTextLabelList?: boolean | string; hideBackground?: boolean | string; hideCheckmark?: boolean | string; hideBranding?: boolean | string; hideButton?: boolean | string; size?: string; label?: string; inlineRsvp?: string; customLabels?: CustomLabelsObjectType | string; customCss?: string; lightMode?: ATCBLightMode; language?: ATCBLanguage; hideRichData?: boolean | string; ty?: object | string; rsvp?: object | string; bypassWebViewCheck?: boolean | string; debug?: boolean | string; cspnonce?: string; blockInteraction?: boolean | string; styleLight?: string; styleDark?: string; styleSource?: string; loadAllStyles?: boolean | string; icsReminder?: number | string; icsUrl?: string; icsCategories?: string[] | string; icsClass?: "public" | "private" | "confidential"; icsPriority?: number | string; icsGeo?: string; icsAttach?: string[] | string; icsExdate?: string[] | string; disabled?: boolean | string; hidden?: boolean | string; pastDateHandling?: string; proxy?: boolean | string; fakeMobile?: boolean | string; fakeIOS?: boolean | string; fakeAndroid?: boolean | string; proOverride?: boolean; forceOverlay?: boolean | string; instance?: number | string; customVar?: CustomLabelsObjectType | string; dev?: boolean | string; }; declare global { interface Window { dataLayer?: { [key: string]: unknown; }[]; atcb_action?: (data: ATCBInputConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean) => Promise; } interface HTMLElementTagNameMap { "add-to-calendar-button": HTMLElement & AddToCalendarButtonType; } namespace JSX { interface IntrinsicElements { ["add-to-calendar-button"]: AddToCalendarButtonType; } } } export declare function atcb_action(inputData: ATCBInputConfig, triggerElement?: HTMLElement, keyboardTrigger?: boolean): Promise; export declare const i18nStrings: I18nStrings; /** * Translation packs are authored as nested objects for easy editing * ("label": { "addtocalendar": ... }); the runtime registry works with flat * dotted identifiers ("label.addtocalendar"), so packs get flattened on * registration. Flat packs pass through unchanged, and dotted keys inside a * level join naturally, so mixed structures register correctly too. */ export type NestedTranslations = { [key: string]: string | NestedTranslations; }; /** * Registers a translation pack under a language code (base like "de" or regional * like "en_GB"). Accepts nested or flat packs. Public API used by the generated * locale modules and custom setups. */ declare function register_locale(language: string, strings: NestedTranslations | { [key: string]: string; }): void; declare const atcbCssTemplate: { [key: string]: string; }; /** * Registers a style delta (css text) under a style name. Public API used by the * generated style modules (dist/styles/{name}.js) and available for custom setups. */ declare function register_style(name: string, css: string): void; declare function generate_ty(hostEl: ShadowRoot | HTMLElement, dataObj: ATCBConfig): Promise; declare function generate_timestring(dates: ATCBDateEntryInput[], language?: string, subEvent?: "all" | number, decorate?: boolean, browserTimeOverride?: boolean, enforceYear?: boolean, hideTimeZone?: boolean): string[]; declare function decorate_data_dates(data: ATCBConfig | ATCBInputConfig): ATCBConfig; export { atcbCssTemplate as cssStyles, decorate_data_dates as atcb_decorate_data_dates, generate_timestring as atcb_generate_timestring, generate_ty as atcb_generate_ty, register_locale as atcb_register_locale, register_style as atcb_register_style, }; export {};