async function webpackDevMiddleware(context, next) {
    const { req, res } = context;

    context.set("webpack", { devMiddleware: devMiddleware.context });

    /**
     * @returns {string | undefined} method
     */
    req.getMethod = () => context.req.method;

    /**
     * @param {string} name name
     * @returns {string | string[] | undefined} header value
     */
    req.getHeader = (name) => context.req.header(name);

    /**
     * @returns {string | undefined} URL
     */
    req.getURL = () => context.req.url;

    let { status } = context.res;

    /**
     * @returns {number} code code
     */
    res.getStatusCode = () => status;

    /**
     * @param {number} code code
     */
    res.setStatusCode = (code) => {
      status = code;
    };

    /**
     * @param {string} name header name
     * @returns {string | string[] | undefined} header
     */
    res.getHeader = (name) => context.res.headers.get(name);

    // eslint-disable-next-line jsdoc/no-restricted-syntax
    /**
     * @param {string} name header name
     * @param {string | number | Readonly<string[]>} value value
     * @returns {ResponseInternal & import("./utils/compatibleAPI").ExpectedServerResponse & { headers: any, status: any }} response
     */
    res.setHeader = (name, value) => {
      context.res.headers.append(name, value);
      return context.res;
    };

    /**
     * @param {string} name header name
     */
    res.removeHeader = (name) => {
      context.res.headers.delete(name);
    };

    /**
     * @returns {string[]} response headers
     */
    res.getResponseHeaders = () => [...context.res.headers.keys()];

    /**
     * @returns {ServerResponse} server response
     */
    res.getOutgoing = () => context.env.outgoing;

    res.setState = () => {
      // Do nothing, because we set it before
    };

    res.getReadyReadableStreamState = () => "readable";

    res.getHeadersSent = () => context.env.outgoing.headersSent;

    let body;

    try {
      await new Promise(
        /**
         * @param {(value: void) => void} resolve resolve
         * @param {(reason?: Error) => void} reject reject
         */
        (resolve, reject) => {
          /**
           * @param {import("fs").ReadStream} stream readable stream
           */
          res.stream = (stream) => {
            body = stream;
            // responseHandler(stream);
          };

          /**
           * @param {string | Buffer} data data
           */
          res.send = (data) => {
            // Hono sets `Content-Length` by default
            context.res.headers.delete("Content-Length");

            body = data;
          };

          /**
           * @param {(string | Buffer)=} data data
           */
          res.finish = (data) => {
            const isDataExist = typeof data !== "undefined";

            // Hono sets `Content-Length` by default
            if (isDataExist) {
              context.res.headers.delete("Content-Length");
            }

            body = isDataExist ? data : null;
          };

          devMiddleware(req, res, (err) => {
            if (err) {
              reject(err);
              return;
            }

            resolve();
          });
        },
      );
    } catch (err) {
      context.status(500);

      return context.json({ message: /** @type {Error} */ (err).message });
    }

    if (typeof body !== "undefined") {
      return context.body(body, status);
    }

    await next();
  }
@param {{ env: any, body: any, json: any, status: any, set: any, req: RequestInternal & import("./utils/compatibleAPI").ExpectedIncomingMessage & { header: (name: string) => string }, res: ResponseInternal & import("./utils/compatibleAPI").ExpectedServerResponse & { headers: any, status: any } }} context context
@param {Function} next next function
@returns {Promise<void>}