import { ClientsImplementation , IOClients , } from '../../../../../clients/IOClients' ; import { InstanceOptions } from '../../../../../HttpClient' ; import { ParamsContext , RecorderState , ServiceContext } from '../../typings' ; export function clients < T extends IOClients , U extends RecorderState , V extends ParamsContext > ( ClientsImpl , clientOptions ) { return async function withClients ( ctx , next ) { if ( ctx . serverTiming ) { ctx . vtex . serverTiming = ctx . serverTiming ; } ctx . clients = new ClientsImpl ( clientOptions , ctx . vtex ) ; await next ( ) ; } ; }