Skip to content

Commit

Permalink
Fix: #52 - TypeScript support
Browse files Browse the repository at this point in the history
  • Loading branch information
joe223 committed Jan 17, 2021
1 parent d204a28 commit eb9d452
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/tiny-swiper/__test__/smoke/instance.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('lifecycle', () => {
width: 300,
height: 300
})
const swiperInstance = Swiper(elementsInstance.$el)
const swiperInstance = new Swiper(elementsInstance.$el)
const events: {
[key: string]: Function
} = {}
Expand Down
1 change: 1 addition & 0 deletions packages/tiny-swiper/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type SwiperPlugin = (instance: SwiperInstance, options: Options) => void

export type Swiper = {
(el: HTMLElement | string, userOptions?: UserOptions): SwiperInstance
new (el: HTMLElement | string, userOptions?: UserOptions): SwiperInstance
use: (plugins: Array<SwiperPlugin>) => void
plugins: Array<SwiperPlugin>
}
Expand Down
10 changes: 5 additions & 5 deletions packages/tiny-swiper/src/modules/lazyload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { State } from '../core/state/index'

export type SwiperPluginLazyloadOptions = {
loadPrevNext: boolean
loadPrevNextAmount: 1
loadPrevNextAmount: number
loadOnTransitionStart: boolean
elementClass: 'swiper-lazy'
loadingClass: 'swiper-lazy-loading'
loadedClass: 'swiper-lazy-loaded'
preloaderClass: 'swiper-lazy-preloader'
elementClass: string
loadingClass: string
loadedClass: string
preloaderClass: string
}

export type SwiperPluginLazyloadPartialOptions = Partial<SwiperPluginLazyloadOptions> | boolean
Expand Down
4 changes: 2 additions & 2 deletions packages/tiny-swiper/src/modules/mousewheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Options } from '../core/options'

export type SwiperPluginMousewheelOptions = {
invert: boolean
sensitivity: 1
interval: 400
sensitivity: number
interval: number
}

export type SwiperPluginMousewheelPartialOptions = Partial<SwiperPluginMousewheelOptions>
Expand Down
2 changes: 1 addition & 1 deletion packages/tiny-swiper/src/modules/pagination.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Options } from '../core/options'

export type SwiperPluginPaginationOptions = {
el: string
clickable: false
clickable: boolean
bulletClass: string | 'swiper-pagination-bullet'
bulletActiveClass: string | 'swiper-pagination-bullet-active'
}
Expand Down

0 comments on commit eb9d452

Please sign in to comment.