import { Hono } from 'hono'; import { U as UploadOptions } from "../../../packem_shared/types.d-BeCD21R_.js"; import { U as UploadFile } from "../../../packem_shared/storage.d-Cnjmzau5.js"; import 'node:events'; import 'node:http'; import 'node:stream'; import '@visulima/pagination'; import "../../../packem_shared/media-transformer.d-2MuwlsDB.js"; import "../../../packem_shared/types.d-JKMJy3u9.js"; import "../../../packem_shared/types.d-DFh9698o.js"; import 'node:crypto'; import 'lru-cache'; /** * Registers upload handler routes on a Hono app instance. * Automatically registers all required HTTP methods for the specified handler type. * @param app Hono app instance to register routes on * @param config Handler configuration including storage, type, and path * @example * ```ts * import { Hono } from "hono"; * import { DiskStorage } from "@visulima/storage"; * import { createStorageHandler } from "@visulima/storage/handler/http/hono"; * * const app = new Hono(); * const storage = new DiskStorage({ directory: "./uploads" }); * * // Multipart handler - automatically registers POST, GET, DELETE, OPTIONS * createStorageHandler(app, { * path: "/files", * storage, * type: "multipart" * }); * ``` * @example * ```ts * import { Hono } from "hono"; * import { DiskStorage } from "@visulima/storage"; * import { createStorageHandler } from "@visulima/storage/handler/http/hono"; * * const app = new Hono(); * const storage = new DiskStorage({ directory: "./uploads" }); * * // REST handler - automatically registers POST, PUT, PATCH, GET, HEAD, DELETE, OPTIONS * createStorageHandler(app, { * path: "/files-rest", * storage, * type: "rest" * }); * ``` * @example * ```ts * import { Hono } from "hono"; * import { DiskStorage } from "@visulima/storage"; * import { createStorageHandler } from "@visulima/storage/handler/http/hono"; * * const app = new Hono(); * const storage = new DiskStorage({ directory: "./uploads" }); * * // TUS handler - automatically registers POST, PATCH, HEAD, GET, DELETE, OPTIONS * createStorageHandler(app, { * path: "/files-tus", * storage, * type: "tus" * }); * ``` */ declare const createStorageHandler: (app: Hono, config: HonoHandlerConfig) => void; /** * Configuration for Hono handler. */ interface HonoHandlerConfig extends UploadOptions { /** Base path for the routes (e.g., "/files" or "/api/upload") */ path: string; /** Handler type to use */ type: "multipart" | "rest" | "tus"; } export { HonoHandlerConfig, createStorageHandler };