import type { EventBus, EventSource } from "@voyant-travel/core"; import type { StorefrontIntakePersistence as SharedStorefrontIntakePersistence, StorefrontIntakeSignal } from "@voyant-travel/relationships-contracts/storefront-intake"; export type { StorefrontIntakeContext, StorefrontIntakePerson, StorefrontIntakeSignal, } from "@voyant-travel/relationships-contracts/storefront-intake"; import type { StorefrontRequestContext } from "./service.js"; import type { StorefrontIntakeResponse, StorefrontLeadIntakeInput, StorefrontNewsletterSubscribeInput, StorefrontNewsletterSubscribeResponse } from "./validation.js"; export type StorefrontIntakePersistence = SharedStorefrontIntakePersistence; export declare const CUSTOMER_SIGNAL_CREATED_EVENT: "customer.signal.created"; export interface StorefrontCustomerSignalCreatedEvent { id: string; personId: string; kind: StorefrontIntakeSignal["kind"]; source: StorefrontIntakeSignal["source"]; status: StorefrontIntakeSignal["status"]; productId?: string | null; optionUnitId?: string | null; sourceSubmissionId?: string | null; intake?: { surface: "storefront"; type: "lead"; } | { surface: "storefront"; type: "newsletter"; doubleOptIn: "not_configured" | "requested"; }; } export declare function emitCustomerSignalCreated(eventBus: EventBus | undefined, payload: StorefrontCustomerSignalCreatedEvent, source?: EventSource): Promise; export interface StorefrontIntakeGuardDecision { allowed: boolean; status?: 400 | 403 | 429; error?: string; } export type StorefrontIntakeGuard = (input: { kind: "lead"; body: StorefrontLeadIntakeInput; context: StorefrontRequestContext; } | { kind: "newsletter"; body: StorefrontNewsletterSubscribeInput; context: StorefrontRequestContext; }) => Promise | StorefrontIntakeGuardDecision | undefined; export type StorefrontNewsletterDoubleOptInHook = (input: { email: string; personId: string; signalId: string; sourceSubmissionId: string; body: StorefrontNewsletterSubscribeInput; context: StorefrontRequestContext; }) => Promise | void; export type StorefrontIntakePersistenceResolver = (context: StorefrontRequestContext) => Promise | StorefrontIntakePersistence | null | undefined; export interface StorefrontIntakeOptions { guard?: StorefrontIntakeGuard; persistence?: StorefrontIntakePersistence; resolvePersistence?: StorefrontIntakePersistenceResolver; requestNewsletterDoubleOptIn?: StorefrontNewsletterDoubleOptInHook; } export declare function createStorefrontLeadSignal(input: { body: StorefrontLeadIntakeInput; context: StorefrontRequestContext; intake?: StorefrontIntakeOptions; }): Promise; export declare function subscribeStorefrontNewsletter(input: { body: StorefrontNewsletterSubscribeInput; context: StorefrontRequestContext; intake?: StorefrontIntakeOptions; requestDoubleOptIn?: StorefrontNewsletterDoubleOptInHook; }): Promise;