From d4c49e7eff21c5bbfa91f125f15cd22aff125f1b Mon Sep 17 00:00:00 2001 From: Mikael Selander Date: Mon, 17 Nov 2014 10:44:23 +0100 Subject: [PATCH 1/2] Added inc overload that takes an amount --- nprogress/NProgress.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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; From 30c37d82b5bfba367983a489717d3dc76a873d50 Mon Sep 17 00:00:00 2001 From: Mikael Selander Date: Mon, 17 Nov 2014 10:47:33 +0100 Subject: [PATCH 2/2] Added test --- nprogress/NProgress-tests.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +}