File tree Expand file tree Collapse file tree 2 files changed +38
-0
lines changed
Expand file tree Collapse file tree 2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ export interface LaddaButton {
2+ start ( ) : LaddaButton ,
3+ startAfter ( delay : number ) : LaddaButton ,
4+ stop ( ) : LaddaButton ,
5+ toggle ( ) : LaddaButton ,
6+ setProgress ( progress : number ) : void ,
7+ isLoading ( ) : boolean ,
8+ remove ( ) : void ,
9+ }
10+
11+ export interface BindOptions {
12+ /**
13+ * Number of milliseconds to wait before automatically cancelling the animation.
14+ */
15+ timeout ?: number ,
16+
17+ /**
18+ * A function to be called with the Ladda instance when a target button is clicked.
19+ */
20+ callback ?: ( instance : LaddaButton ) => void ,
21+ }
22+
23+ /**
24+ * Creates a new instance of Ladda which wraps the target button element.
25+ */
26+ export function create ( button : HTMLButtonElement ) : LaddaButton ;
27+
28+ /**
29+ * Binds the target buttons to automatically enter the loading state when clicked.
30+ * @param target Either an HTML element or a CSS selector.
31+ */
32+ export function bind ( target : HTMLElement | string , options ?: BindOptions ) : void ;
33+
34+ /**
35+ * Stops all current loading animations.
36+ */
37+ export function stopAll ( ) : void ;
Original file line number Diff line number Diff line change 44 "description" : " Buttons with built-in loading indicators" ,
55 "homepage" : " http://lab.hakim.se/ladda" ,
66 "main" : " ./js/ladda.js" ,
7+ "types" : " ./js/ladda.d.ts" ,
78 "scripts" : {
89 "test" : " grunt jshint" ,
910 "prepare" : " grunt && rollup -c" ,
You can’t perform that action at this time.
0 commit comments