import * as _walkeros_core_dev from '@walkeros/core/dev'; import { z } from '@walkeros/core/dev'; import { Mapping as Mapping$1, Flow, WalkerOS } from '@walkeros/core'; import { DestinationWeb } from '@walkeros/web-core'; declare const SettingsSchema: z.ZodObject<{ appId: z.ZodString; disableTextCapture: z.ZodOptional; disablePageviewAutocapture: z.ZodOptional; disableSessionReplay: z.ZodOptional; secureCookie: z.ZodOptional; ingestServer: z.ZodOptional; identify: z.ZodOptional; userProperties: z.ZodOptional; }, z.core.$strip>; type Settings$1 = z.infer; declare const MappingSchema: z.ZodObject<{ identify: z.ZodOptional; reset: z.ZodOptional; userProperties: z.ZodOptional; eventProperties: z.ZodOptional; clearEventProperties: z.ZodOptional; }, z.core.$strip>; type Mapping = z.infer; declare const settings: _walkeros_core_dev.JSONSchema; declare const mapping: _walkeros_core_dev.JSONSchema; type index$1_Mapping = Mapping; declare const index$1_MappingSchema: typeof MappingSchema; declare const index$1_SettingsSchema: typeof SettingsSchema; declare const index$1_mapping: typeof mapping; declare const index$1_settings: typeof settings; declare namespace index$1 { export { type index$1_Mapping as Mapping, index$1_MappingSchema as MappingSchema, type Settings$1 as Settings, index$1_SettingsSchema as SettingsSchema, index$1_mapping as mapping, index$1_settings as settings }; } /** 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; } /** * 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; } } /** * Pre-init env — window.heap is a no-op queue until init wires it. */ declare const init: Env | undefined; /** * Post-init env — window.heap methods are spy-able no-ops. * Tests clone this and replace individual methods with jest.fn() for assertions. */ declare const push: Env; /** Simulation tracking paths for CLI --simulate. */ declare const simulation: string[]; declare const env_init: typeof init; declare const env_push: typeof push; declare const env_simulation: typeof simulation; declare namespace env { export { env_init as init, env_push as push, env_simulation as simulation }; } /** * Examples may optionally carry destination-level settings overrides. * The test runner reads `settings` from the example and merges it on top * of the fixed appId when registering the destination. */ type HeapStepExample = Flow.StepExample & { settings?: Partial; /** Consent granted before `in` so a gated destination is loaded first. */ before?: WalkerOS.Consent; }; /** * Default event forwarding - every walkerOS event becomes * heap.track(event.name, properties). With no mapping, properties is `{}`. */ declare const defaultEventForwarding: HeapStepExample; /** * Rename + map event properties via rule.data.map. * data resolves to { order_id, total, currency } → heap.track('purchase', props). */ declare const destinationLevelInclude: HeapStepExample; /** * Destination-level settings.identify - heap.identify() resolves user.id, * then the default heap.track() call fires. */ declare const destinationLevelIdentify: HeapStepExample; /** * Per-event login identify - heap.identify() from data.email + user * properties from the same rule. silent: true suppresses the track() call. */ declare const userLoginIdentify: HeapStepExample; /** * User logout - heap.resetIdentity(). silent: true suppresses the track() call. */ declare const userLogoutReset: HeapStepExample; /** * Event with user properties from mapping - heap.addUserProperties() fires, * then the default heap.track() call. */ declare const eventWithUserProperties: HeapStepExample; /** * Global event properties - heap.addEventProperties() sets persistent * properties on all subsequent events. silent: true on this rule. */ declare const globalEventProperties: HeapStepExample; /** * Consent granted then revoked: the destination loads under the grant * (heap.startTracking), and the later revoke calls heap.stopTracking via the * on('consent') handler. A gated destination never loads under denial, so the * stop is a real revocation of an already-granted destination. */ declare const consentRevokeStopTracking: HeapStepExample; /** * Consent granted - on('consent') handler calls heap.startTracking() * when all required consent keys are true. */ declare const consentGrantStartTracking: HeapStepExample; type step_HeapStepExample = HeapStepExample; declare const step_consentGrantStartTracking: typeof consentGrantStartTracking; declare const step_consentRevokeStopTracking: typeof consentRevokeStopTracking; declare const step_defaultEventForwarding: typeof defaultEventForwarding; declare const step_destinationLevelIdentify: typeof destinationLevelIdentify; declare const step_destinationLevelInclude: typeof destinationLevelInclude; declare const step_eventWithUserProperties: typeof eventWithUserProperties; declare const step_globalEventProperties: typeof globalEventProperties; declare const step_userLoginIdentify: typeof userLoginIdentify; declare const step_userLogoutReset: typeof userLogoutReset; declare namespace step { export { type step_HeapStepExample as HeapStepExample, step_consentGrantStartTracking as consentGrantStartTracking, step_consentRevokeStopTracking as consentRevokeStopTracking, step_defaultEventForwarding as defaultEventForwarding, step_destinationLevelIdentify as destinationLevelIdentify, step_destinationLevelInclude as destinationLevelInclude, step_eventWithUserProperties as eventWithUserProperties, step_globalEventProperties as globalEventProperties, step_userLoginIdentify as userLoginIdentify, step_userLogoutReset as userLogoutReset }; } declare const index_env: typeof env; declare const index_step: typeof step; declare namespace index { export { index_env as env, index_step as step }; } export { index as examples, index$1 as schemas };