Tour
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:110
Class representing the site tour
Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Tour(
options?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:128
Parameters
Section titled “Parameters”options?
Section titled “options?”TourOptions = {}
Returns
Section titled “Returns”Tour
Overrides
Section titled “Overrides”Properties
Section titled “Properties”bindings
Section titled “bindings”bindings:
Bindings
Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:11
Inherited from
Section titled “Inherited from”classPrefix
Section titled “classPrefix”classPrefix:
string
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:113
currentStep?
Section titled “currentStep?”
optionalcurrentStep?:Step|null
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:114
focusedElBeforeOpen?
Section titled “focusedElBeforeOpen?”
optionalfocusedElBeforeOpen?:HTMLElement|null
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:115
optionalid?:string
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:116
modal?
Section titled “modal?”
optionalmodal?:ShepherdModalAPI|null
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:117
options
Section titled “options”options:
TourOptions
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:118
steps:
Step[]
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:119
trackedEvents
Section titled “trackedEvents”trackedEvents:
string[]
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:111
Methods
Section titled “Methods”_setupActiveTour()
Section titled “_setupActiveTour()”_setupActiveTour():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:471
Make this tour “active”
Returns
Section titled “Returns”void
addStep()
Section titled “addStep()”addStep(
options,index?):Step|StepOptions
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:174
Adds a new step to the tour
Parameters
Section titled “Parameters”options
Section titled “options”An object containing step options or a Step instance
index?
Section titled “index?”number
The optional index to insert the step at. If undefined, the step is added to the end of the array.
Returns
Section titled “Returns”The newly added step
addSteps()
Section titled “addSteps()”addSteps(
steps?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:196
Add multiple steps to the tour
Parameters
Section titled “Parameters”steps?
Section titled “steps?”Step[] | StepOptions[]
The steps to add to the tour
Returns
Section titled “Returns”Tour
back()
Section titled “back()”back():
void|Promise<void>
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:209
Go to the previous step in the tour
Returns
Section titled “Returns”void | Promise<void>
cancel()
Section titled “cancel()”cancel():
Promise<void>
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:220
Calls _done() triggering the ‘cancel’ event
If confirmCancel is true, will show a window.confirm before cancelling
If confirmCancel is a function, will call it and wait for the return value,
and only cancel when the value returned is true
Returns
Section titled “Returns”Promise<void>
complete()
Section titled “complete()”complete():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:244
Calls _done() triggering the complete event
Returns
Section titled “Returns”void
getById()
Section titled “getById()”getById(
id):Step|undefined
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:253
Gets the step from a given id
Parameters
Section titled “Parameters”string | number
The id of the step to retrieve
Returns
Section titled “Returns”Step | undefined
The step corresponding to the id
getCurrentStep()
Section titled “getCurrentStep()”getCurrentStep():
Step|null|undefined
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:262
Gets the current step
Returns
Section titled “Returns”Step | null | undefined
hide()
Section titled “hide()”hide():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:269
Hide the current step
Returns
Section titled “Returns”void
isActive()
Section titled “isActive()”isActive():
boolean
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:280
Check if the tour is active
Returns
Section titled “Returns”boolean
next()
Section titled “next()”next():
void|Promise<void>
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:288
Go to the next step in the tour
If we are at the end, call complete
Returns
Section titled “Returns”void | Promise<void>
off(
event,handler?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:53
Removes an event listener for the given event string.
Parameters
Section titled “Parameters”string
handler?
Section titled “handler?”Returns
Section titled “Returns”Tour
Inherited from
Section titled “Inherited from”on(
event,handler,ctx?,once?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:22
Adds an event listener for the given event string.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”unknown
boolean = false
Returns
Section titled “Returns”Tour
Inherited from
Section titled “Inherited from”once()
Section titled “once()”once(
event,handler,ctx?):Tour
Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:42
Adds an event listener that only fires once for the given event string.
Parameters
Section titled “Parameters”string
handler
Section titled “handler”unknown
Returns
Section titled “Returns”Tour
Inherited from
Section titled “Inherited from”removeStep()
Section titled “removeStep()”removeStep(
name):void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:302
Removes the step from the tour
Parameters
Section titled “Parameters”string
The id for the step to remove
Returns
Section titled “Returns”void
setupModal()
Section titled “setupModal()”setupModal():
void
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:480
setupModal create the modal container and instance
Returns
Section titled “Returns”void
show()
Section titled “show()”show(
key?,forward?):void|Promise<void>
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:334
Show a specific step in the tour
Parameters
Section titled “Parameters”string | number
The key to look up the step by
forward?
Section titled “forward?”boolean = true
True if we are going forward, false if backward
Returns
Section titled “Returns”void | Promise<void>
A promise when the step’s waitForElement option makes showing
asynchronous, otherwise undefined
start()
Section titled “start()”start():
Promise<void>
Defined in: docs-src/node_modules/shepherd.js/src/tour.ts:419
Start the tour
Returns
Section titled “Returns”Promise<void>
trigger()
Section titled “trigger()”trigger(
event, …args):Tour
Defined in: docs-src/node_modules/shepherd.js/src/evented.ts:78
Triggers an event listener for the given event string.
Parameters
Section titled “Parameters”string
…any[]
Returns
Section titled “Returns”Tour