forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathladda.d.ts
36 lines (29 loc) · 900 Bytes
/
ladda.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
// Type definitions for Ladda 0.9.4
// Project: https://github.com/hakimel/Ladda
// Definitions by: Danil Flores <https://github.com/dflor003/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface ILaddaButton {
start(): ILaddaButton;
startAfter(delay: number): ILaddaButton
stop(): ILaddaButton;
toggle(): ILaddaButton;
setProgress(progress: number): ILaddaButton;
enable(): ILaddaButton;
disable(): ILaddaButton;
isLoading(): boolean;
remove(): void;
}
interface ILaddaOptions {
timeout?: number;
callback?: (instance: ILaddaButton) => void;
}
interface ILadda {
bind(target: HTMLElement, options?: ILaddaOptions): void;
bind(cssSelector: string, options?: ILaddaOptions): void;
create(button: Element): ILaddaButton;
stopAll(): void;
}
declare var Ladda: ILadda;
declare module "ladda" {
export = Ladda;
}