import { Destination as Destination$1, Mapping as Mapping$1 } from '@walkeros/core'; import { DestinationWeb } from '@walkeros/web-core'; /** * LinkedIn Insight Tag runtime surface. * * The Insight Tag script installs `window.lintrk` — a single function that * accepts exactly one tracked action: `lintrk('track', data)`. * * Before the script loads, the destination installs a queue-backed shim so * calls made during init are buffered and flushed once the script loads. * This mirrors the pattern LinkedIn's own snippet uses. */ type LintrkAction = 'track'; interface LintrkTrackData { conversion_id: number; conversion_value?: number; currency?: string; event_id?: string; } type Lintrk = ((action: LintrkAction, data: LintrkTrackData) => void) & { /** Internal queue populated before the CDN script loads. */ q?: unknown[]; }; declare global { interface Window { _linkedin_partner_id?: string; _linkedin_data_partner_ids?: string[]; lintrk?: Lintrk; } } /** * Destination-level settings. * * apiKey — the LinkedIn Partner ID (numeric string, e.g. "123456"), assigned * to `window._linkedin_partner_id` before the script loads. * include — event sections made available for mapping resolution. Present for * consistency with other destinations; has no effect at call time * because `lintrk()` only accepts four fixed fields. Kept so users * can reference section-prefixed keys in future custom mapping * strategies without a breaking change. */ interface Settings { apiKey: string; } type InitSettings = Partial; /** * Per-rule mapping settings. * * conversion — mapping value resolving to an object with short keys: * { id (required), value?, currency?, eventId? } * * `id` becomes `conversion_id` (number, Campaign Manager conversion rule ID). * Other keys translate 1:1 to the vendor parameter names. * * Events without a resolved `conversion.id` are silently ignored — LinkedIn * is an opt-in conversion model. */ interface Mapping { conversion?: Mapping$1.Value; } /** * Env — mock surface for tests and dev. The destination mutates * `window._linkedin_partner_id` / `window._linkedin_data_partner_ids` and * installs `window.lintrk` in init; tests can pre-seed `window.lintrk` with * a spy to skip the script injection path. * * `document` is also mocked so `addScript()` can run headlessly. */ interface Env extends DestinationWeb.Env { window: { _linkedin_partner_id?: string; _linkedin_data_partner_ids?: string[]; lintrk?: Lintrk; }; } type Types = Destination$1.Types; type Destination = DestinationWeb.Destination; type Config = DestinationWeb.Config; interface LinkedInDestination extends Destination { env?: Env; } type Rule = Mapping$1.Rule; type Rules = Mapping$1.Rules; type index_Config = Config; type index_Destination = Destination; type index_Env = Env; type index_InitSettings = InitSettings; type index_LinkedInDestination = LinkedInDestination; type index_Lintrk = Lintrk; type index_LintrkAction = LintrkAction; type index_LintrkTrackData = LintrkTrackData; 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_InitSettings as InitSettings, index_LinkedInDestination as LinkedInDestination, index_Lintrk as Lintrk, index_LintrkAction as LintrkAction, index_LintrkTrackData as LintrkTrackData, index_Mapping as Mapping, index_Rule as Rule, index_Rules as Rules, index_Settings as Settings, index_Types as Types }; } declare const destinationLinkedIn: Destination; export { index as DestinationLinkedIn, destinationLinkedIn as default, destinationLinkedIn };