@synet/net
Version:
Network abstraction layer for Synet. visit https://syntehtism.ai for more information.
24 lines (23 loc) • 739 B
TypeScript
import type { Result } from "@synet/patterns";
export interface CommandExecutionResult {
stdout: string;
stderr: string;
exitCode: number;
}
/**
* Interface for executing system commands
*/
export interface CommandExecutor {
/**
* Execute a system command
* @param command Command to execute
* @param args Command arguments
*/
execute(command: string, args?: string[], sudo?: boolean | true): Promise<Result<CommandExecutionResult>>;
/**
* Execute a system command as superuser
* @param command Command to execute
* @param args Command arguments
*/
executeAsSuperuser(command: string, args?: string[], sudo?: boolean | true): Promise<Result<CommandExecutionResult>>;
}