Skip to content

Commit

Permalink
Fix docs build (#2646)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieTheWagner authored Mar 20, 2024
1 parent 3412f6b commit 5447f99
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
24 changes: 14 additions & 10 deletions shepherd.js/src/step.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ import {
import ShepherdElement from './components/shepherd-element.svelte';
import { type Tour } from './tour.ts';

type StepText =
| string
| ReadonlyArray<string>
| HTMLElement
| (() => string | ReadonlyArray<string> | HTMLElement);

type StringOrStringFunction = string | (() => string);

/**
* The options for the step
*/
Expand Down Expand Up @@ -154,11 +162,7 @@ export interface StepOptions {
* - `Function` to be executed when the step is built. It must return one of the three options above.
* ```
*/
text?:
| string
| ReadonlyArray<string>
| HTMLElement
| (() => string | ReadonlyArray<string> | HTMLElement);
text?: StepText;

/**
* The step's title. It becomes an `h3` at the top of the step.
Expand All @@ -167,7 +171,7 @@ export interface StepOptions {
* - `Function` to be executed when the step is built. It must return HTML string.
* ```
*/
title?: string | (() => string);
title?: StringOrStringFunction;

/**
* You can define `show`, `hide`, etc events inside `when`. For example:
Expand Down Expand Up @@ -238,7 +242,7 @@ export interface StepOptionsButton {
/**
* The aria-label text of the button
*/
label?: string | (() => string);
label?: StringOrStringFunction;

/**
* A boolean, that when true, adds a `shepherd-button-secondary` class to the button.
Expand All @@ -248,7 +252,7 @@ export interface StepOptionsButton {
/**
* The HTML text of the button
*/
text?: string | (() => string);
text?: StringOrStringFunction;
}

export interface StepOptionsButtonEvent {
Expand Down Expand Up @@ -430,7 +434,7 @@ export class Step extends Evented {

/**
* Returns the target for the step
* @return The element instance. undefined if it has never been shown, null if query string has not been found
* @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if query string has not been found
*/
getTarget() {
return this.target;
Expand All @@ -439,7 +443,7 @@ export class Step extends Evented {
/**
* Creates Shepherd element for step based on options
*
* @return {Element} The DOM element for the step tooltip
* @return {HTMLElement} The DOM element for the step tooltip
* @private
*/
_createTooltipContent() {
Expand Down
12 changes: 7 additions & 5 deletions shepherd.js/src/tour.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ interface EventOptions {
tour: Tour;
}

type TourConfirmCancel =
| boolean
| (() => boolean)
| Promise<boolean>
| (() => Promise<boolean>);

/**
* The options for the tour
*/
Expand All @@ -33,11 +39,7 @@ export interface TourOptions {
* If it is a function(support Async Function), it will be called and wait for the return value,
* and will only be cancelled if the value returned is true.
*/
confirmCancel?:
| boolean
| (() => boolean)
| Promise<boolean>
| (() => Promise<boolean>);
confirmCancel?: TourConfirmCancel;
/**
* The message to display in the `window.confirm` dialog.
*/
Expand Down

0 comments on commit 5447f99

Please sign in to comment.