Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/js/tour.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ export class Tour extends Evented {
* @param {Object} options The options for the tour
* @param {boolean} options.confirmCancel If true, will issue a `window.confirm` before cancelling
* @param {string} options.confirmCancelMessage The message to display in the confirm dialog
* @param {string} options.classPrefix The prefix to add to all the `shepherd-*` class names.
* @param {Object} options.defaultStepOptions Default options for Steps ({@link Step#constructor}), created through `addStep`
* @param {boolean} options.disableScroll When set to true, will keep the user from scrolling with the scrollbar,
* mousewheel, arrow keys, etc. You may want to use this to ensure you are driving the scroll position with the tour.
* @param {HTMLElement} options.modalContainer An optional container element for the modal.
* If not set, the modal will be appended to `document.body`.
* @param {Step[]} options.steps An array of Step instances to initialize the tour with
* @param {object} options.styleVariables An object hash of style variables to override
* @param {string} options.tourName An optional "name" for the tour. This will be appended to the the tour's
* dynamically generated `id` property -- which is also set on the `body` element as the `data-shepherd-active-tour` attribute
* whenever the tour becomes active.
Expand Down
29 changes: 6 additions & 23 deletions src/types/step.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ declare class Step extends Evented {
*/
constructor(tour: Tour, options: Step.StepOptions);//TODO superheri Note: Return on constructor is not possible in typescript. Could this be possible to make this the same for the constructor of the Step class?

/**
* Returns the tour for the step
* @return The tour instance
*/
getTour(): Tour;

/**
* Cancel the tour
* Triggers the `cancel` event
Expand All @@ -38,6 +32,12 @@ declare class Step extends Evented {
*/
destroy(): void;

/**
* Returns the tour for the step
* @return The tour instance
*/
getTour(): Tour;

/**
* Hide the step and destroy the tippy instance
*/
Expand All @@ -49,23 +49,6 @@ declare class Step extends Evented {
*/
isOpen(): boolean;

/**
* Create the element and set up the tippy instance
*/
setupElements(): void;

/**
* If a custom scrollToHandler is defined, call that, otherwise do the generic
* scrollIntoView call.
*/
scrollTo(): void;

/**
* Sets the options for the step, maps `when` to events, sets up buttons
* @param options The options for the step default is `{}`
*/
setOptions(options?: Step.StepOptions): void;

/**
* Wraps `_show` and ensures `beforeShowPromise` resolves before calling show
* @return Promise
Expand Down
25 changes: 9 additions & 16 deletions src/types/tour.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,6 @@ declare class Tour extends Evented {
*/
complete(): void;

/**
* Called whenever the tour is cancelled or completed, basically anytime we exit the tour
* @param event The event name to trigger
*/
done(event: string): void;

/**
* Gets the step from a given id
* @param id The id of the step to retrieve
Expand Down Expand Up @@ -76,16 +70,6 @@ declare class Tour extends Evented {
*/
removeStep(name: string): void;

/**
* Setup a new step object
* @param stepOptions The object describing the options for the step
* @param name The string or number to use as the `id` for the step
* @return The step instance
*/
setupStep(stepOptions: Step.StepOptions, name: string | number): Step;

beforeShowStep(step: Step): void;

/**
* Show a specific step in the tour
* @param key The key to look up the step by
Expand All @@ -101,6 +85,10 @@ declare class Tour extends Evented {

declare namespace Tour {
interface TourOptions {
/**
* The prefix to add to all the `shepherd-*` class names.
*/
classPrefix?: string;
/**
* If true, will issue a `window.confirm` before cancelling
*/
Expand All @@ -119,6 +107,11 @@ declare namespace Tour {
*/
steps?: Step[];

/**
* An object hash of style variables to override
*/
styleVariables?: object;

/**
* An optional "name" for the tour. This will be appended to the the tour's
* dynamically generated `id` property -- which is also set on the `body` element as the `data-shepherd-active-tour` attribute
Expand Down