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 f0dcdcd076..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 @@ -48,6 +50,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 +60,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 +80,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; } @@ -150,7 +165,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 +}