@@ -316,7 +316,8 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
316316 * @returns A promise that will resolve with `true` if all events are sent before the timeout, or `false` if there are
317317 * still events in the queue when the timeout is reached.
318318 */
319- public async flush ( timeout ?: number ) : Promise < boolean > {
319+ // @ts -expect-error - PromiseLike is a subset of Promise
320+ public async flush ( timeout ?: number ) : PromiseLike < boolean > {
320321 const transport = this . _transport ;
321322 if ( ! transport ) {
322323 return Promise . resolve ( true ) ;
@@ -338,7 +339,8 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
338339 * @returns {Promise<boolean> } A promise which resolves to `true` if the flush completes successfully before the timeout, or `false` if
339340 * it doesn't.
340341 */
341- public async close ( timeout ?: number ) : Promise < boolean > {
342+ // @ts -expect-error - PromiseLike is a subset of Promise
343+ public async close ( timeout ?: number ) : PromiseLike < boolean > {
342344 const result = await this . flush ( timeout ) ;
343345 this . getOptions ( ) . enabled = false ;
344346 this . emit ( 'close' ) ;
@@ -873,7 +875,8 @@ export abstract class Client<O extends ClientOptions = ClientOptions> {
873875 /**
874876 * Send an envelope to Sentry.
875877 */
876- public async sendEnvelope ( envelope : Envelope ) : Promise < TransportMakeRequestResponse > {
878+ // @ts -expect-error - PromiseLike is a subset of Promise
879+ public async sendEnvelope ( envelope : Envelope ) : PromiseLike < TransportMakeRequestResponse > {
877880 this . emit ( 'beforeEnvelope' , envelope ) ;
878881
879882 if ( ! this . _isEnabled ( ) || ! this . _transport ) {
0 commit comments