mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Merge pull request #24363 from AndersonFriaca/nivo-slider
Types for Nivo-Slider
This commit is contained in:
Vendored
+39
@@ -0,0 +1,39 @@
|
||||
// Type definitions for Nivo Slider 3.2
|
||||
// Project: https://github.com/Codeinwp/Nivo-Slider-jQuery
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
export type EffectType = 'sliceDown' | 'sliceDownLeft' | 'sliceUp' | 'sliceUpLeft' | 'sliceUpDown' | 'sliceUpDownLeft' |
|
||||
'fold' | 'fade' | 'random' | 'slideInRight' | 'slideInLeft' | 'boxRandom' | 'boxRain' | 'boxRainReverse' |
|
||||
'boxRainGrow' | 'boxRainGrowReverse';
|
||||
|
||||
export interface Options {
|
||||
effect?: EffectType;
|
||||
slices?: number;
|
||||
boxCols?: number;
|
||||
boxRows?: number;
|
||||
animSpeed?: number;
|
||||
pauseTime?: number;
|
||||
startSlide?: number;
|
||||
directionNav?: boolean;
|
||||
controlNav?: boolean;
|
||||
controlNavThumbs?: boolean;
|
||||
pauseOnHover?: boolean;
|
||||
manualAdvance?: boolean;
|
||||
prevText?: string;
|
||||
nextText?: string;
|
||||
randomStart?: boolean;
|
||||
beforeChange?: () => void;
|
||||
afterChange?: () => void;
|
||||
slideshowEnd?: () => void;
|
||||
lastSlide?: () => void;
|
||||
afterLoad?: () => void;
|
||||
}
|
||||
declare global {
|
||||
interface JQuery {
|
||||
nivoSlider(options?: Options): JQuery;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { Options } from "nivo-slider";
|
||||
|
||||
// basic usage
|
||||
$('#slider').nivoSlider();
|
||||
|
||||
// with options
|
||||
const options: Options = {
|
||||
effect: 'random',
|
||||
slices: 15,
|
||||
boxCols: 8,
|
||||
boxRows: 4,
|
||||
animSpeed: 500,
|
||||
pauseTime: 3000,
|
||||
startSlide: 0,
|
||||
directionNav: true,
|
||||
controlNav: true,
|
||||
controlNavThumbs: false,
|
||||
pauseOnHover: true,
|
||||
manualAdvance: false,
|
||||
prevText: 'Prev',
|
||||
nextText: 'Next'
|
||||
};
|
||||
$('#slider').nivoSlider(options);
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"nivo-slider-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Reference in New Issue
Block a user