import { Hono } from 'hono'; import { U as UploadOptions } from "../../../packem_shared/types.d-D6Jkz0Sp.js"; import { U as UploadFile } from "../../../packem_shared/storage.d-C9EdfTf1.js"; import 'node:events'; import 'node:http'; import 'node:stream'; import '@visulima/pagination'; import "../../../packem_shared/media-transformer.d-Co37isNg.js"; import "../../../packem_shared/types.d-D1TIRqKW.js"; import 'node:timers'; 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 { createHonoHandler } from "@visulima/storage/handler/http/hono"; * * const app = new Hono(); * const storage = new DiskStorage({ directory: "./uploads" }); * * // Multipart handler - automatically registers POST, GET, DELETE, OPTIONS * createHonoHandler(app, { * path: "/files", * storage, * type: "multipart" * }); * ``` * @example * ```ts * import { Hono } from "hono"; * import { DiskStorage } from "@visulima/storage"; * import { createHonoHandler } 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 * createHonoHandler(app, { * path: "/files-rest", * storage, * type: "rest" * }); * ``` * @example * ```ts * import { Hono } from "hono"; * import { DiskStorage } from "@visulima/storage"; * import { createHonoHandler } 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 * createHonoHandler(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 };