mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 21:00:01 +08:00
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:
@@ -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]
|
||||
});
|
||||
});
|
||||
|
||||
25
types/fancybox/index.d.ts
vendored
25
types/fancybox/index.d.ts
vendored
@@ -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;
|
||||
|
||||
7
types/fancybox/tslint.json
Normal file
7
types/fancybox/tslint.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json",
|
||||
"rules": {
|
||||
"ban-types": false,
|
||||
"unified-signatures": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user