import type { ServerResponse } from 'node:http'; import type { Context, Next } from 'koa'; import { type GraphQLOperation, type IncomingReq, type UploadOptions } from './process-request'; type ProcessRequestFn = (req: IncomingReq, res: Pick, options?: UploadOptions) => Promise; export interface GraphqlUploadKoaOptions extends UploadOptions { processRequest?: ProcessRequestFn; } /** * Creates Koa middleware for handling GraphQL multipart requests (file uploads). * This middleware processes multipart/form-data requests and converts them into a format * that GraphQL servers can understand. * * @example Basic setup with Apollo Server Koa * ```typescript * import Koa from 'koa'; * import { graphqlUploadKoa } from 'graphql-upload-ts'; * import { ApolloServer } from '@apollo/server'; * import { koaMiddleware } from '@as-integrations/koa'; * * const app = new Koa(); * * app.use( * graphqlUploadKoa({ * maxFileSize: 10_000_000, // 10MB * maxFiles: 10 * }) * ); * * // Apollo Server setup continues... * ``` */ export declare function graphqlUploadKoa(options?: GraphqlUploadKoaOptions): (ctx: Context, next: Next) => Promise; export {}; //# sourceMappingURL=graphql-upload-koa.d.ts.map