Comparing version 0.4.11 to 0.4.12
@@ -1,5 +0,84 @@ | ||
declare function createProgram(): import("./program").Program; | ||
export { Context, NextFunction } from './Layer'; | ||
export { Terminal } from './Terminal'; | ||
declare function createProgram(): Program; | ||
export interface Params { | ||
command: string; | ||
subCommands: string[]; | ||
flags: Map<string, string | number | boolean>; | ||
} | ||
export interface Context { | ||
params: Params; | ||
session: { | ||
[key: string]: any; | ||
}; | ||
} | ||
export declare type NextFunctionError = (error?: Error) => void; | ||
export declare type NextFunctionSuccess = () => void; | ||
export declare type NextFunction = NextFunctionSuccess | NextFunctionError; | ||
export declare type CommandFunction = (context: Context, terminal: Terminal, nextFunction: NextFunction) => void | Promise<void>; | ||
export declare type CommandErrorFunction = (context: Context, terminal: Terminal, nextFunction: NextFunctionError, error: Error) => void; | ||
export interface OptionsLayer { | ||
subCommands: string[]; | ||
notInCommands: string[]; | ||
} | ||
export interface ILayer { | ||
match(command: string): boolean; | ||
} | ||
/** | ||
* To Create Layer | ||
* @param handle (function) | ||
* @param next (function) | ||
* @param notInCommandList (boolean) | ||
* @param command (function) | ||
` */ | ||
declare class Layer implements ILayer { | ||
private readonly name; | ||
handle?: CommandFunction; | ||
handleError?: CommandErrorFunction; | ||
private command; | ||
private notInCommand; | ||
private baseMathSetting; | ||
constructor(command: string | undefined, options: OptionsLayer, executor: CommandFunction | CommandErrorFunction); | ||
match(command: string): boolean; | ||
} | ||
export { Layer }; | ||
export { createProgram }; | ||
export default createProgram; | ||
export interface OptionsAsk { | ||
hidden: boolean; | ||
} | ||
interface Terminal { | ||
log(...args: unknown[]): Terminal; | ||
error(title: string, lines: string[]): Terminal; | ||
table(...args: unknown[]): Terminal; | ||
ask(question: string, optionsAsk?: OptionsAsk): Promise<string>; | ||
loading(text: string): { | ||
changeText(textChange: string): void; | ||
stop(): void; | ||
changeColor(color: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray'): void; | ||
succeed(textSuccess: string): void; | ||
fail(textFail: string): void; | ||
}; | ||
end(): void; | ||
} | ||
declare const terminal: Terminal; | ||
export { terminal, Terminal }; | ||
export interface Program { | ||
session: { | ||
[key: string]: unknown; | ||
}; | ||
params: Params; | ||
stack: Layer[]; | ||
parseArguments(args: string[]): void; | ||
lazyStack(promises: Promise<unknown>[]): Generator<unknown, void>; | ||
init(): void; | ||
start(): void; | ||
start(callback: () => void): void; | ||
use(...fn: (CommandFunction | CommandErrorFunction)[]): void; | ||
use(command: string, ...fn: (CommandFunction | CommandErrorFunction)[]): void; | ||
use(commands: string[], ...fn: (CommandFunction | CommandErrorFunction)[]): void; | ||
use(command: { | ||
notIn: string[]; | ||
}, ...fn: (CommandFunction | CommandErrorFunction)[]): void; | ||
} | ||
declare const program: Program; | ||
export { program }; |
{ | ||
"name": "cowmand", | ||
"version": "0.4.11", | ||
"version": "0.4.12", | ||
"description": "Fast helper to create a cli", | ||
@@ -5,0 +5,0 @@ "tags": [ |
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
17003
8
371