Added types to functions for FlexSlider (#13708)

* Changed noImplicitAny to true

* Added any type to the functions

* Fixed failing tests

* Changed canAdvance to return a boolean
This commit is contained in:
Alfy 2017-01-03 21:02:50 +03:00 committed by Andy
parent 4f8d89c52e
commit 3876a417cd
3 changed files with 9 additions and 9 deletions

View File

@ -62,7 +62,7 @@ $(window).load(function() {
var player = document.getElementById('player_1');
$(player).on('ready', ready);
function addEvent(element, eventName, callback) {
function addEvent(element:any, eventName:any, callback:any) {
if (element.addEventListener) {
element.addEventListener(eventName, callback, false)
} else {
@ -70,7 +70,7 @@ $(window).load(function() {
}
}
function ready(player_id) {
function ready(player_id: any) {
var froogaloop = $(player_id);
froogaloop.on('play', function(data) {
$('.flexslider').flexslider("pause");

12
flexslider/index.d.ts vendored
View File

@ -18,11 +18,11 @@ interface SliderObject { //Object: The slider element itself
directionNav: Object; //Object: The slider directionNav
controlsContainer: Object; //Object: The controlsContainer element of the slider
manualControls: Object; //Object: The manualControls element of the slider
flexAnimate(target, pause?); //Function: Move slider - (target, pause) parameters
pause(); //Function: Pause slider slideshow interval
resume(); //Function: Resume slider slideshow interval
canAdvance(target); //Function: returns boolean if slider can advance - (target) parameter
getTarget(dir); //Function: get target given a direction - "next" or "prev" parameter
flexAnimate(target:any, pause?: any) :any; //Function: Move slider - (target, pause) parameters
pause(): any; //Function: Pause slider slideshow interval
resume(): any; //Function: Resume slider slideshow interval
canAdvance(target:any): boolean; //Function: returns boolean if slider can advance - (target) parameter
getTarget(dir: any): any; //Function: get target given a direction - "next" or "prev" parameter
}
interface FlexSliderOptions {
@ -86,5 +86,5 @@ interface FlexSliderOptions {
interface JQuery {
flexslider(options?: FlexSliderOptions);
flexslider(options?: FlexSliderOptions): any;
}

View File

@ -2,7 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": false,
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",