Skip to content

Commit e001514

Browse files
committed
docs: add jsdocs for types
1 parent 5e294ca commit e001514

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/types.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,35 @@
11
export type Handler = (() => Promise<void>) | (() => void) | null;
22

33
export type WizardProps = {
4+
/** Optional header that is shown above the active step */
45
header?: React.ReactNode;
6+
/** Optional footer that is shown below the active step */
57
footer?: React.ReactNode;
68
};
79

810
export type WizardValues = {
11+
/** Go to the next step */
912
nextStep: () => Promise<void>;
13+
/** Go to the previous step */
1014
previousStep: () => void;
15+
/**
16+
* Connect a callback that will be called when calling `nextStep()`
17+
*
18+
* @param handler Can be either sync or async
19+
*
20+
*/
1121
handleStep: (handler: Handler) => void;
22+
/**
23+
* Indicate the current state of the handler
24+
*
25+
* Will reflect the handler promise state: will be `true` if the handler promise is pending and
26+
* `false` when the handler is either fulfilled or rejected
27+
*/
1228
isLoading: boolean;
29+
/** The urrent active step of the wizard */
1330
activeStep: number;
31+
/** Indicate if the current step is the first step (aka no previous step) */
1432
isFirstStep: boolean;
33+
/** Indicate if the current step is the last step (aka no next step) */
1534
isLastStep: boolean;
1635
} | null;

0 commit comments

Comments
 (0)