import { Readable } from 'stream' ; import { CloseEvent , Command , CommandIdentifier , TimerEvent } from './command' ; import { concurrently , ConcurrentlyCommandInput , ConcurrentlyOptions as BaseConcurrentlyOptions , ConcurrentlyResult } from './concurrently' ; import { FlowController } from './flow-control/flow-controller' ; import { InputHandler } from './flow-control/input-handler' ; import { KillOnSignal } from './flow-control/kill-on-signal' ; import { KillOthers , ProcessCloseCondition } from './flow-control/kill-others' ; import { LogError } from './flow-control/log-error' ; import { LogExit } from './flow-control/log-exit' ; import { LogOutput } from './flow-control/log-output' ; import { LogTimings } from './flow-control/log-timings' ; import { RestartProcess } from './flow-control/restart-process' ; import { Logger } from './logger' ; export type ConcurrentlyOptions = BaseConcurrentlyOptions & { /**
     * Which command(s) should have their output hidden.
     */ hide ? : CommandIdentifier | CommandIdentifier [ ] ; /**
     * The prefix format to use when logging a command's output.
     * Defaults to the command's index.
     */ prefix ? : string ; /**
     * How many characters should a prefix have at most, used when the prefix format is `command`.
     */ prefixLength ? : number ; /**
     * Whether output should be formatted to include prefixes and whether "event" logs will be logged.
     */ raw ? : boolean ; see https timestampFormat ? : string ; defaultInputTarget ? : CommandIdentifier ; inputStream ? : Readable ; handleInput ? : boolean ; pauseInputStreamOnFinish ? : boolean ; see RestartProcess restartDelay ? : number ; see RestartProcess restartTries ? : number ; see KillOthers killOthers ? : ProcessCloseCondition | ProcessCloseCondition [ ] ; see LogTimings timings ? : boolean ; } ; export default ( commands , options = { } ) => { const logger = new Logger ( { hide : options . hide , prefixFormat : options . prefix , prefixLength : options . prefixLength , raw : options . raw , timestampFormat : options . timestampFormat , } ) ; return concurrently ( commands , { maxProcesses : options . maxProcesses , raw : options . raw , successCondition : options . successCondition , cwd : options . cwd , logger , outputStream : options . outputStream || process . stdout , group : options . group , controllers : [ new LogError ( { logger } ) , new LogOutput ( { logger } ) , new LogExit ( { logger } ) , new InputHandler ( { logger , defaultInputTarget : options . defaultInputTarget , inputStream : options . inputStream || ( options . handleInput && process . stdin ) , pauseInputStreamOnFinish : options . pauseInputStreamOnFinish , } ) , new KillOnSignal ( { process } ) , new RestartProcess ( { logger , delay : options . restartDelay , tries : options . restartTries , } ) , new KillOthers ( { logger , conditions : options . killOthers } ) , new LogTimings ( { logger : options . timings ? logger : null , timestampFormat : options . timestampFormat , } ) ] , prefixColors : options . prefixColors || [ ] , } ) ; } ; export { concurrently , ConcurrentlyCommandInput , ConcurrentlyResult , Logger , Command , CloseEvent , TimerEvent , CommandIdentifier , FlowController , InputHandler , KillOnSignal , KillOthers , LogError , LogExit , LogOutput , LogTimings , RestartProcess , } ;