import { Command , HandlerOptions , HandlerApp } from '../types' ; export function withPromise ( command ) { let resolve ; const promise = new Promise < HandlerOptions | HandlerApp > ( ( _resolve ) => { resolve = _resolve ; } ) ; command . handler = function ( x ) { resolve ( x ) ; } ; return promise as Promise < HandlerOptions | HandlerApp > ; }