/*! Tripetto Classic Runner 7.0.1 - Copyright (C) 2024 Tripetto B.V. - All Rights Reserved */ declare module "@tripetto/runner-classic" { import * as TripettoClassic from "@tripetto/runner-classic/module"; export * from "@tripetto/runner-classic/module"; export { TripettoClassic }; export default TripettoClassic; } declare module "@tripetto/runner-classic/es5" { import * as TripettoClassic from "@tripetto/runner-classic/module"; export * from "@tripetto/runner-classic/module"; export { TripettoClassic }; export default TripettoClassic; } declare module "@tripetto/runner-classic/runner" { import * as TripettoClassic from "@tripetto/runner-classic/module"; export * from "@tripetto/runner-classic/module"; export { TripettoClassic }; export default TripettoClassic; } declare module "@tripetto/runner-classic/runner/es5" { import * as TripettoClassic from "@tripetto/runner-classic/module"; export * from "@tripetto/runner-classic/module"; export { TripettoClassic }; export default TripettoClassic; } declare module "@tripetto/runner-classic/react" { import * as TripettoClassic from "@tripetto/runner-classic/module"; export * from "@tripetto/runner-classic/module"; export { TripettoClassic }; export default TripettoClassic; } declare module "@tripetto/runner-classic/module" { import { Hooks, IDefinition, ISnapshot, Instance, L10n, NodeBlock, TL10n, TStyles } from "@tripetto/runner"; import { TOverlayContext } from "@tripetto/runner-fabric/overlay"; import { IRunnerAttachments, IRunnerProps, TRunnerPreviewData, TRunnerViews } from "@tripetto/runner-react-hook"; import { styled } from "styled-components"; import { CSSProperties, FocusEvent, MutableRefObject, ReactNode } from "react"; export interface IClassicStyles extends TStyles { readonly mode?: "paginated" | "continuous" | "progressive"; readonly color?: string; readonly autoFocus?: boolean; readonly noBranding?: boolean; readonly showEnumerators?: boolean; readonly hideRequiredIndicator?: boolean; readonly showPageIndicators?: boolean; readonly showProgressbar?: boolean; readonly font?: { readonly family?: string; readonly size?: number; readonly sizeSmall?: number; }; readonly background?: { readonly color?: string; readonly url?: string; readonly opacity?: number; readonly positioning?: "auto" | "100% auto" | "auto 100%" | "cover" | "contain" | "repeat"; }; readonly inputs?: { readonly backgroundColor?: string; readonly borderColor?: string; readonly borderSize?: number; readonly roundness?: number; readonly textColor?: string; readonly errorColor?: string; readonly agreeColor?: string; readonly declineColor?: string; readonly selectionColor?: string; }; readonly buttons?: { readonly baseColor?: string; readonly textColor?: string; readonly roundness?: number; readonly mode?: "fill" | "outline"; readonly finishColor?: string; }; } export interface IRuntimeStyles extends IClassicStyles { readonly font: { readonly family: string; readonly size: number; readonly sizeSmall: number; readonly color: string; }; readonly background: { readonly color: string; readonly opacity: number; readonly url?: string; readonly positioning?: "auto" | "100% auto" | "auto 100%" | "cover" | "contain" | "repeat"; }; readonly inputs: { readonly backgroundColor: string; readonly borderColor: string; readonly borderSize: number; readonly roundness: number | undefined; readonly textColor: string; readonly errorColor: string; readonly scale: number; }; readonly checkboxes: { readonly backgroundColor: string; readonly borderColor: string; readonly borderSize: number; readonly roundness: number | undefined; readonly textColor: string; readonly errorColor: string; readonly scale: number; readonly hideRequiredIndicator: boolean; }; readonly radiobuttons: { readonly backgroundColor: string; readonly borderColor: string; readonly borderSize: number; readonly textColor: string; readonly scale: number; }; readonly matrix: { readonly backgroundColor: string; readonly borderColor: string; readonly borderSize: number; readonly textColor: string; readonly errorColor: string; readonly scale: number; readonly hideRequiredIndicator: boolean; }; readonly yesNo: { readonly yesColor: string; readonly noColor: string; readonly outlineSize: number; readonly roundness: number | undefined; readonly scale: number; readonly margin: number; readonly alignment: "horizontal" | "vertical"; }; readonly rating: { readonly color: string; readonly scale: number; }; readonly scale: { readonly color: string; readonly outlineSize: number; readonly roundness: number | undefined; readonly scale: number; readonly margin: number; readonly labelColor: string; }; readonly multipleChoice: { readonly color: string; readonly outlineSize: number; readonly roundness: number | undefined; readonly scale: number; readonly margin: number; }; readonly pictureChoice: { readonly color: string; readonly outlineSize: number; readonly roundness: number | undefined; readonly scale: number; readonly margin: number; }; readonly fileUpload: { readonly backgroundColor: string; readonly borderColor: string; readonly borderSize: number; readonly roundness: number | undefined; readonly textColor: string; readonly errorColor: string; readonly scale: number; }; readonly buttons: { readonly baseColor: string; readonly textColor: string | undefined; readonly outlineSize: number; readonly roundness: number | undefined; readonly mode: "fill" | "outline"; readonly scale: number; }; readonly finishButton: { readonly baseColor: string; readonly textColor: string | undefined; readonly outlineSize: number; readonly roundness: number | undefined; readonly mode: "fill" | "outline"; readonly scale: number; }; } export interface IClassicRenderProps { readonly id: string; readonly l10n: L10n.Namespace; readonly styles: IRuntimeStyles; readonly overlay: TOverlayContext; readonly view: TRunnerViews; readonly name: JSX.Element | undefined; readonly description: JSX.Element | undefined; readonly explanation: JSX.Element | undefined; readonly label: JSX.Element | undefined; readonly placeholder: string; readonly tabIndex: number; readonly isFailed: boolean; readonly isPage: boolean; readonly ariaDescribedBy: string | undefined; readonly ariaDescription: JSX.Element | undefined; readonly focus: (e: FocusEvent) => T; readonly blur: (e: FocusEvent) => T; readonly autoFocus: (element: HTMLElement | null) => void; readonly onSubmit: (() => void) | undefined; readonly attachments: IRunnerAttachments | undefined; readonly markdownifyToJSX: (md: string, lineBreaks?: boolean) => JSX.Element; readonly markdownifyToURL: (md: string) => string; readonly markdownifyToImage: (md: string) => string; readonly markdownifyToString: (md: string) => string; } export interface IClassicRendering extends NodeBlock { readonly required?: boolean; readonly marginAroundBlock?: boolean; readonly hideRequiredIndicatorFromName?: boolean; readonly render?: (props: IClassicRenderProps) => ReactNode; } export interface IClassicSnapshot { /** Contains focus information. */ readonly b?: { [key: string]: false | true | undefined; }; /** Contains the email address that was used to pause. */ readonly d?: string; /** Contains a timestamp of the snapshot. */ readonly e?: number; } export interface IClassicController { definition: IDefinition; styles: IClassicStyles; l10n: TL10n; view: TRunnerViews; readonly instance: Instance | undefined; readonly fingerprint: string; readonly snapshot: ISnapshot | undefined; readonly isRunning: boolean; readonly isFinishing: boolean; readonly isPausing: boolean; readonly isLicensed: boolean; readonly allowStart: boolean; readonly allowRestart: boolean; readonly allowPause: boolean; readonly allowStop: boolean; readonly start: () => void; readonly restart: () => void; readonly pause: () => ISnapshot | Promise> | undefined; readonly stop: () => void; readonly doPreview: (data: TRunnerPreviewData) => void; } export interface IBuilderInstance extends Hooks<"OnChange" | "OnEdit"> { definition: IDefinition | undefined; edit(sType: "branch" | "section" | "node" | "condition", sId: string): void; edit(sType: "epilogue", sId?: string): void; edit(sType?: "properties" | "prologue"): void; } export type TClassicDisplay = "inline" | "page"; export type TClassicPause = | { readonly recipe: "email"; readonly onPause: ( emailAddress: string, snapshot: ISnapshot, language: string, locale: string, namespace: string ) => Promise | boolean | void; } | ((snapshot: ISnapshot, language: string, locale: string, namespace: string) => Promise | boolean | void); export interface IClassicUIProps extends IRunnerProps { /** Specifies the styles (colors, font, size, etc.) for the runner. */ readonly styles?: IClassicStyles; /** Specifies the localization (locale and translation) information. */ readonly l10n?: TL10n; /** Specifies the initial view mode of the runner. */ readonly view?: TRunnerViews; /** Specifies the display mode of the runner. */ readonly display?: TClassicDisplay; /** Specifies a license code for the runner. */ readonly license?: string; /** Removes all Tripetto branding when a valid license is supplied. */ readonly removeBranding?: boolean; /** Specifies a custom class name for the HTML element that holds the runner. */ readonly className?: string; /** Specifies the inline style for the HTML element that holds the runner. */ readonly customStyle?: CSSProperties; /** * Specifies custom CSS rules. * To specify rules for a specific block, use this selector: [data-block=""] { ... } */ readonly customCSS?: string; /** Specifies a function that is invoked when the runner needs a locale or translation. */ readonly onL10n?: (l10n: TL10n) => Promise; /** Specifies a function that is invoked when the runner wants to reload the definition. */ readonly onReload?: () => IDefinition | Promise; /** Specifies a function that is invoked when an edit action is requested. */ readonly onEdit?: (type: "prologue" | "epilogue" | "styles" | "l10n" | "block", id?: string) => void; /** Specifies a function or recipe that is invoked when the runner wants to pause. */ readonly onPause?: TClassicPause; /** Specifies a function that is invoked when the runner is "touched" by a user. */ readonly onTouch?: () => void; /** Reference to the runner controller. */ readonly controller?: MutableRefObject; /** Specifies a function that is invoked when the runner controller is available. */ readonly onController?: (controller: MutableRefObject) => void; } export type IClassicProps = Omit< IClassicUIProps, "definition" | "snapshot" | "styles" | "license" | "l10n" | "onL10n" | "l10nNamespace" > & { /** Specifies the definition to run. */ readonly definition?: IDefinition | Promise; /** Specifies the snapshot that should be restored. */ readonly snapshot?: ISnapshot | Promise | undefined>; /** Specifies the styles. */ readonly styles?: IClassicStyles | Promise; /** Specifies a license code for the runner. */ readonly license?: string | Promise; /** Removes all Tripetto branding when a valid license is supplied. */ readonly removeBranding?: boolean; /** Try to store sessions in the local store to preserve persistency on navigation between multiple pages that host the runner. */ readonly persistent?: boolean; /** Specifies the localization information. */ readonly l10n?: TL10n | Promise; /** Specifies the preferred language (when no language is specified in the definition). */ readonly language?: string; /** Provides locale information. */ readonly locale?: L10n.ILocale | ((locale: string) => L10n.ILocale | Promise | undefined); /** Provides translations. */ readonly translations?: | L10n.TTranslation | L10n.TTranslation[] | (( language: string, name: string, version: string ) => L10n.TTranslation | L10n.TTranslation[] | Promise | undefined); /** Specifies a loader that is shown when the runner is loading. */ readonly loader?: JSX.Element; /** Reference to a builder instance to enable live preview for the builder. */ readonly builder?: MutableRefObject; }; export const ClassicUI: (props: IClassicUIProps) => import("react/jsx-runtime").JSX.Element; export interface IClassic { /** Specifies the parent element for the runner. */ readonly element?: HTMLElement | null; /** Specifies the definition to run. */ readonly definition?: IDefinition | Promise; /** Specifies the snapshot that should be restored. */ readonly snapshot?: ISnapshot | Promise | undefined>; /** Specifies the styles (colors, font, size, etc.) for the runner. */ readonly styles?: IClassicStyles | Promise; /** Specifies the localization (locale and translation) information. */ readonly l10n?: TL10n | Promise; /** Specifies the initial view mode of the runner. */ readonly view?: TRunnerViews; /** Specifies the display mode of the runner. */ readonly display?: TClassicDisplay; /** Try to store sessions in the local store to preserve persistency on navigation between multiple pages that host the runner. */ readonly persistent?: boolean; /** Specifies a license code for the runner. */ readonly license?: string | Promise; /** Removes all Tripetto branding when a valid license is supplied. */ readonly removeBranding?: boolean; /** Specifies a custom class name for the runner element. */ readonly className?: string; /** Specifies the inline style for the runner element. */ readonly customStyle?: CSSProperties; /** * Specifies custom CSS rules. * To specify rules for a specific block, use this selector: [data-block=""] { ... } */ readonly customCSS?: string; /** Specifies the attachments handler. */ readonly attachments?: IRunnerAttachments; /** Specifies the preferred language (when no language is specified in the definition). */ readonly language?: string; /** Provides locale information. */ readonly locale?: L10n.ILocale | ((locale: string) => L10n.ILocale | Promise | undefined); /** Provides translations. */ readonly translations?: | L10n.TTranslation | L10n.TTranslation[] | (( language: string, name: string, version: string ) => L10n.TTranslation | L10n.TTranslation[] | Promise | undefined); /** Reference to a builder instance to enable live preview for the builder. */ readonly builder?: IBuilderInstance; /** Specifies a function that is invoked when the runner is ready. */ readonly onReady?: (instance?: Instance) => void; /** Specifies a function that is invoked when the runner is touched by a user. */ readonly onTouch?: () => void; /** Specifies a function that is invoked when the user performs an action. */ readonly onAction?: ( type: "start" | "stage" | "unstage" | "focus" | "blur" | "pause" | "complete", definition: { readonly fingerprint: string; readonly name: string; }, block?: { readonly id: string; readonly name: string; readonly alias?: string; } ) => void; /** Invoked when data can be imported into the instance. */ readonly onImport?: (instance: Instance) => void; /** Invoked when there is a change. */ readonly onChange?: (instance: Instance) => void; /** Invoked when there is a data change. */ readonly onData?: (instance: Instance) => void; /** Specifies a function that is invoked when the runner wants to pause. */ readonly onPause?: TClassicPause; /** Specifies a function that is invoked when the runner submits data. */ readonly onSubmit?: ( instance: Instance, language: string, locale: string, namespace?: string ) => Promise | boolean | void; /** Invoked when the runner is completed (after the data is submitted). */ readonly onComplete?: (instance: Instance, id?: string) => void; /** Invoked when the runner wants to reload the definition. */ readonly onReload?: () => IDefinition | Promise; /** Specifies a function that is invoked when an edit action is requested. */ readonly onEdit?: (type: "prologue" | "epilogue" | "styles" | "l10n" | "block", id?: string) => void; /** Specifies a function that is invoked when the runner is destroyed. */ readonly onDestroy?: () => void; } export interface IClassicRunner extends IClassicController { readonly destroy: () => void; } export const ClassicRunner: (props: IClassicProps) => import("react/jsx-runtime").JSX.Element; /** * Bootstraps a new runner. * @param props Specifies the properties for the runner. * @returns Returns a promise to the runner controller. */ export const run: (props: IClassic) => Promise; /** Namespace identifier for the runner. */ export const namespace: string; export { color } from "@tripetto/runner-fabric/color"; export { ButtonFabric } from "@tripetto/runner-fabric/components/button"; export { CheckboxFabric } from "@tripetto/runner-fabric/components/checkbox"; export { CheckboxesFabric, ICheckbox } from "@tripetto/runner-fabric/components/checkboxes"; export { DateTimeFabric } from "@tripetto/runner-fabric/components/datetime"; export { DropdownFabric, IDropdownFabricOption } from "@tripetto/runner-fabric/components/dropdown"; export { EmailFabric } from "@tripetto/runner-fabric/components/email"; export { FileFabric, FileThumbnailFabric, IFileController, IFileService } from "@tripetto/runner-fabric/components/file"; export { InputFabric } from "@tripetto/runner-fabric/components/input"; export { MatrixFabric, IMatrixColumn, IMatrixRow } from "@tripetto/runner-fabric/components/matrix"; export { MultiSelectFabric, IMultiSelectOption } from "@tripetto/runner-fabric/components/multi-select"; export { MultipleChoiceFabric, IMultipleChoiceButton } from "@tripetto/runner-fabric/components/multiple-choice"; export { NumberFabric } from "@tripetto/runner-fabric/components/number"; export { PasswordFabric } from "@tripetto/runner-fabric/components/password"; export { PhoneNumberFabric } from "@tripetto/runner-fabric/components/phone-number"; export { PictureChoiceFabric, IPictureChoiceOption } from "@tripetto/runner-fabric/components/picture-choice"; export { RadiobuttonsFabric, IRadiobutton } from "@tripetto/runner-fabric/components/radiobuttons"; export { RatingFabric, RatingShapes } from "@tripetto/runner-fabric/components/rating"; export { RequiredIndicatorFabric } from "@tripetto/runner-fabric/components/required-indicator"; export { ScaleFabric, IScaleNumeric, IScaleOption } from "@tripetto/runner-fabric/components/scale"; export { TextFabric } from "@tripetto/runner-fabric/components/text"; export { TextareaFabric } from "@tripetto/runner-fabric/components/textarea"; export { URLFabric } from "@tripetto/runner-fabric/components/url"; export { YesNoFabric, IYesNo } from "@tripetto/runner-fabric/components/yes-no"; export { styled }; export { css, keyframes } from "styled-components"; }