mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Define the methods on the loading bar provider in angular-loading-bar (#20220)
* Allow @types/angular-loading-bar to export a string name for angular module inclusion * Add in the methods for @types/angular-loading-bar and fix the tests
This commit is contained in:
parent
86aefa7ce6
commit
c29891901e
@ -13,13 +13,12 @@ class TestController {
|
||||
|
||||
app.controller('TestController', TestController);
|
||||
|
||||
var barConfig: angular.loadingBar.ILoadingBarProvider[] = [];
|
||||
barConfig.push({
|
||||
includeSpinner: true,
|
||||
includeBar: true,
|
||||
spinnerTemplate: 'template',
|
||||
latencyThreshold: 100,
|
||||
startSize: 0.02,
|
||||
loadingBarTemplate: '',
|
||||
autoIncrement: true
|
||||
});
|
||||
var barConfig: angular.loadingBar.ILoadingBarProvider;
|
||||
|
||||
barConfig.includeSpinner = false;
|
||||
barConfig.includeBar = false;
|
||||
barConfig.spinnerTemplate = 'someOtherTemplateString';
|
||||
barConfig.latencyThreshold = 70;
|
||||
barConfig.startSize = 0.05;
|
||||
barConfig.loadingBarTemplate = 'anotherTemplateString';
|
||||
barConfig.autoIncrement = false;
|
||||
|
||||
27
types/angular-loading-bar/index.d.ts
vendored
27
types/angular-loading-bar/index.d.ts
vendored
@ -54,6 +54,33 @@ declare module 'angular' {
|
||||
* Give illusion that there's always progress
|
||||
*/
|
||||
autoIncrement?: boolean;
|
||||
|
||||
/**
|
||||
* Broadcast the start event
|
||||
*/
|
||||
start(): void;
|
||||
|
||||
/**
|
||||
* Set the percentage completed
|
||||
* @param {number} n - number between 0 and 1
|
||||
*/
|
||||
set(n: number): void;
|
||||
|
||||
/**
|
||||
* Get the percentage completed
|
||||
* @returns {number}
|
||||
*/
|
||||
status(): number;
|
||||
|
||||
/**
|
||||
* Increment the loading bar
|
||||
*/
|
||||
inc(): void;
|
||||
|
||||
/**
|
||||
* Complete the loading bar
|
||||
*/
|
||||
complete(): void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user