-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add type declarations #1259
base: main
Are you sure you want to change the base?
Add type declarations #1259
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
declare module 'ember-shepherd/services/tour' { | ||
import Shepherd from 'shepherd.js'; | ||
|
||
export interface TourButton extends Shepherd.Step.StepOptionsButton { | ||
type: 'next' | 'back' | 'cancel'; | ||
} | ||
|
||
interface RequiredElement { | ||
selector: string; | ||
message: string; | ||
title: string; | ||
} | ||
|
||
export default interface Tour { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @charlesfries could we import these types from Shepherd itself? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Definitely open to figuring out how to use those types and avoid duplication, but IMO the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @charlesfries I'm not super experienced with TS, but I was hoping we could merge them into one. Perhaps the ember-shepherd one can extend the Shepherd ones and add more things? |
||
classPrefix: string; | ||
confirmCancel: boolean; | ||
confirmCancelMessage: string | null; | ||
defaultStepOptions: Record<string, unknown>; | ||
errorTitle: string | null; | ||
exitOnEsc: boolean; | ||
isActive: boolean; | ||
keyboardNavigation: boolean; | ||
messageForUser: string | null; | ||
modal: boolean; | ||
modalContainer: HTMLElement; | ||
requiredElements: RequiredElement[]; | ||
steps: Shepherd.Step[]; | ||
addSteps: (steps: Shepherd.Step.StepOptions[]) => void; | ||
back: () => void; | ||
cancel: () => void; | ||
complete: () => void; | ||
hide: () => void; | ||
next: () => void; | ||
show: (id: string) => void; | ||
start: () => void; | ||
_onTourStart: () => void; | ||
_onTourFinish: (completeOrCancel: string) => void; | ||
_initialize: () => void; | ||
_requiredElementsPresent: () => boolean; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This interface isn't really part of the tour service, but is needed because the default Shepard.js button type does not have a
type
property