import { Plugin , CoreSetup } from 'kibana/public' ; export class CoreHttpPlugin implements Plugin < CoreHttpPluginSetup , CoreHttpPluginStart > { public setup ( { http } , deps ) { const tryRequestCancellation = async ( ) => { const abortController = new AbortController ( ) ; const errorNamePromise = http . get ( '/api/core_http/never_reply' , { signal : abortController . signal } ) . then ( ( ) => { return undefined ; } , ( e ) => { return e . name ; } ) ; window . setTimeout ( ( ) => { abortController . abort ( ) ; } , 100 ) ; return errorNamePromise ; } ; return { tryRequestCancellation , } ; } public start ( ) { } public stop ( ) { } } export type CoreHttpPluginSetup = ReturnType < CoreHttpPlugin [ 'setup' ] > ; export type CoreHttpPluginStart = ReturnType < CoreHttpPlugin [ 'start' ] > ;