1 | import { IMultitoolCommandFailed, IMultitoolCommandResult, IMultitoolCommandSuccess } from 'bf-types';
|
2 | import { Nullable } from '../common';
|
3 | export interface Multitool {
|
4 | /**
|
5 | * Execute one /n or /u multitool command
|
6 | *
|
7 | * @param command A string representation of a multitool command
|
8 | */
|
9 | executeCommand(command: string): Promise<IMultitoolCommandResult>;
|
10 | /**
|
11 | * Execute one or more /n or /u multitool commands
|
12 | *
|
13 | * @param commands An array of string representations of multitool commands
|
14 | */
|
15 | executeCommands(commands: string[]): Promise<IMultitoolCommandResult[]>;
|
16 | /**
|
17 | * Test whether or not a multitool command failed during execution
|
18 | *
|
19 | * @param result A result from executing a /n or /u multitool command
|
20 | */
|
21 | isCommandFailedResult(result: IMultitoolCommandResult): result is IMultitoolCommandFailed;
|
22 | /**
|
23 | * Test whether or not a multitool succeeded during execution
|
24 | *
|
25 | * @param result A result from executing a /n or /u multitool command
|
26 | */
|
27 | isCommandSuccessResult(result: IMultitoolCommandResult): result is IMultitoolCommandSuccess;
|
28 | /**
|
29 | * Run a full multitool script that uses /c type syntax
|
30 | *
|
31 | * Do not include /c in the script. /n and /u commands are not supported in
|
32 | * the scripts.
|
33 | *
|
34 | * @param script A full multitool script
|
35 | */
|
36 | runScript(script: string): Promise<Nullable<boolean>>;
|
37 | }
|