mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add npm module progressbar (#14097)
This commit is contained in:
parent
e42960acab
commit
4d4a14359a
21
progressbar/index.d.ts
vendored
Normal file
21
progressbar/index.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
// Type definitions for progressbar 1.1
|
||||
// Project: https://github.com/bevry/progressbar
|
||||
// Definitions by: Arne Schubert <https://github.com/atd-schubert>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export class Progressbar {
|
||||
step(step: string): this;
|
||||
getStep(): string;
|
||||
setStep(steps: string): this;
|
||||
setTick(ticks: number): this;
|
||||
addTick(steps?: number): this;
|
||||
tick(steps?: number): this;
|
||||
getTick(): number;
|
||||
setTotal(total: number): this;
|
||||
total(total: number): this;
|
||||
addTotal(total?: number): this;
|
||||
getTotal(): number;
|
||||
finish(next?: () => void): this;
|
||||
}
|
||||
|
||||
export function create(): Progressbar;
|
||||
25
progressbar/progressbar-tests.ts
Normal file
25
progressbar/progressbar-tests.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { Progressbar, create } from 'progressbar';
|
||||
|
||||
let str: string = '',
|
||||
progressbar: Progressbar,
|
||||
num: number = 1,
|
||||
fn: () => void = () => {};
|
||||
|
||||
progressbar = create();
|
||||
progressbar = progressbar.step(str);
|
||||
progressbar = progressbar.setStep(str);
|
||||
progressbar = progressbar.setTick(num);
|
||||
progressbar = progressbar.addTick();
|
||||
progressbar = progressbar.addTick(num);
|
||||
progressbar = progressbar.tick();
|
||||
progressbar = progressbar.tick(num);
|
||||
progressbar = progressbar.setTotal(num);
|
||||
progressbar = progressbar.total(num);
|
||||
progressbar = progressbar.addTotal();
|
||||
progressbar = progressbar.addTotal(num);
|
||||
progressbar = progressbar.finish(fn);
|
||||
|
||||
str = progressbar.getStep();
|
||||
|
||||
num = progressbar.getTick();
|
||||
num = progressbar.getTotal();
|
||||
20
progressbar/tsconfig.json
Normal file
20
progressbar/tsconfig.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"progressbar-tests.ts"
|
||||
]
|
||||
}
|
||||
1
progressbar/tslint.json
Normal file
1
progressbar/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Loading…
Reference in New Issue
Block a user