UNPKG

@ably/cli

Version:

Ably CLI for Pub/Sub, Chat and Spaces

37 lines (36 loc) 1.27 kB
import { Command, Interfaces } from "@oclif/core"; type PrettyPrintableError = Interfaces.PrettyPrintableError; /** * Base command class that provides interactive-mode-safe error handling. * When running in interactive mode, this class converts process.exit calls * to thrown errors that can be caught and handled gracefully. */ export declare abstract class InteractiveBaseCommand extends Command { /** * Override error to throw instead of exit in interactive mode */ error(input: string | Error, options: { code?: string; exit: false; } & PrettyPrintableError): void; error(input: string | Error, options?: { code?: string; exit?: number; } & PrettyPrintableError): never; /** * Exit is an override of oclif's exit command. * * If we're running unit tests, it does nothing, because we don't want to * quit the test process. * * If we're running in interactive mode, we want to throw instead of killing the process. * * Otherwise, defer to oclif to kill off the process. */ exit(code?: number): never; /** * Override log to ensure proper output in interactive mode */ log(message?: string, ...args: unknown[]): void; } export {};