From 9bf669ddb6285b5c39b1a76ac99bfee073477ec7 Mon Sep 17 00:00:00 2001 From: Stephan Classen Date: Thu, 6 Sep 2018 23:31:14 +0200 Subject: [PATCH 1/3] improve comments --- types/angular-block-ui/index.d.ts | 37 +++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index f0dcdcd076..cbb486101f 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -48,6 +48,8 @@ declare module 'angular' { * * If you don't want this behaviour and want to do all the * blocking manually you can change this value to false. + * + * The default value is 'true' */ autoBlock?: boolean; @@ -56,6 +58,8 @@ declare module 'angular' { * hide the overlay whenever an exception has occurred. * * You can set this value to false if you don't want this behaviour. + * + * The default value is 'true' */ resetOnException?: boolean; @@ -74,33 +78,42 @@ declare module 'angular' { /** * When the module is started it will inject the main block element - * by adding the block-ui directive to the body element. + * by adding the "block-ui" directive to the element. + * + * Set this to false if there no need for any fullscreen blocking or if there's + * more control required. For instance when your ng-app directive is a child + * element of the body element it is impossible for the blockUI resolve the main + * instance. In such a case the auto injection of the main block scope should + * be disabled and the main block element should be relocated. + * + * The default value is 'true' */ autoInjectBodyBlock?: boolean; /** - * A string containing the default css classes, separated by spaces, + * A string containing the default css classes (separated by spaces) * that should be applied to each block-ui element. * - * The default value is `block-ui block-ui-anim-fade` + * The default value is "block-ui block-ui-anim-fade" */ cssClass?: string; /** - * Whenever a user interface block is active, because the single page - * application is still waiting for a response from the backend server, - * the user can still navigate away using the back and forward buttons - * of the browser. + * While a user interface block is active the user can still navigate + * away using the back and forward buttons of the browser. * - * Callbacks registered to handle the responses from the server will - * be executed even if a different view/controller is currently active. - * By setting the blockBrowserNavigation property to true the - * angular-block-ui module will prevent navigation while a fullscreen + * Callbacks registered to handle responses from the server will + * be executed even if a different view/controller is active at the + * time the response arrives. + * + * You can set this value to true if you want to prevent navigation + * with the browser back and forward buttons while a fullscreen * block is active. * * Programatic location changes via the $location service are still * allowed however. - * The navigation block is disabled by default. + * + * The default value is 'false' */ blockBrowserNavigation?: boolean; } From 499ad37387b714129b6bac168c9c21c9ccdcf3a1 Mon Sep 17 00:00:00 2001 From: Stephan Classen Date: Thu, 6 Sep 2018 23:31:50 +0200 Subject: [PATCH 2/3] add missing parameter to method done() --- types/angular-block-ui/angular-block-ui-tests.ts | 4 +++- types/angular-block-ui/index.d.ts | 2 +- types/angular-block-ui/tsconfig.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/types/angular-block-ui/angular-block-ui-tests.ts b/types/angular-block-ui/angular-block-ui-tests.ts index 4446e73234..8733565449 100644 --- a/types/angular-block-ui/angular-block-ui-tests.ts +++ b/types/angular-block-ui/angular-block-ui-tests.ts @@ -36,7 +36,9 @@ app.controller('Ctrl', ($scope: ng.IScope, blockUI: angular.blockUI.BlockUIServi blockUI.stop(); blockUI.reset(); blockUI.message("Hello Types"); - blockUI.done(); + blockUI.done(() => { + console.log("blockUI stopped"); + }); const b: boolean = blockUI.isBlocking(); const myBlockUI = blockUI.instances.get("myBlockUI"); diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index cbb486101f..a55c2efb9b 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -163,7 +163,7 @@ declare module 'angular' { * This can be useful whenever you wish to redirect the user * to a different location while there are still pending AJAX requests. */ - done(): void; + done(doneCallback: () => void): void; /** * Allows the message shown in the overlay to be updated diff --git a/types/angular-block-ui/tsconfig.json b/types/angular-block-ui/tsconfig.json index f5717731be..8810e02911 100644 --- a/types/angular-block-ui/tsconfig.json +++ b/types/angular-block-ui/tsconfig.json @@ -21,4 +21,4 @@ "index.d.ts", "angular-block-ui-tests.ts" ] -} \ No newline at end of file +} From 83fbe79d343f9860acfeea4cc09028279d57ecd1 Mon Sep 17 00:00:00 2001 From: Stephan Classen Date: Thu, 6 Sep 2018 23:52:07 +0200 Subject: [PATCH 3/3] format header comment --- types/angular-block-ui/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/angular-block-ui/index.d.ts b/types/angular-block-ui/index.d.ts index a55c2efb9b..39cbcce194 100644 --- a/types/angular-block-ui/index.d.ts +++ b/types/angular-block-ui/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for angular-block-ui 0.2 // Project: https://github.com/McNull/angular-block-ui -// Definitions by: Lasse Nørregaard , Stephan Classen , Soner Köksal +// Definitions by: Lasse Nørregaard +// Stephan Classen +// Soner Köksal // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3