posthog-js
Version:
Posthog-js allows you to automatically capture usage and send events to PostHog.
34 lines (30 loc) • 1.54 kB
TypeScript
import { JSX } from 'preact';
import { PostHog } from './module';
import { Survey, SurveyQuestionBranchingType } from '@posthog/browser-common';
/**
* Determine the next survey step based on branching configuration.
* Returns the next question index, or SurveyQuestionBranchingType.End if the survey should end.
*/
declare function getNextSurveyStep(survey: Survey, currentQuestionIndex: number, response: string | string[] | number | null): number | typeof SurveyQuestionBranchingType.End;
/**
* `previewPageIndex` sentinel for the intro screen — the leading mirror of the confirmation
* page's `survey.questions.length` sentinel. Also serves as a capability marker for the main
* app: bundles without this export cannot render the intro screen preview.
*/
declare const INTRO_SCREEN_PREVIEW_INDEX = -1;
declare const renderSurveysPreview: ({ survey, parentElement, previewPageIndex, forceDisableHtml, onPreviewSubmit, onPreviewBack, positionStyles, }: {
survey: Survey;
parentElement: HTMLElement;
previewPageIndex: number;
forceDisableHtml?: boolean;
onPreviewSubmit?: (res: string | string[] | number | null) => void;
onPreviewBack?: () => void;
posthog?: PostHog;
positionStyles?: JSX.CSSProperties;
}) => void;
declare const renderFeedbackWidgetPreview: ({ survey, root, forceDisableHtml, }: {
survey: Survey;
root: HTMLElement;
forceDisableHtml?: boolean;
}) => void;
export { INTRO_SCREEN_PREVIEW_INDEX, getNextSurveyStep, renderFeedbackWidgetPreview, renderSurveysPreview };