UNPKG

uploadthing

Version:

Learn more: [docs.uploadthing.com](https://docs.uploadthing.com)

34 lines (30 loc) 1.44 kB
import * as h3 from 'h3'; import { H3Event } from 'h3'; import * as __internal_types from '../internal/types.js'; export { UTFiles } from '../internal/types.js'; import * as _uploadthing_shared from '@uploadthing/shared'; import { Json, UploadThingError } from '@uploadthing/shared'; import { FileRouter, RouteHandlerOptions } from '../types/index.js'; export { FileRouter } from '../types/index.js'; type CreateBuilderOptions<TErrorShape extends Json> = { errorFormatter: (err: UploadThingError) => TErrorShape; }; type AdapterArgs = { req: undefined; res: undefined; event: H3Event; }; declare const createUploadthing: <TErrorShape extends Json>(opts?: CreateBuilderOptions<TErrorShape>) => <TRouteOptions extends _uploadthing_shared.RouteOptions>(input: _uploadthing_shared.FileRouterInputConfig, config?: TRouteOptions | undefined) => __internal_types.UploadBuilder<{ _routeOptions: TRouteOptions; _input: { in: __internal_types.UnsetMarker; out: __internal_types.UnsetMarker; }; _metadata: __internal_types.UnsetMarker; _adapterFnArgs: AdapterArgs; _errorShape: TErrorShape; _errorFn: __internal_types.UnsetMarker; _output: __internal_types.UnsetMarker; }>; declare const createRouteHandler: <TRouter extends FileRouter>(opts: RouteHandlerOptions<TRouter>) => h3.EventHandler<h3.EventHandlerRequest, Promise<Response>>; export { createRouteHandler, createUploadthing };