Skip to content

Types

Every type below is exported from guideway.

interface TourDefinition {
id: string;
steps: StepDefinition[];
showOnce?: boolean; // auto-start once per install (needs `storage`)
onComplete?: () => void;
onSkip?: (atIndex: number) => void;
}
interface StepDefinition {
id: string; // must match a useTourTarget(id)
title?: string;
body?: string | ReactNode;
placement?: 'top' | 'bottom' | 'left' | 'right' | 'auto'; // default 'bottom'
cutout?: Cutout; // per-step spotlight shape
render?: TooltipComponent; // per-step custom tooltip
}
interface Cutout {
shape?: 'rect' | 'rounded' | 'circle' | 'pill';
padding?: number; // extra space around the target, in px
radius?: number; // corner radius for shape 'rounded' (default 8)
}

ThemeOverride is what you pass to the provider’s theme prop; it is deep-merged over the chosen light or dark base.

interface GuidewayTheme {
overlayColor: string; // scrim color (include opacity in the rgba)
accent: string; // primary button color
tooltip: {
backgroundColor: string;
textColor: string;
titleColor: string;
borderRadius: number;
padding: number;
maxWidth: number;
fontFamily?: string;
};
labels: { next: string; back: string; skip: string; done: string };
}
interface ThemeOverride {
overlayColor?: string;
accent?: string;
tooltip?: Partial<GuidewayTheme['tooltip']>;
labels?: Partial<GuidewayTheme['labels']>;
}

Guideway also exports lightTheme, darkTheme, and resolveTheme(scheme, override). See Theming.

The full contract handed to a custom tooltip (a step’s render, or the provider’s tooltipComponent):

interface TooltipRenderProps {
step: StepDefinition;
stepIndex: number;
totalSteps: number;
progress: number;
isFirst: boolean;
isLast: boolean;
next: () => void;
back: () => void;
skip: () => void;
stop: () => void;
}

A pluggable adapter for showOnce persistence. It matches the shape of AsyncStorage and MMKV, and tolerates sync or async implementations.

interface TourStorage {
getItem(key: string): Promise<string | null> | string | null;
setItem(key: string, value: string): Promise<void> | void;
removeItem?(key: string): Promise<void> | void;
}
interface UseTourTargetOptions {
scrollRef?: RefObject<ScrollView | FlatList>;
index?: number;
enabled?: boolean;
}
interface Insets {
top: number;
right: number;
bottom: number;
left: number;
}