import { Plugin , CoreSetup } from 'opensearch-dashboards/server' ; export interface PluginARequestContext { ping : ( ) => Promise < string > ; } declare module 'opensearch-dashboards/server' { interface RequestHandlerContext { pluginA ? : PluginARequestContext ; } } export class CorePluginAPlugin implements Plugin { public setup ( core , deps ) { core . http . registerRouteHandlerContext ( 'pluginA' , ( context ) => { return { ping : ( ) => context . core . opensearch . legacy . client . callAsInternalUser ( 'ping' ) as Promise < string > , } ; } ) ; } public start ( ) { } public stop ( ) { } }