swiper/vue missing type declarations

Created on 3 Nov 2020  路  5Comments  路  Source: nolimits4web/swiper

This is a (multiple allowed):

  • [ ] bug
  • [x] enhancement
  • [ ] feature-discussion (RFC)

I see that Swiper has already types for swiper/react component included. I would be really cool to add type definitions for swiper/vue component as well. This would allow us to integrate swiper in vue.js projects with typescript easier.

Screenshot 2020-11-03 at 8 35 50

I'm willing to work on this feature with a little guidance from maintainers.

  • Swiper Version: v3.6.5
  • Platform/Target and Browser Versions: Typescript
Vue feature request good first issue

Most helpful comment

@vltansky Apologies I meant to come back to this and create a PR. I just dropped this in as a comment temporarily. I'll raise a PR tomorrow! 馃榾

All 5 comments

If this helps anyone I wrote a skeleton typings file to get it to atleast work with a typescript vue project:

swiper-t.d.ts

declare module 'swiper/vue' {
  import _Vue from 'vue';

  export class Swiper extends _Vue {}

  export class SwiperSlide extends _Vue {}
}

@GerryWilko you're welcome to contribute :)

@vltansky Apologies I meant to come back to this and create a PR. I just dropped this in as a comment temporarily. I'll raise a PR tomorrow! 馃榾

I've raised a PR for this file. I did a bit of testing and it didn't seem to affect the React typings.

In the meantime, how we can use swiper in vue 3/typescript project?

Was this page helpful?
0 / 5 - 0 ratings