Giter Club home page Giter Club logo

Comments (12)

tmladek avatar tmladek commented on July 17, 2024 4

Right now, trying to import @fullcalendar/vue results in the following error:

TS7016: Could not find a declaration file for module '@fullcalendar/vue'. '/[...]/node_modules/@fullcalendar/vue/main.umd.js' implicitly has an 'any' type.

I assume they mean this, in any case it's the error that brought me here :)

from fullcalendar-vue.

yooouuri avatar yooouuri commented on July 17, 2024 4

We are missing types for fullcalendar vue

from fullcalendar-vue.

nadershamma avatar nadershamma commented on July 17, 2024 3

If anyone is looking for type definitions I have submitted some to DefinitelyTyped https://www.npmjs.com/package/@types/fullcalendar__vue

from fullcalendar-vue.

acerix avatar acerix commented on July 17, 2024 1

Are you looking for TypeScript version as described here?

https://vuejs.org/v2/guide/typescript.html

from fullcalendar-vue.

arshaw avatar arshaw commented on July 17, 2024 1

@nadershamma, thank you so much for writing those definitions! They really helped me get oriented while thinking about this issue.

After a bit of investigation, I decided to rewrite the fullcalendar vue connector in TypeScript (a language I love) and have the definitions be auto-generated. Just like what others have suggested in this thread. I already do something like this for the React connector.

This is all available in the release candidate.

Package info: https://www.npmjs.com/package/@fullcalendar/vue/v/5.0.0-rc
Example project: https://github.com/fullcalendar/fullcalendar-example-projects/tree/v5/vue-typescript

Please try these out and report any problems in a separate issue. Thank you!

from fullcalendar-vue.

tmladek avatar tmladek commented on July 17, 2024

Any news?

from fullcalendar-vue.

haexhub avatar haexhub commented on July 17, 2024

Would be really nice if you could provide the types declaration file for typescript support!
Or you write your vue components in a typescript. ;)

Instead of

<script>
  props: {
    user: {
      type: Object
    , required: true
    }
  }

, data: () {
    return {}
  }
</script>
<script lang="ts">
import Vue from 'vue'

interface User {
  firstName: string
  lastName: number
}

export default Vue.extend({
  props: {
    user: {
      type: Object,
      required: true
    } as PropOptions<User>
  }

, data: () {
    return {}
  }

})

You already found the right link. :)
Thank you for your great work so far. :)

from fullcalendar-vue.

tmladek avatar tmladek commented on July 17, 2024

Any news yet?

from fullcalendar-vue.

tmladek avatar tmladek commented on July 17, 2024

"Latest commit af28b03 on Aug 12, 2019" - is anyone still maintaining this project?

from fullcalendar-vue.

nadershamma avatar nadershamma commented on July 17, 2024

Having an issue with this as well, is there a plan to add type definitions?

from fullcalendar-vue.

nadershamma avatar nadershamma commented on July 17, 2024

I decided to give this a go, first time writing types definition for a package. I have it working in our project. I'll be honest first time I have written a types defs, was a lot of pocking around until the IDE and compiler stopped complaining but it may not be the right way.

There is an issue around using the $refs api with class based vues, see this stackoverflow thread

So I created an interface type in the defs called FullCalendarComponent to resolve this.

My question now is where do I place these files? shall I stick them in this repo in src and you bundle it up into the package you have on npm or do we create a new package? The former seems the easiest; will probably need a little help with the latter.

from fullcalendar-vue.

Riplar avatar Riplar commented on July 17, 2024

A workaround would be to make a typescript definition file where you simply do something like this:

declare module '@fullcalendar/vue';

That way your code compiles, but you still don't have "real" typescript support.

from fullcalendar-vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.