mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* Restructure files and add missing declarations * Add JQuery declarations * Restructure tests * Add carousel tests * Add more tests and missing JQuery declarations * Add waves declaration and a test * Add static init methods and tests * allow jquery and cash object to be passed to init * Remove redundant reference * Clean up * Clean up * Clean up and add tests * Clean up and add tests
87 lines
1.7 KiB
TypeScript
87 lines
1.7 KiB
TypeScript
/// <reference path="./common.d.ts" />
|
|
|
|
declare namespace M {
|
|
class Slider extends Component<SliderOptions> {
|
|
/**
|
|
* Get Instance
|
|
*/
|
|
static getInstance(elem: Element): Slider;
|
|
|
|
/**
|
|
* Init Slider
|
|
*/
|
|
static init(els: Element, options?: Partial<SliderOptions>): Slider;
|
|
|
|
/**
|
|
* Init Sliders
|
|
*/
|
|
static init(els: MElements, options?: Partial<SliderOptions>): Slider[];
|
|
|
|
/**
|
|
* ID of the dropdown element
|
|
*/
|
|
el: Element;
|
|
|
|
/**
|
|
* ID of the dropdown element
|
|
*/
|
|
options: SliderOptions;
|
|
|
|
/**
|
|
* Index of current slide
|
|
*/
|
|
activeIndex: number;
|
|
|
|
/**
|
|
* Pause slider autoslide
|
|
*/
|
|
pause(): void;
|
|
|
|
/**
|
|
* Start slider autoslide
|
|
*/
|
|
start(): void;
|
|
|
|
/**
|
|
* Move to next slider
|
|
*/
|
|
next(): void;
|
|
|
|
/**
|
|
* Move to prev slider
|
|
*/
|
|
prev(): void;
|
|
}
|
|
|
|
interface SliderOptions {
|
|
/**
|
|
* Set to false to hide slide indicators
|
|
* @default true
|
|
*/
|
|
indicators: boolean;
|
|
|
|
/**
|
|
* Set height of slider
|
|
* @default 400
|
|
*/
|
|
height: number;
|
|
|
|
/**
|
|
* Set the duration of the transition animation in ms
|
|
* @default 500
|
|
*/
|
|
duration: number;
|
|
|
|
/**
|
|
* Set the duration between transitions in ms
|
|
* @default 6000
|
|
*/
|
|
interval: number;
|
|
}
|
|
}
|
|
|
|
interface JQuery {
|
|
slider(method: keyof Pick<M.Slider, "pause" | "start" | "next" | "prev" | "destroy">): JQuery;
|
|
slider(options?: Partial<M.SliderOptions>): JQuery;
|
|
}
|