import React from 'react'; import { type CoachmarkPlacement } from './Coachmark.js'; export interface TourStep { /** The `id` of the element this step points at. */ target: string; /** Names the step's coachmark. */ title: string; /** What to know about the target. */ body?: React.ReactNode; placement?: CoachmarkPlacement; } export interface TourLabels { /** Default "Next". */ next?: string; /** Default "Back". */ back?: string; /** The last step's button. Default "Done". */ done?: string; /** The close button, which ends the tour. Default "End tour". */ close?: string; /** Where the reader is. Receives numbers. Default "2 of 4". */ progress?: (current: number, total: number) => string; } export interface TourProps { /** The steps, in order. A step whose target is not on the page is skipped. */ steps: TourStep[]; /** Running or not. Start it from a button — see Coachmark on why. */ isOpen: boolean; /** `false` when it ends: Done, the close button or Escape. */ onOpenChange: (isOpen: boolean) => void; /** Done on the last step — finished, not abandoned. Remember it here. */ onComplete?: () => void; /** The step shown, by its index in `steps`. */ onStepChange?: (index: number) => void; labels?: TourLabels; } /** * Tour — Coachmarks in a sequence: one at a time, each pointing at its * target, with where the reader is ("2 of 4"), Back, Next, and Done on the * last. The close button and Escape end it; focus goes back to what started * it, once, at the end. * * STEPS ARE DATA * * A step names its target by `id`, so a tour is a list anyone can write * without threading refs through the page. A target that is not on the page * when the tour starts — removed, or hidden at a phone's width — is skipped, * and the count is of the steps that remain: "3 of 3", never "3 of 4" with a * step that points at nothing. * * FINISHED IS NOT DISMISSED * * `onComplete` fires for Done on the last step only. Ended early, the tour * calls `onOpenChange(false)` alone, so a product can offer it again to * someone who stopped halfway and not to someone who saw it through. */ export declare function Tour({ steps, isOpen, onOpenChange, onComplete, onStepChange, labels, }: TourProps): React.JSX.Element | null; export declare namespace Tour { var displayName: string; } //# sourceMappingURL=Tour.d.ts.map