@fly/sprites
Version:
JavaScript/TypeScript SDK for Sprites - remote command execution
35 lines • 888 B
JavaScript
/**
* Type definitions for the Sprites JavaScript SDK
*/
/**
* Stream ID for the binary protocol
*/
export var StreamID;
(function (StreamID) {
StreamID[StreamID["Stdin"] = 0] = "Stdin";
StreamID[StreamID["Stdout"] = 1] = "Stdout";
StreamID[StreamID["Stderr"] = 2] = "Stderr";
StreamID[StreamID["Exit"] = 3] = "Exit";
StreamID[StreamID["StdinEOF"] = 4] = "StdinEOF";
})(StreamID || (StreamID = {}));
/**
* Error thrown when a command exits with a non-zero code
*/
export class ExecError extends Error {
result;
constructor(message, result) {
super(message);
this.result = result;
this.name = 'ExecError';
}
get exitCode() {
return this.result.exitCode;
}
get stdout() {
return this.result.stdout;
}
get stderr() {
return this.result.stderr;
}
}
//# sourceMappingURL=types.js.map