DefinitelyTyped/types/nprogress/index.d.ts
Michael Mitchell 21e68259f6 [nprogress] bring up to current standards (#35862)
Redos the definitions
Exports options interface
Lint
Clean up tests
2019-05-31 14:24:02 -07:00

46 lines
1.3 KiB
TypeScript

// Type definitions for NProgress 0.2
// Project: https://github.com/rstacruz/nprogress
// Definitions by: Judah Gabriel Himango <https://github.com/JudahGabriel>, Ovyerus <https://github.com/Ovyerus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
declare namespace nProgress {
interface NProgressOptions {
minimum: number;
template: string;
easing: string;
speed: number;
trickle: boolean;
trickleSpeed: number;
showSpinner: boolean;
parent: string;
positionUsing: string;
barSelector: string;
spinnerSelector: string;
}
interface NProgress {
version: string;
settings: NProgressOptions;
status: number | null;
configure(options: Partial<NProgressOptions>): NProgress;
set(number: number): NProgress;
isStarted(): boolean;
start(): NProgress;
done(force?: boolean): NProgress;
inc(amount?: number): NProgress;
trickle(): NProgress;
/* Internal */
render(fromStart?: boolean): HTMLDivElement;
remove(): void;
isRendered(): boolean;
getPositioningCSS(): 'translate3d' | 'translate' | 'margin';
}
}
declare const nProgress: nProgress.NProgress;
export = nProgress;