usablica / intro.js

Lightweight, user-friendly onboarding tour library
http://introjs.com
Other
22.69k stars 2.59k forks source link

Invalid types for IntroStep (TypeScript) #1988

Closed Polarisation closed 11 months ago

Polarisation commented 11 months ago

Description

IntroStep types do not match documentation.

Expected Behavior

I expect to be able to add steps via the API specifying element, intro, and position properties as per the documentation: https://introjs.com/docs/intro/api#introjsaddstepssteps

Actual Behavior

This results in a type error because the IntroStep type includes step, title, and scrollTo as required properties.

error TS2345: Argument of type '{ element: string; intro: string; position: string; }' is not assignable to parameter of type 'IntroStep'.
  Type '{ element: string; intro: string; position: string; }' is missing the following properties from type 'IntroStep': step, title, scrollTo

When I ignore the type error it seems to work, so it should just be a matter of updating the types.

binrysearch commented 11 months ago

Thanks for reporting, this is now fixed and will release a new version soon