UNPKG

1.34 kBTypeScriptView Raw
1// Type definitions for NProgress 0.2
2// Project: https://github.com/rstacruz/nprogress
3// Definitions by: Judah Gabriel Himango <https://github.com/JudahGabriel>, Ovyerus <https://github.com/Ovyerus>
4// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5// TypeScript Version: 2.1
6
7declare namespace nProgress {
8 interface NProgressOptions {
9 minimum: number;
10 template: string;
11 easing: string;
12 speed: number;
13 trickle: boolean;
14 trickleSpeed: number;
15 showSpinner: boolean;
16 parent: string;
17 positionUsing: string;
18 barSelector: string;
19 spinnerSelector: string;
20 }
21
22 interface NProgress {
23 version: string;
24 settings: NProgressOptions;
25 status: number | null;
26
27 configure(options: Partial<NProgressOptions>): NProgress;
28 set(number: number): NProgress;
29 isStarted(): boolean;
30 start(): NProgress;
31 done(force?: boolean): NProgress;
32 inc(amount?: number): NProgress;
33 trickle(): NProgress;
34
35 /* Internal */
36
37 render(fromStart?: boolean): HTMLDivElement;
38 remove(): void;
39 isRendered(): boolean;
40 getPositioningCSS(): 'translate3d' | 'translate' | 'margin';
41 }
42}
43
44declare const nProgress: nProgress.NProgress;
45export = nProgress;