Merge pull request #19562 from Jake91/FancyBoxNoImplicitAny

[Fancybox] added return type "void" to allow compiling with the noImplicitAny flag enabled
This commit is contained in:
Nathan Shively-Sanders
2017-09-10 21:10:47 -07:00
committed by GitHub
3 changed files with 22 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ $.fancybox.update();
$.fancybox.toggle();
$.fancybox.showLoading();
$.fancybox.hideLoading();
$(".selector").fancybox({ 'type': 'image' });
$(".selector").fancybox({ type: 'image' });
$("#single_1").fancybox({
helpers: {
title: {
@@ -114,7 +114,7 @@ $(".fancybox").fancybox({
});
$(".fancybox").fancybox({
beforeLoad: () => {
this.title = 'Image ' + (this.index + 1) + ' of ' + this.group.length + (this.title ? ' - ' + this.title : '');
this.title = this.title ? `Image ${this.index + 1} of ${this.group.length} - ${this.title}` : `Image ${this.index + 1} of ${this.group.length}`;
}
});
$.fancybox('<div><h1>Lorem Lipsum</h1><p>Lorem lipsum</p></div>', {
@@ -142,4 +142,4 @@ $.fancybox([
$(".fancybox").fancybox({
margin: [20, 60, 20, 60]
});
});

View File

@@ -4,7 +4,6 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="jquery" />
interface FancyboxOptions extends FancyboxCallback {
@@ -79,18 +78,18 @@ interface FancyboxOptions extends FancyboxCallback {
}
interface FancyboxMethods {
open(group?: any[], options?: FancyboxOptions);
cancel();
close(force?: boolean);
play();
next();
prev();
jumpto(index?: number);
reposition();
update();
toggle();
showLoading();
hideLoading();
open(group?: any[], options?: FancyboxOptions): void;
cancel(): void;
close(force?: boolean): void;
play(): void;
next(): void;
prev(): void;
jumpto(index?: number): void;
reposition(): void;
update(): void;
toggle(): void;
showLoading(): void;
hideLoading(): void;
(options: FancyboxOptions): void;
(selector: string, options?: FancyboxOptions): void;

View File

@@ -0,0 +1,7 @@
{
"extends": "dtslint/dt.json",
"rules": {
"ban-types": false,
"unified-signatures": false
}
}