Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

charlesfries
Copy link

  • Adds TypeScript ambient types

@charlesfries charlesfries changed the title Add ambient types Add type declarations Dec 8, 2022
declare module 'ember-shepherd/services/tour' {
import Shepherd from 'shepherd.js';

export interface TourButton extends Shepherd.Step.StepOptionsButton {
Copy link
Author

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

index.d.ts Outdated
title: string;
}

export default interface Tour {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@charlesfries could we import these types from Shepherd itself?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Tour class type here https://github.com/shipshapecode/shepherd/blob/master/src/types/tour.d.ts seems to be pretty similar, but there are methods like addStep() that exist in the Shepherd Tour class that don't exist in the Tour Ember service.

Definitely open to figuring out how to use those types and avoid duplication, but IMO the Tour object and Tour service may need to be distinct.

Copy link
Member

Choose a reason for hiding this comment

The 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants