Sylvain Filoni
update gradio client
9ada4bc
raw
history blame contribute delete
571 Bytes
import { RequestController } from './RequestController'
export type InteractiveRequest = globalThis.Request & {
respondWith: RequestController['respondWith']
}
export function toInteractiveRequest(request: Request): {
interactiveRequest: InteractiveRequest
requestController: RequestController
} {
const requestController = new RequestController(request)
Reflect.set(
request,
'respondWith',
requestController.respondWith.bind(requestController)
)
return {
interactiveRequest: request as InteractiveRequest,
requestController,
}
}