mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
➕ Add typings for OwlCarousel2 library
This commit is contained in:
parent
a77d0ea37f
commit
41a9cb0c8d
130
types/owl.carousel/index.d.ts
vendored
Normal file
130
types/owl.carousel/index.d.ts
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
// Type definitions for owl.carousel 2.2
|
||||
// Project: https://github.com/OwlCarousel2/OwlCarousel2
|
||||
// Definitions by: Ismael Gorissen <https://github.com/igorissen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
declare namespace OwlCarousel {
|
||||
interface Options {
|
||||
// OPTIONS
|
||||
items?: number;
|
||||
margin?: number;
|
||||
loop?: boolean;
|
||||
center?: boolean;
|
||||
mouseDrag?: boolean;
|
||||
touchDrag?: boolean;
|
||||
pullDrag?: boolean;
|
||||
freeDrag?: boolean;
|
||||
stagePadding?: number;
|
||||
merge?: boolean;
|
||||
mergeFit?: boolean;
|
||||
autoWidth?: boolean;
|
||||
startPosition?: number | string;
|
||||
URLhashListener?: boolean;
|
||||
nav?: boolean;
|
||||
rewind?: boolean;
|
||||
navText?: string[];
|
||||
navElement?: string;
|
||||
slideBy?: number | string;
|
||||
dots?: boolean;
|
||||
dotsEach?: number | boolean;
|
||||
dotData?: boolean;
|
||||
lazyLoad?: boolean;
|
||||
lazyContent?: boolean;
|
||||
autoplay?: boolean;
|
||||
autoplayTimeout?: number;
|
||||
autoplayHoverPause?: boolean;
|
||||
smartSpeed?: boolean;
|
||||
fluidSpeed?: boolean;
|
||||
autoplaySpeed?: number | boolean;
|
||||
navSpeed?: number | boolean;
|
||||
dotsSpeed?: number | boolean;
|
||||
dragEndSpeed?: number | boolean;
|
||||
callbacks?: boolean;
|
||||
responsive?: { [breakpoint: string]: Options };
|
||||
responsiveRefreshRate?: number;
|
||||
responsiveBaseElement?: Element;
|
||||
video?: boolean;
|
||||
videoHeight?: number | boolean;
|
||||
videoWidth?: number | boolean;
|
||||
animateOut?: string | boolean;
|
||||
animateIn?: string | boolean;
|
||||
fallbackEasing?: string;
|
||||
info?: Function;
|
||||
nestedItemSelector?: string;
|
||||
itemElement?: string;
|
||||
stageElement?: string;
|
||||
navContainer?: string | boolean;
|
||||
dotsContainer?: string | boolean;
|
||||
// CLASSES
|
||||
refreshClass?: string;
|
||||
loadingClass?: string;
|
||||
loadedClass?: string;
|
||||
rtlClass?: string;
|
||||
dragClass?: string;
|
||||
grabClass?: string;
|
||||
stageClass?: string;
|
||||
stageOuterClass?: string;
|
||||
navContainerClass?: string;
|
||||
navClass?: string[];
|
||||
controlsClass?: string;
|
||||
dotClass?: string;
|
||||
dotsClass?: string;
|
||||
autoHeightClass?: string;
|
||||
responsiveClass?: string | boolean;
|
||||
// EVENTS
|
||||
onInitialize?: Function;
|
||||
onInitialized?: Function;
|
||||
onResize?: Function;
|
||||
onResized?: Function;
|
||||
onRefresh?: Function;
|
||||
onRefreshed?: Function;
|
||||
onDrag?: Function;
|
||||
onDragged?: Function;
|
||||
onTranslate?: Function;
|
||||
onTranslated?: Function;
|
||||
onChange?: Function;
|
||||
onChanged?: Function;
|
||||
onLoadLazy?: Function;
|
||||
onLoadedLazy?: Function;
|
||||
onStopVideo?: Function;
|
||||
onPlayVideo?: Function;
|
||||
}
|
||||
|
||||
type OnEvent = 'initialize.owl.carousel'
|
||||
| 'initialized.owl.carousel'
|
||||
| 'resize.owl.carousel'
|
||||
| 'resized.owl.carousel'
|
||||
| 'refresh.owl.carousel'
|
||||
| 'refreshed.owl.carousel'
|
||||
| 'drag.owl.carousel'
|
||||
| 'dragged.owl.carousel'
|
||||
| 'translate.owl.carousel'
|
||||
| 'translated.owl.carousel'
|
||||
| 'change.owl.carousel'
|
||||
| 'changed.owl.carousel'
|
||||
| 'load.owl.lazy'
|
||||
| 'loaded.owl.lazy'
|
||||
| 'stop.owl.video'
|
||||
| 'play.owl.video';
|
||||
|
||||
type TriggerEvent = 'refresh.owl.carousel'
|
||||
| 'next.owl.carousel'
|
||||
| 'prev.owl.carousel'
|
||||
| 'to.owl.carousel'
|
||||
| 'destroy.owl.carousel'
|
||||
| 'replace.owl.carousel'
|
||||
| 'add.owl.carousel'
|
||||
| 'remove.owl.carousel'
|
||||
| 'play.owl.autoplay'
|
||||
| 'stop.owl.autoplay';
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
owlCarousel(options?: OwlCarousel.Options | 'destroy'): JQuery;
|
||||
|
||||
on(event: OwlCarousel.OnEvent, handler: (...args: any[]) => void): JQuery;
|
||||
|
||||
trigger(event: OwlCarousel.TriggerEvent): JQuery;
|
||||
}
|
||||
5
types/owl.carousel/owl.carousel-tests.ts
Normal file
5
types/owl.carousel/owl.carousel-tests.ts
Normal file
@ -0,0 +1,5 @@
|
||||
$('#first').owlCarousel();
|
||||
|
||||
$('#second').owlCarousel({});
|
||||
|
||||
$('#third').owlCarousel('destroy');
|
||||
23
types/owl.carousel/tsconfig.json
Normal file
23
types/owl.carousel/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"owl.carousel-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/owl.carousel/tslint.json
Normal file
1
types/owl.carousel/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user