declare namespace UserLeap { const SurveyState: { READY: string; DISABLED: string; NO_SURVEY: string; }; const SprigUserInterfaceMode: { unspecified: number; light: number; dark: number; }; /** Lifecycle event names for {@link addEventListener}. */ const SprigEventName: { sdkReady: "sdkReady"; visitorIdUpdated: "visitorIdUpdated"; surveyHeight: "surveyHeight"; surveyStateReturned: "surveyStateReturned"; surveyWillPresent: "surveyWillPresent"; surveyPresented: "surveyPresented"; surveyAppeared: "surveyAppeared"; questionAnswered: "questionAnswered"; surveyCloseRequested: "surveyCloseRequested"; surveyWillClose: "surveyWillClose"; surveyClosed: "surveyClosed"; surveyCompleted: "surveyCompleted"; replayCapture: "replayCapture"; replayCaptureStarted: "replayCaptureStarted"; replayCaptureStopped: "replayCaptureStopped"; replayCaptureCompleted: "replayCaptureCompleted"; replayRenderingCompleted: "replayRenderingCompleted"; replayUploadCompleted: "replayUploadCompleted"; replayEventsUploadCompleted: "replayEventsUploadCompleted"; loggingEvent: "loggingEvent"; }; type SprigEventNameValue = | "sdkReady" | "visitorIdUpdated" | "surveyHeight" | "surveyStateReturned" | "surveyWillPresent" | "surveyPresented" | "surveyAppeared" | "questionAnswered" | "surveyCloseRequested" | "surveyWillClose" | "surveyClosed" | "surveyCompleted" | "replayCapture" | "replayCaptureStarted" | "replayCaptureStopped" | "replayCaptureCompleted" | "replayRenderingCompleted" | "replayUploadCompleted" | "replayEventsUploadCompleted" | "loggingEvent"; interface SprigEventSubscription { remove(): void; } /** * Severity tag on an emitted `loggingEvent` (read-only — host apps receive it, * they don't set it). Android emits the real level; iOS has no log-level * concept and always reports "info". */ type SprigLogLevel = "info" | "debug" | "warning" | "error" | "critical"; /** Canonical payload for `loggingEvent`. */ interface SprigLoggingEventData { type: "loggingEvent"; message: string; level: SprigLogLevel; } interface SprigEventData { /** Echoes the event name (e.g. "surveyPresented"). */ type?: string; /** Survey identifier when the event is survey-scoped. */ surveyId?: number; /** Survey state when the event carries one (e.g. surveyStateReturned). */ surveyState?: string; /** Log message text on `loggingEvent`. */ message?: string; /** Log level on `loggingEvent`. */ level?: SprigLogLevel; [key: string]: any; } function overrideUserInterfaceMode(mode: SprigUserInterfaceMode): void; function visitorIdentifier(): number; function visitorIdentifierString(): string; function sdkVersion(): string; function configure(environment: string, configuration?: {[key: string]: any}): void; function setPreviewKey(previewKey: string): void; function presentSurvey(): void; /** * @deprecated This function is outdated. Use `trackEvent()` instead. */ function track(event: string, surveyStateCallback: ((surveyState: string) => void)): void; /** * @deprecated This function is outdated. Use `trackEventWithProperties()` instead. */ function trackWithProperties(event: string, userId: string | undefined, partnerAnonymousId: string | undefined, properties: {[key: string]: any}, surveyStateCallback: ((surveyState: string) => void)): void; /** * @deprecated This function is outdated. Use `trackEventAndIdentify()` instead. */ function trackAndIdentify(event: string, userId: string | undefined, partnerAnonymousId: string | undefined, surveyStateCallback: ((surveyState: string) => void)): void; function trackEvent( event: string, surveyResultCallback: (result: { surveyState: string; surveyId: number }) => void ): void; function trackEventWithProperties( event: string, userId: string | undefined, partnerAnonymousId: string | undefined, properties: { [key: string]: any }, surveyResultCallback: (result: { surveyState: string; surveyId: number }) => void ): void; function trackEventAndIdentify( event: string, userId: string | undefined, partnerAnonymousId: string | undefined, surveyResultCallback: (result: { surveyState: string; surveyId: number }) => void ): void; function setEmailAddress(emailAddress: string): void; function setVisitorAttribute(key: string, value: string): void; function setVisitorAttributes(attributes: {[key: string]: string}): void; function removeVisitorAttributes(keys: [string]): void; function setVisitorAttributesAndIdentify(attributes: {[key: string]: string}, userId: string | undefined, partnerAnonymousId: string | undefined): void; function setUserIdentifier(identifier: string): void; function logout(): void; function dismissActiveSurvey(): void; function pauseDisplayingSurveys(): void; function unpauseDisplayingSurveys(): void; function trackAndPresent(event: string): void; function trackIdentifyAndPresent(event: string, userId: string | undefined, partnerAnonymousId: string | undefined): void; /** Subscribe to a native SDK lifecycle event; `.remove()` unsubscribes only this listener. */ function addEventListener( eventName: SprigEventNameValue, callback: (data: SprigEventData) => void ): SprigEventSubscription; /** Remove every listener for the given event name, or all listeners if no name is given. */ function removeAllEventListeners(eventName?: SprigEventNameValue): void; /** Lifecycle event names this platform's SDK emits (cached; `[]` when unavailable). */ function getSupportedEventNames(): SprigEventNameValue[]; } export default UserLeap;