import { Destination as Destination$1, Mapping as Mapping$1 } from '@walkeros/core'; import { DestinationWeb } from '@walkeros/web-core'; /** Property value types accepted by Heap SDK methods. */ type HeapPropertyValue = string | number | boolean; /** Options accepted by heap.load() as the second argument. */ interface HeapConfig { disableTextCapture?: boolean; disablePageviewAutocapture?: boolean; disableSessionReplay?: boolean; secureCookie?: boolean; compressCookies?: boolean; clearEventPropertiesOnNewUser?: boolean; ingestServer?: string; trackingServer?: string; eventPropertiesStorageMedium?: string; metadataStorageMedium?: string; [key: string]: unknown; } /** * Heap SDK surface — the subset of window.heap methods this destination uses. * Mirrors the snippet-provided command queue so tests can mock each method. */ interface HeapSDK { load: (appId: string, config?: HeapConfig) => void; track: (event: string, properties?: Record) => void; identify: (identity: string) => void; resetIdentity: () => void; addUserProperties: (properties: Record) => void; addEventProperties: (properties: Record) => void; clearEventProperties: () => void; startTracking: () => void; stopTracking: () => void; appid?: string; config?: HeapConfig; q?: unknown[][]; } /** * Settings (destination-level). * * appId is required (Heap Project Settings → App ID). * identify/userProperties resolve every push to keep identity sticky. */ interface Settings { /** Heap App ID (required). Find it in Project > Settings > App ID. */ appId: string; /** Disable Heap auto text capture. Default: true. */ disableTextCapture?: boolean; /** Disable Heap automatic pageview tracking. Default: true (walkerOS handles pageviews). */ disablePageviewAutocapture?: boolean; /** Disable Heap session replay. */ disableSessionReplay?: boolean; /** SSL-only cookies. */ secureCookie?: boolean; /** Custom server endpoint (first-party proxy). */ ingestServer?: string; /** Destination-level identity mapping. Resolves to a string for heap.identify(). */ identify?: Mapping$1.Value; /** Destination-level user properties mapping. Resolves to object for heap.addUserProperties(). */ userProperties?: Mapping$1.Value; /** Additional heap.load() config passthrough. */ heapConfig?: HeapConfig; } type InitSettings = Partial; /** * Mapping (rule.settings) — per-event overrides. * * identify — resolves to string for heap.identify() * reset — truthy triggers heap.resetIdentity() * userProperties — resolves to object for heap.addUserProperties() * eventProperties — resolves to object for heap.addEventProperties() (persistent) * clearEventProperties — truthy triggers heap.clearEventProperties() */ interface Mapping { identify?: Mapping$1.Value; reset?: boolean | Mapping$1.Value; userProperties?: Mapping$1.Value; eventProperties?: Mapping$1.Value; clearEventProperties?: boolean | Mapping$1.Value; } /** * Env — optional override for the Heap SDK. Production leaves this * undefined and the destination creates the snippet's command queue on * window.heap. Tests provide a mock via env.window.heap = { ... }. */ interface Env extends DestinationWeb.Env { window: { heap: HeapSDK; }; } declare global { interface Window { heap?: HeapSDK; } } type Types = Destination$1.Types; type Destination = DestinationWeb.Destination; type Config = DestinationWeb.Config; type Rule = Mapping$1.Rule; type Rules = Mapping$1.Rules; type index_Config = Config; type index_Destination = Destination; type index_Env = Env; type index_HeapConfig = HeapConfig; type index_HeapPropertyValue = HeapPropertyValue; type index_HeapSDK = HeapSDK; type index_InitSettings = InitSettings; type index_Mapping = Mapping; type index_Rule = Rule; type index_Rules = Rules; type index_Settings = Settings; type index_Types = Types; declare namespace index { export type { index_Config as Config, index_Destination as Destination, index_Env as Env, index_HeapConfig as HeapConfig, index_HeapPropertyValue as HeapPropertyValue, index_HeapSDK as HeapSDK, index_InitSettings as InitSettings, index_Mapping as Mapping, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types }; } declare const destinationHeap: Destination; export { index as DestinationHeap, destinationHeap as default, destinationHeap };