diff --git a/src/js/step.js b/src/js/step.js index 52a29b3a2..abb68f34a 100644 --- a/src/js/step.js +++ b/src/js/step.js @@ -233,6 +233,22 @@ export class Step extends Evented { } } + /** + * Returns the element for the step + * @return {HTMLElement|null|undefined} The element instance. undefined if it has never been shown, null if it has been destroyed + */ + getElement() { + return this.el; + } + + /** + * Returns the target for the step + * @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; + } + /** * Creates Shepherd element for step based on options * diff --git a/src/types/step.d.ts b/src/types/step.d.ts index d179a2bef..bd436f50d 100644 --- a/src/types/step.d.ts +++ b/src/types/step.d.ts @@ -61,6 +61,18 @@ declare class Step extends Evented { * @param {Step.StepOptions} options to be updated */ updateStepOptions(options: Step.StepOptions): void; + + /** + * Returns the element for the step + * @return The element instance. undefined if it has never been shown, null if it has been destroyed + */ + getElement(): HTMLElement | null | undefined + + /** + * Returns the target for the step + * @returns The element instance. undefined if it has never been shown, null if query string has not been found + */ + getTarget(): HTMLElement | null | undefined } declare namespace Step { @@ -231,7 +243,7 @@ declare namespace Step { * } * ``` */ - action?: (() => void); + action?: ((this: Tour) => void); /** * Extra classes to apply to the ``