Debian Codegraph @

node/@patternfly/react-core/dist/esm/components/Wizard/WizardContext.d.ts

raw
1 /// <reference types="react" />
2 import { WizardStepType, WizardFooterType } from './types';
3 import { WizardFooterProps } from './WizardFooter';
4 export interface WizardContextProps {
5 /** List of steps */
6 steps: WizardStepType[];
7 /** Current step */
8 activeStep: WizardStepType;
9 /** Footer element */
10 footer: React.ReactElement<any>;
11 /** Close the wizard */
12 close: () => void;
13 /** Navigate to the next step */
14 goToNextStep: () => void | Promise<void>;
15 /** Navigate to the previous step */
16 goToPrevStep: () => void | Promise<void>;
17 /** Navigate to step by ID */
18 goToStepById: (id: number | string) => void;
19 /** Navigate to step by name */
20 goToStepByName: (name: string) => void;
21 /** Navigate to step by index */
22 goToStepByIndex: (index: number) => void;
23 /** Update the footer with any react element */
24 setFooter: (footer: React.ReactElement<any> | Partial<WizardFooterProps>) => void;
25 /** Get step by ID */
26 getStep: (stepId: number | string) => WizardStepType;
27 /** Set step by ID */
28 setStep: (step: Pick<WizardStepType, 'id'> & Partial<WizardStepType>) => void;
29 /** Flag indicating whether the wizard content should be focused after the onNext or onBack callbacks
30 * are called.
31 */
32 shouldFocusContent: boolean;
33 /** Ref for main wizard content element. */
34 mainWrapperRef: React.RefObject<HTMLElement | null>;
35 }
36 export declare const WizardContext: import("react").Context<WizardContextProps>;
37 export interface WizardContextProviderProps {
38 steps: WizardStepType[];
39 activeStepIndex: number;
40 footer: WizardFooterType;
41 children: React.ReactElement<any>;
42 onNext(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
43 onBack(event: React.MouseEvent<HTMLButtonElement>, steps: WizardStepType[]): void;
44 onClose?(event: React.MouseEvent<HTMLButtonElement>): void;
45 goToStepById(steps: WizardStepType[], id: number | string): void;
46 goToStepByName(steps: WizardStepType[], name: string): void;
47 goToStepByIndex(event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>, steps: WizardStepType[], index: number): void;
48 shouldFocusContent: boolean;
49 mainWrapperRef: React.RefObject<HTMLElement | null>;
50 }
51 export declare const WizardContextProvider: React.FunctionComponent<WizardContextProviderProps>;
52 export declare const useWizardContext: () => WizardContextProps;
53 //# sourceMappingURL=WizardContext.d.ts.map