-
Notifications
You must be signed in to change notification settings - Fork 29.9k
/
index.d.ts
86 lines (73 loc) · 2.65 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/// <reference types="jquery" />
declare namespace JQueryBackStretch {
interface BackStretchOptions {
/**
* The ratio of the width/height of the image doesn't always jive with the
* width/height of the window. This parameter controls whether or not we
* center the image on the X axis to account for the discrepancy.
*/
centeredX?: boolean | undefined;
/**
* This parameter controls whether or not we center the image on the Y axis
* to account for the aforementioned discrepancy.
*/
centeredY?: boolean | undefined;
/**
* This is the speed at which the image will fade in. Integers in
* milliseconds are accepted, as well as standard jQuery speed strings
* (slow, normal, fast).
*/
duration?: number | string | undefined;
/**
* The amount of time in between slides, when using Backstretch as a
* slideshow, expressed as the number of milliseconds.
*/
fade?: number | undefined;
}
interface BackStretch {
/**
* This method is called automatically when the container (window or
* block-level element) is resized, however you can always call this
* manually if needed.
*/
resize(): BackStretch;
/**
* Jump to the slide at a given index, where n is the number of the
* image that you'd like to display. Slide number starts at 0.
*
* @param {number} newIndex
*/
show(newIndex: number): BackStretch;
/**
* Advance to the next image in a slideshow.
*/
next(): BackStretch;
/**
* Display the previous image in a slideshow.
*/
prev(): BackStretch;
/**
* Pause the slideshow.
*/
pause(): BackStretch;
/**
* Resume a paused slideshow.
*/
resume(): BackStretch;
/**
* Destroy the Backstretch instance. Optionally, you can pass in a Boolean
* parameter, preserveBackground, to determine whether or not you'd like
* to keep the current image stretched as the background image.
*
* @param {boolean} preserveBackground
*/
destroy(preserveBackground?: boolean): void;
}
}
interface JQueryStatic {
backstretch(images: string[], config?: JQueryBackStretch.BackStretchOptions): JQueryBackStretch.BackStretch;
}
interface JQuery {
backstretch(images: string[], config?: JQueryBackStretch.BackStretchOptions): JQueryBackStretch.BackStretch;
backstretch(method: string): JQuery;
}