diff --git a/nprogress/NProgress-tests.ts b/nprogress/NProgress-tests.ts index d7ad68b39..3d07cafa2 100644 --- a/nprogress/NProgress-tests.ts +++ b/nprogress/NProgress-tests.ts @@ -3,6 +3,7 @@ function test_basics() { NProgress.start(); NProgress.inc(); + NProgress.inc(0.2); NProgress.done(); NProgress.set(0.5); @@ -29,4 +30,4 @@ function test_configuration() { trickleRate: 0.42, trickleSpeed: 42 }); -} \ No newline at end of file +} diff --git a/nprogress/NProgress.d.ts b/nprogress/NProgress.d.ts index a86558aae..6bad4cfd1 100644 --- a/nprogress/NProgress.d.ts +++ b/nprogress/NProgress.d.ts @@ -23,6 +23,13 @@ interface NProgressStatic { */ inc(): NProgressStatic; + /** + * Increments the progress bar with a set amount. + * @param {number} amount This will get the current status value and adds the value until status is max 0.994 + * @returns {NProgressConfigureOptions} The current NProgress object, useful for chaining. + */ + inc(amount: number): NProgressStatic; + /** * Removes the progress indicator. */ @@ -102,4 +109,4 @@ interface NProgressConfigureOptions { template?: string; } -declare var NProgress: NProgressStatic; \ No newline at end of file +declare var NProgress: NProgressStatic;