@types/listr
Advanced tools
Comparing version 0.14.0 to 0.14.1
@@ -5,2 +5,3 @@ // Type definitions for listr 0.14 | ||
// Vladislav Polyakov <https://github.com/polRk> | ||
// Jason Zukewich <https://github.com/jgzuke> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -15,39 +16,73 @@ // TypeScript Version: 2.8 | ||
declare namespace Listr { | ||
interface ListrRenderer { | ||
nonTTY: boolean; | ||
render(): void; | ||
end(): void; | ||
} | ||
type ListrContext = any; | ||
type ListrRendererValue<Ctx> = "silent" | "default" | "verbose" | ListrRendererClass<Ctx>; | ||
type ListrTaskResult<Ctx> = string | Promise<any> | Listr<Ctx> | stream.Readable | Observable<any>; | ||
interface ListrOptions { | ||
interface ListrOptions<Ctx = ListrContext> { | ||
concurrent?: boolean | number; | ||
exitOnError?: boolean; | ||
renderer?: "silent" | "default" | "verbose" | ListrRenderer; | ||
nonTTYRenderer?: "silent" | "default" | "verbose" | ListrRenderer; | ||
renderer?: ListrRendererValue<Ctx>; | ||
nonTTYRenderer?: ListrRendererValue<Ctx>; | ||
} | ||
interface ListrTask { | ||
interface ListrEvent { | ||
type: string; | ||
} | ||
interface ListrTask<Ctx = ListrContext> { | ||
title: string; | ||
task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>; | ||
skip?: (ctx: Ctx) => void | boolean | string | Promise<boolean>; | ||
enabled?: (ctx: Ctx) => boolean | Promise<boolean> | Observable<boolean>; | ||
} | ||
interface ListrTaskObject<Ctx> extends Observable<ListrEvent> { | ||
title: string; | ||
output?: string; | ||
task: (ctx: any, task: ListrTaskWrapper) => void | string | Promise<any> | stream.Readable | Listr | Observable<any>; | ||
skip?: (ctx: any, task: ListrTaskWrapper) => boolean | Promise<boolean> | string | void | Observable<boolean>; | ||
enabled?: (ctx: any, task: ListrTaskWrapper) => boolean | Promise<boolean> | Observable<boolean>; | ||
task: (ctx: Ctx, task: ListrTaskWrapper<Ctx>) => void | ListrTaskResult<Ctx>; | ||
skip: (ctx: Ctx) => void | boolean | string | Promise<boolean>; | ||
subtasks: ReadonlyArray<ListrTaskWrapper<Ctx>>; | ||
state: string; | ||
check: (ctx: Ctx) => void; | ||
hasSubtasks: boolean; | ||
isPending: boolean; | ||
isSkipped: boolean; | ||
isCompleted: boolean; | ||
isEnabled: boolean; | ||
hasFailed: boolean; | ||
run: (ctx: Ctx, wrapper: ListrTaskWrapper<Ctx>) => Promise<void>; | ||
} | ||
interface ListrTaskWrapper { | ||
interface ListrTaskWrapper<Ctx = ListrContext> { | ||
title: string; | ||
output: any; | ||
output: string; | ||
report(error: Error): void; | ||
skip(message: string): void; | ||
run(ctx?: any): Promise<any>; | ||
run(ctx?: Ctx): Promise<void>; | ||
} | ||
interface ListrError<Ctx> extends Error { | ||
context: Ctx; | ||
} | ||
interface ListrRenderer { | ||
render(): void; | ||
end(err: Error): void; | ||
} | ||
interface ListrRendererClass<Ctx> { | ||
nonTTY: boolean; | ||
new(tasks: ReadonlyArray<ListrTaskObject<Ctx>>, options: ListrOptions<Ctx>): ListrRenderer; | ||
} | ||
} | ||
declare class Listr { | ||
constructor(tasks?: ReadonlyArray<Listr.ListrTask>, options?: Listr.ListrOptions); | ||
constructor(options?: Listr.ListrOptions); | ||
add(tasks: Listr.ListrTask | ReadonlyArray<Listr.ListrTask>): void; | ||
run(ctx?: any): Promise<any>; | ||
declare class Listr<Ctx = Listr.ListrContext> { | ||
constructor(tasks?: ReadonlyArray<Listr.ListrTask<Ctx>>, options?: Listr.ListrOptions<Ctx>); | ||
constructor(options?: Listr.ListrOptions<Ctx>); | ||
tasks: ReadonlyArray<Listr.ListrTaskWrapper<Ctx>>; | ||
setRenderer(value: Listr.ListrRendererValue<Ctx>): void; | ||
add(tasks: Listr.ListrTask<Ctx> | ReadonlyArray<Listr.ListrTask<Ctx>>): void; | ||
render(): void; | ||
run(ctx?: Ctx): Promise<Ctx>; | ||
} | ||
export = Listr; |
{ | ||
"name": "@types/listr", | ||
"version": "0.14.0", | ||
"version": "0.14.1", | ||
"description": "TypeScript definitions for listr", | ||
@@ -16,2 +16,7 @@ "license": "MIT", | ||
"githubUsername": "polRk" | ||
}, | ||
{ | ||
"name": "Jason Zukewich", | ||
"url": "https://github.com/jgzuke", | ||
"githubUsername": "jgzuke" | ||
} | ||
@@ -31,4 +36,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "a214c43a46a9da09a232b57dcebe041aea6deb3a5caa003b337096984c008528", | ||
"typesPublisherContentHash": "a144069e99394740fdf4d69e4ac66fae7663701a444bd6c965d30bd790b9ff20", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for listr ( https://github.com/samverschueren/listr#readme ). | ||
This package contains type definitions for listr (https://github.com/samverschueren/listr#readme). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Tue, 30 Apr 2019 17:09:37 GMT | ||
* Last updated: Fri, 19 Jul 2019 17:51:31 GMT | ||
* Dependencies: @types/rxjs, @types/node | ||
@@ -18,2 +18,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Dusan Radovanovic <https://github.com/durad>, Vladislav Polyakov <https://github.com/polRk>. | ||
These definitions were written by Dusan Radovanovic <https://github.com/durad>, Vladislav Polyakov <https://github.com/polRk>, and Jason Zukewich <https://github.com/jgzuke>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5818
74