vue-functional-calendar icon indicating copy to clipboard operation
vue-functional-calendar copied to clipboard

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

Open selvievski opened this issue 4 years ago • 1 comments

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

selvievski avatar May 08 '20 18:05 selvievski

@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;
}
  1. Then go to your tsconfig.json file and add typeRoots:
{
  "compilerOptions": {
    "typeRoots": [
      "./node_modules/@types",
      "./src/types/vue-functional-calendar.d.ts",
    ]
  },
}

gaisinskii avatar Jul 20 '20 13:07 gaisinskii

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.

ManukMinasyan avatar Nov 02 '22 12:11 ManukMinasyan