From 37231524482452a41c4c1759d6a4e46c14dc610b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20Pi=C4=85tkowski?= Date: Wed, 29 Jul 2015 14:50:45 +0200 Subject: [PATCH] Definitions for OwlCarousel Type definitions for OwlCarousel options and extenstion for jQuery interface. --- owlcarousel/owlCarousel-tests.ts | 12 +++++++ owlcarousel/owlCarousel.d.ts | 62 ++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 owlcarousel/owlCarousel-tests.ts create mode 100644 owlcarousel/owlCarousel.d.ts diff --git a/owlcarousel/owlCarousel-tests.ts b/owlcarousel/owlCarousel-tests.ts new file mode 100644 index 000000000..82190dca6 --- /dev/null +++ b/owlcarousel/owlCarousel-tests.ts @@ -0,0 +1,12 @@ +/// +/// + +$(".className").owlCarousel(); + +$(".className").owlCarousel({ + singleItem: true, + slideSpeed: 300, + paginationSpeed: 400, + lazyLoad: true, + autoPlay: 4000 +}); diff --git a/owlcarousel/owlCarousel.d.ts b/owlcarousel/owlCarousel.d.ts new file mode 100644 index 000000000..14608e39e --- /dev/null +++ b/owlcarousel/owlCarousel.d.ts @@ -0,0 +1,62 @@ +// Type definitions for OwlCarousel v.1.3.3 +// Project: https://github.com/OwlFonk/OwlCarousel +// Definitions by: Damian PiÄ…tkowski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +interface IOwlCarouselOptions { + + // options + items: number; + itemsDesktop: number[]; + itemsDesktopSmall: number[]; + itemsTablet: number[]; + itemsTabletSmall: any; + itemsMobile: number[]; + itemsCustom: any; + singleItem: boolean; + itemsScaleUp: boolean; + slideSpeed: number; + paginationSpeed: number; + rewindSpeed: number; + autoPlay: any; + stopOnHover: boolean; + navigation: boolean; + navigationText: any; + rewindNav: boolean; + scrollPerPage: boolean; + pagination: boolean; + paginationNumbers: boolean; + responsive: boolean; + responsiveRefreshRate: number; + responsiveBaseWidth: JQuery; + baseClass: string; + theme: string; + lazyLoad: boolean; + lazyFollow: boolean; + lazyEffect: any; + autoHeight: boolean; + jsonPath: any; + jsonSuccess: (data: any) => void; + dragBeforeAnimFinish: boolean; + mouseDrag: boolean; + touchDrag: boolean; + addClassActive: boolean; + transitionStyle: any; + + // callbacks + beforeUpdate: (params?: any) => void; + afterUpdate: (params?: any) => void; + beforeInit: (params?: any) => void; + afterInit: (params?: any) => void; + beforeMove: (params?: any) => void; + afterMove: (params?: any) => void; + afterAction: (params?: any) => void; + startDragging: (params?: any) => void; + afterLazyLoad: (params?: any) => void; +} + +interface JQuery { + owlCarousel(options?: any): JQuery; +}