import { TransportRequestPromise } from '@elastic/elasticsearch/lib/Transport' ; internal param promise param signal returns export const shimAbortSignal = < T extends TransportRequestPromise < unknown > > ( promise , signal ) : T => { if ( signal ) { signal . addEventListener ( 'abort' , ( ) => promise . abort ( ) ) ; } return promise ; } ;