@nu-art/commando
Version:
36 lines (35 loc) • 1.6 kB
TypeScript
import { BaseCommando } from '../core/BaseCommando';
import { CliBlock } from '../types';
export declare class Commando_Programming extends BaseCommando {
/**
* Constructs an if-else conditional command structure.
* @param {string} condition - The condition for the if statement.
* @param {CliBlock} ifBlock - Block of commands to execute if the condition is true.
* @param {CliBlock} [elseBlock] - Optional block of commands to execute if the condition is false.
* @returns {this} - The Cli instance for method chaining.
*/
if(condition: string, ifBlock: CliBlock<this>, elseBlock?: CliBlock<this>): this;
/**
* Constructs a for loop command structure.
* @param {string} varName - The variable name used in the loop.
* @param {string | string[]} arrayNameOrValues - The array name or array of values to iterate over.
* @param {CliBlock} loop - Block of commands to execute in each iteration of the loop.
* @returns {this} - The Cli instance for method chaining.
*/
for(varName: string, arrayNameOrValues: string | string[], loop: CliBlock<this>): this;
/**
* Appends a 'continue' command for loop control.
* @returns {this} - The Cli instance for method chaining.
*/
continue(): this;
/**
* Appends a 'break' command for loop control.
* @returns {this} - The Cli instance for method chaining.
*/
break(): this;
/**
* Appends a 'return' command for exiting a function or script.
* @returns {this} - The Cli instance for method chaining.
*/
return(): this;
}