ManukMinasyan / vue-functional-calendar

Vue.js Functional Calendar | Component/Package
https://vue-functional-calendar.now.sh/
MIT License
468 stars 84 forks source link

Could not find a declaration file for module 'vue-functional-calendar'. #76

Closed selvievski closed 1 year ago

selvievski commented 4 years ago

I'm using the functional calendar in vuejs application in combination with typescript. I'm getting this error "Could not find a declaration file for module 'vue-functional-calendar'." I've tried to add custom .d.ts file but still there is an error from eslint and build fails. image image

gaisinskii commented 4 years ago

@selvievski

Try it like this:

1) Create a vue-functional-calendar.d.ts file and put it somewhere in your project 2) Declare your typing in the file, for eg.

declare module 'vue-functional-calendar' {
    import Vue from 'vue';

    class FunctionalCalendar extends Vue {
      // your types here
    }
    export = FunctionalCalendar;
}

3) Then go to your tsconfig.json file and add typeRoots:

{
  "compilerOptions": {
    "typeRoots": [
      "./node_modules/@types",
      "./src/types/vue-functional-calendar.d.ts",
    ]
  },
}
ManukMinasyan commented 1 year ago

Hello. Thanks for your feedback. Now I don't have time to deal with the calendar. Please create pull requests, I will appreciate it, it will be useful for the community.