Thunberg087 / vue-fragment

a very candide fragment component for Vue.js
http://jsfiddle.net/cdkn5wL3/
670 stars 51 forks source link

No declaration file for TypeScript support #28

Closed douglasg14b closed 4 years ago

douglasg14b commented 5 years ago

As the title says, TypeScript throws an error since there is no declaration file for the lib when implicit any is off.

y-nk commented 5 years ago

I'm not a user of TS, nor a big fan of it, but i understand people would need this. Please feel free to PR it.

ChuckBorris33 commented 4 years ago

For anyone waiting for this to be released. You can add declarations to your project. Add file e.g. shims.vue-fragment.d.ts with content:

declare module 'vue-fragment' {
  import Vue, { AsyncComponent, ComponentOptions, PluginObject } from 'vue'

  type Component = ComponentOptions<Vue> | typeof Vue | AsyncComponent

  export const Fragment: Component
  export const Plugin: PluginObject<undefined>

  namespace VueFragment {
    export const Fragment: Component
    export const Plugin: PluginObject<undefined>
  }
  export default VueFragment
}