baptistebriel / smooth-scrolling

smooth scrolling and parallax effects on scroll
MIT License
612 stars 75 forks source link

Need support for Typescript #84

Closed niyas-ali closed 5 years ago

niyas-ali commented 6 years ago

I'm not able to import Smooth class into my typescript project import Smooth from 'smooth-scrolling'; // throwing error 'Can not find module smooth-scrolling'

baptistebriel commented 6 years ago

Hi! I'm not sure about TypeScript as I've never used this before, but I'm sure using npm in a TypeScript project should work the same as a regular one. Did you get any errors while npm i smooth-scrolling ?

niyas-ali commented 6 years ago

Hi,I'm not getting any error while installing but i think it's not supporting typescript.

baptistebriel commented 6 years ago

Hi @niyas-ali, could you share a repository I could clone to test it out?

tszekely commented 5 years ago

Hi @niyas-ali ,

That is because this repo doesn't have TypeScript type definitions (.d.ts file). To work around this, you can create a file named types.d.ts in your project and add the following code to it:

declare module 'smooth-scrolling' {
  const value: any;
  export = value;
}
niyas-ali commented 5 years ago

I got a work around for this issue hence you can close this issue @baptistebriel Thanks!!!