import { KMCRootObject } from "@klevu/core"; import { EventEmitter } from "../../stencil-public-runtime"; import { KlevuUIGlobalSettings } from "../../utils/utils"; import en from "../../translations/en.json"; /** * List of available translations */ export type Translations = "en" | "fi"; /** * Translation typing to auto complete */ export type Translation = typeof en; /** * * `klevu-init` is the most important component of the whole library. Place one in your document. It should be * one of the first ones in the `
` tag. Currently only one `klevu-init` per page is supported. It is used to define * configuration for all components on the page and provide few global settings for all components: * * - **onItemClick:** what happens when product is clicked. Typically this places default action of * _klevu-product_ click. For example you can make your own frontend router to act in this function. Is * provided with product and click event as attributes. Remember to preventDefault and return false to prevent anchor * link following. * - **generateProductUrl:** what kind of URL's should be generated for products. If _onItemClick_ * is not used this can be used for it. Has product as attribute. * - **renderPrice:** generic function for price rendering. If you wish to have your own formatting for price * rendering then this is the place. Has two attribute amount and currency of item. * Initializes components to fetch data from correct Klevu backend * * * **Note: All global CSS variables are documented in `klevu-init` even thought they are not defined in it.** * */ export declare class KlevuInit { #private; /** * Read only API key to Klevu */ apiKey: string; /** * Klevu Server URL */ url: string; /** * Override the default events v1 URL */ eventsV1Url?: string; /** * Override the default events v2 URL */ eventsV2Url?: string; /** * Override the default recommendations API URL */ recommendationsApiUrl?: string; /** * Override the default session API URL */ visitorServiceUrl?: string; /** * Ipv6 ServiceUrl for ipv6 retrieval used in analytics */ ipv6ServiceUrl?: string; /** * Ipv4 ServiceUrl for ipv4 retrieval used in analytics */ ipv4ServiceUrl?: string; /** * Override the default moi API URL */ moiApiUrl?: string; /** * Global settings */ settings: KlevuUIGlobalSettings; /** * Which language to load */ language: Translations; /** * Provide your own translations */ translation?: Translation; /** * Enable Klaviyo integration */ enableKlaviyoConnector?: boolean; /** * Enable Data Protection */ useConsent?: boolean; /** * Data read consent given */ consentGiven?: boolean; /** * Override the default assets path. Will use format of `${assetsPath}/assets/${resource}` */ assetsPath?: string; settingsUrl?: string; /** * Override the default translation URL prefix. Will use format of * `${translationUrlPrefix}/translations/${lang}.json` */ translationUrlPrefix?: string; kmcLoadDefaults?: boolean; /** * disableUserSession and stop making calls to visitor service when this is true, defaults to false. */ disableUserSession?: boolean; klevuInitSettingsUpdated: EventEmitter