import { Plugin , CoreSetup } from 'kibana/public' ; export class CoreAppLeavePlugin implements Plugin < CoreAppLeavePluginSetup , CoreAppLeavePluginStart > { public setup ( core , deps ) { core . application . register ( { id : 'appleave1' , title : 'AppLeave 1' , async mount ( params ) { const { renderApp } = await import ( './application' ) ; params . onAppLeave ( ( actions ) => actions . confirm ( 'confirm-message' , 'confirm-title' ) ) ; return renderApp ( 'AppLeave 1' , params ) ; } , } ) ; core . application . register ( { id : 'appleave2' , title : 'AppLeave 2' , async mount ( params ) { const { renderApp } = await import ( './application' ) ; params . onAppLeave ( ( actions ) => actions . default ( ) ) ; return renderApp ( 'AppLeave 2' , params ) ; } , } ) ; return { } ; } public start ( ) { } public stop ( ) { } } export type CoreAppLeavePluginSetup = ReturnType < CoreAppLeavePlugin [ 'setup' ] > ; export type CoreAppLeavePluginStart = ReturnType < CoreAppLeavePlugin [ 'start' ] > ;