import { Temporal } from 'temporal-spec'; import { version } from '../package.json'; /** * An interface that exposes some basic information about the * adapter like its name and provider type. */ declare interface AdapterInfo { readonly provider: Provider; readonly adapterName: (typeof officialPrismaAdapters)[number] | (string & {}); } declare type AddDollar = `$${Lowercase}`; declare type AddParam = ParamKeys

extends never ? I : I extends { param: infer _; } ? I : I & { param: UnionToIntersection>>; }; /** * Entry point for the application logic. */ declare class App { #private; constructor(db: SqlDriverAdapter, transactionManager: TransactionManager, tracingHandler: TracingHandler); /** * Connects to the database and initializes the application logic. */ static start(options: Options): Promise; /** * Cancels all active transactions and disconnects from the database. */ shutdown(): Promise; /** * Executes a query plan and returns the result. * * @param queryPlan - The query plan to execute * @param placeholderValues - Placeholder values for the query * @param comments - Pre-computed SQL commenter tags from the client * @param resourceLimits - Resource limits for the query * @param transactionId - Transaction ID if running within a transaction */ query(queryPlan: QueryPlanNode, placeholderValues: Record, comments: Record | undefined, resourceLimits: ResourceLimits, transactionId: string | null): Promise; /** * Starts a new transaction. */ startTransaction(options: TransactionOptions_2, resourceLimits: ResourceLimits): Promise; /** * Commits a transaction. */ commitTransaction(transactionId: string): Promise; /** * Rolls back a transaction. */ rollbackTransaction(transactionId: string): Promise; /** * Retrieves connection information necessary for building the queries. */ getConnectionInfo(): { provider: Provider; connectionInfo: ConnectionInfo; }; } declare type ArgScalarType = 'string' | 'int' | 'bigint' | 'float' | 'decimal' | 'boolean' | 'enum' | 'uuid' | 'json' | 'datetime' | 'bytes' | 'unknown'; declare type ArgType = { scalarType: ArgScalarType; dbType?: string; arity: Arity; }; declare type Arity = 'scalar' | 'list'; /** * Attributes is a map from string to attribute values. * * Note: only the own enumerable keys are counted as valid attribute keys. */ declare interface Attributes { [attributeKey: string]: AttributeValue | undefined; } /** * Attribute values may be any non-nullish primitive value except an object. * * null or undefined attribute values are invalid and will result in undefined behavior. */ declare type AttributeValue = string | number | boolean | Array | Array | Array; /** * Union types for BaseMime */ declare type BaseMime = (typeof _baseMimes)[keyof typeof _baseMimes]; declare const _baseMimes: { readonly aac: "audio/aac"; readonly avi: "video/x-msvideo"; readonly avif: "image/avif"; readonly av1: "video/av1"; readonly bin: "application/octet-stream"; readonly bmp: "image/bmp"; readonly css: "text/css"; readonly csv: "text/csv"; readonly eot: "application/vnd.ms-fontobject"; readonly epub: "application/epub+zip"; readonly gif: "image/gif"; readonly gz: "application/gzip"; readonly htm: "text/html"; readonly html: "text/html"; readonly ico: "image/x-icon"; readonly ics: "text/calendar"; readonly jpeg: "image/jpeg"; readonly jpg: "image/jpeg"; readonly js: "text/javascript"; readonly json: "application/json"; readonly jsonld: "application/ld+json"; readonly map: "application/json"; readonly mid: "audio/x-midi"; readonly midi: "audio/x-midi"; readonly mjs: "text/javascript"; readonly mp3: "audio/mpeg"; readonly mp4: "video/mp4"; readonly mpeg: "video/mpeg"; readonly oga: "audio/ogg"; readonly ogv: "video/ogg"; readonly ogx: "application/ogg"; readonly opus: "audio/opus"; readonly otf: "font/otf"; readonly pdf: "application/pdf"; readonly png: "image/png"; readonly rtf: "application/rtf"; readonly svg: "image/svg+xml"; readonly tif: "image/tiff"; readonly tiff: "image/tiff"; readonly ts: "video/mp2t"; readonly ttf: "font/ttf"; readonly txt: "text/plain"; readonly wasm: "application/wasm"; readonly webm: "video/webm"; readonly weba: "audio/webm"; readonly webmanifest: "application/manifest+json"; readonly webp: "image/webp"; readonly woff: "font/woff"; readonly woff2: "font/woff2"; readonly xhtml: "application/xhtml+xml"; readonly xml: "application/xml"; readonly zip: "application/zip"; readonly '3gp': "video/3gpp"; readonly '3g2': "video/3gpp2"; readonly gltf: "model/gltf+json"; readonly glb: "model/gltf-binary"; }; declare type Bindings = object; declare type BlankInput = {}; declare type BlankSchema = {}; declare type Body_2 = { json: any; text: string; arrayBuffer: ArrayBuffer; blob: Blob; formData: FormData; }; declare type BodyCache = Partial; declare type BodyData = {}> = SimplifyBodyData>>; declare type BodyDataValue = BodyDataValueComponent | (T extends { dot: false; } ? never : T extends { dot: true; } | { dot: boolean; } ? BodyDataValueObject : never); declare type BodyDataValueComponent = string | File | (T extends { all: false; } ? never : T extends { all: true; } | { all: boolean; } ? (string | File)[] : never); declare type BodyDataValueDot = { [x: string]: string | File | BodyDataValueDot; }; declare type BodyDataValueDotAll = { [x: string]: string | File | (string | File)[] | BodyDataValueDotAll; }; declare type BodyDataValueObject = { [key: string]: BodyDataValueComponent | BodyDataValueObject; }; /** * Interface for responding with a body. */ declare interface BodyRespond { (data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; (data: T, init?: ResponseOrInit): Response & TypedResponse; (data: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; (data: T, init?: ResponseOrInit): Response & TypedResponse; } declare type ChangePathOfSchema = keyof S extends never ? { [K in Path]: {}; } : { [K in keyof S as Path]: S[K]; }; declare type ClientErrorStatusCode = 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 421 | 422 | 423 | 424 | 425 | 426 | 428 | 429 | 431 | 451; declare type ColumnType = (typeof ColumnTypeEnum)[keyof typeof ColumnTypeEnum]; declare const ColumnTypeEnum: { readonly Int32: 0; readonly Int64: 1; readonly Float: 2; readonly Double: 3; readonly Numeric: 4; readonly Boolean: 5; readonly Character: 6; readonly Text: 7; readonly Date: 8; readonly Time: 9; readonly DateTime: 10; readonly Json: 11; readonly Enum: 12; readonly Bytes: 13; readonly Set: 14; readonly Uuid: 15; readonly Int32Array: 64; readonly Int64Array: 65; readonly FloatArray: 66; readonly DoubleArray: 67; readonly NumericArray: 68; readonly BooleanArray: 69; readonly CharacterArray: 70; readonly TextArray: 71; readonly DateArray: 72; readonly TimeArray: 73; readonly DateTimeArray: 74; readonly JsonArray: 75; readonly EnumArray: 76; readonly BytesArray: 77; readonly UuidArray: 78; readonly UnknownNumber: 128; }; declare type ConnectionInfo = { schemaName?: string; maxBindValues?: number; supportsRelationJoins: boolean; }; /** * Log level options accepted by the console logger. */ export declare type ConsoleLogLevel = LogLevel | 'off'; declare type ContentfulStatusCode = Exclude; declare type ContentlessStatusCode = 101 | 204 | 205 | 304; declare interface Context { /** * Get a value from the context. * * @param key key which identifies a context value */ getValue(key: symbol): unknown; /** * Create a new context which inherits from this context and has * the given key set to the given value. * * @param key context key for which to set the value * @param value value to set for the given key */ setValue(key: symbol, value: unknown): Context; /** * Return a new context which inherits from this context but does * not contain a value for the given key. * * @param key context key for which to clear a value */ deleteValue(key: symbol): Context; } declare class Context_2 { /** * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers. * * @see {@link https://hono.dev/docs/api/context#env} * * @example * ```ts * // Environment object for Cloudflare Workers * app.get('*', async c => { * const counter = c.env.COUNTER * }) * ``` */ env: E['Bindings']; finalized: boolean; /** * `.error` can get the error object from the middleware if the Handler throws an error. * * @see {@link https://hono.dev/docs/api/context#error} * * @example * ```ts * app.use('*', async (c, next) => { * await next() * if (c.error) { * // do something... * } * }) * ``` */ error: Error | undefined; /** * Creates an instance of the Context class. * * @param req - The Request object. * @param options - Optional configuration options for the context. */ constructor(req: Request, options?: ContextOptions); /** * `.req` is the instance of {@link HonoRequest}. */ get req(): HonoRequest; /** * @see {@link https://hono.dev/docs/api/context#event} * The FetchEvent associated with the current request. * * @throws Will throw an error if the context does not have a FetchEvent. */ get event(): FetchEventLike; /** * @see {@link https://hono.dev/docs/api/context#executionctx} * The ExecutionContext associated with the current request. * * @throws Will throw an error if the context does not have an ExecutionContext. */ get executionCtx(): ExecutionContext; /** * @see {@link https://hono.dev/docs/api/context#res} * The Response object for the current request. */ get res(): Response; /** * Sets the Response object for the current request. * * @param _res - The Response object to set. */ set res(_res: Response | undefined); /** * `.render()` can create a response within a layout. * * @see {@link https://hono.dev/docs/api/context#render-setrenderer} * * @example * ```ts * app.get('/', (c) => { * return c.render('Hello!') * }) * ``` */ render: Renderer; /** * Sets the layout for the response. * * @param layout - The layout to set. * @returns The layout function. */ setLayout: (layout: Layout) => Layout; /** * Gets the current layout for the response. * * @returns The current layout function. */ getLayout: () => Layout | undefined; /** * `.setRenderer()` can set the layout in the custom middleware. * * @see {@link https://hono.dev/docs/api/context#render-setrenderer} * * @example * ```tsx * app.use('*', async (c, next) => { * c.setRenderer((content) => { * return c.html( * * *

{content}

* * * ) * }) * await next() * }) * ``` */ setRenderer: (renderer: Renderer) => void; /** * `.header()` can set headers. * * @see {@link https://hono.dev/docs/api/context#header} * * @example * ```ts * app.get('/welcome', (c) => { * // Set headers * c.header('X-Message', 'Hello!') * c.header('Content-Type', 'text/plain') * * return c.body('Thank you for coming') * }) * ``` */ header: SetHeaders; status: (status: StatusCode) => void; /** * `.set()` can set the value specified by the key. * * @see {@link https://hono.dev/docs/api/context#set-get} * * @example * ```ts * app.use('*', async (c, next) => { * c.set('message', 'Hono is hot!!') * await next() * }) * ``` */ set: Set_2 extends true ? { Variables: ContextVariableMap & Record; } : E>; /** * `.get()` can use the value specified by the key. * * @see {@link https://hono.dev/docs/api/context#set-get} * * @example * ```ts * app.get('/', (c) => { * const message = c.get('message') * return c.text(`The message is "${message}"`) * }) * ``` */ get: Get extends true ? { Variables: ContextVariableMap & Record; } : E>; /** * `.var` can access the value of a variable. * * @see {@link https://hono.dev/docs/api/context#var} * * @example * ```ts * const result = c.var.client.oneMethod() * ``` */ get var(): Readonly extends true ? Record : E['Variables'])>; newResponse: NewResponse; /** * `.body()` can return the HTTP response. * You can set headers with `.header()` and set HTTP status code with `.status`. * This can also be set in `.text()`, `.json()` and so on. * * @see {@link https://hono.dev/docs/api/context#body} * * @example * ```ts * app.get('/welcome', (c) => { * // Set headers * c.header('X-Message', 'Hello!') * c.header('Content-Type', 'text/plain') * // Set HTTP status code * c.status(201) * * // Return the response body * return c.body('Thank you for coming') * }) * ``` */ body: BodyRespond; /** * `.text()` can render text as `Content-Type:text/plain`. * * @see {@link https://hono.dev/docs/api/context#text} * * @example * ```ts * app.get('/say', (c) => { * return c.text('Hello!') * }) * ``` */ text: TextRespond; /** * `.json()` can render JSON as `Content-Type:application/json`. * * @see {@link https://hono.dev/docs/api/context#json} * * @example * ```ts * app.get('/api', (c) => { * return c.json({ message: 'Hello!' }) * }) * ``` */ json: JSONRespond; html: HTMLRespond; /** * `.redirect()` can Redirect, default status code is 302. * * @see {@link https://hono.dev/docs/api/context#redirect} * * @example * ```ts * app.get('/redirect', (c) => { * return c.redirect('/') * }) * app.get('/redirect-permanently', (c) => { * return c.redirect('/', 301) * }) * ``` */ redirect: (location: string | URL, status?: T) => Response & TypedResponse; /** * `.notFound()` can return the Not Found Response. * * @see {@link https://hono.dev/docs/api/context#notfound} * * @example * ```ts * app.get('/notfound', (c) => { * return c.notFound() * }) * ``` */ notFound: () => Response | Promise; } /** * Options for configuring the context. * * @template E - Environment type. */ declare type ContextOptions = { /** * Bindings for the environment. */ env: E['Bindings']; /** * Execution context for the request. */ executionCtx?: FetchEventLike | ExecutionContext | undefined; /** * Handler for not found responses. */ notFoundHandler?: NotFoundHandler; matchResult?: Result<[H, RouterRoute]>; path?: string; }; /** * Interface for context renderer. */ declare interface ContextRenderer { } /** * Interface for context variable mapping. */ declare interface ContextVariableMap { } /** * Creates a logger that keeps log events with a level greater than or equal * to {@link logLevel} and outputs them to console using format {@link logFormat}. * When `logLevel` is `'off'`, all log events are dropped. */ export declare function createConsoleLogger(logFormat: LogFormat, logLevel: LogLevel | 'off'): Logger; declare function createHonoServer(app: App, options: Options): Hono< { Variables: { requestId: string; resourceLimits: ResourceLimits; }; } & { Variables: { requestId: string; }; } & { Variables: { requestId: string; }; } & { Variables: { resourceLimits: ResourceLimits; }; }, { "/health": { $get: { input: {}; output: { status: string; }; outputFormat: "json"; status: ContentfulStatusCode; }; }; } & { "/connection-info": { $get: { input: {}; output: { provider: Provider; connectionInfo: { schemaName?: string | undefined; maxBindValues?: number | undefined; supportsRelationJoins: boolean; }; }; outputFormat: "json"; status: ContentfulStatusCode; }; }; } & { "/query": { $post: { input: { json: { operation: string; plan: Record; params: Record; model?: string | undefined; comments?: Record | undefined; }; }; output: { data: JSONValue; }; outputFormat: "json"; status: ContentfulStatusCode; }; }; } & { "/transaction/start": { $post: { input: { json: { timeout?: number | undefined; maxWait?: number | undefined; isolationLevel?: "READ UNCOMMITTED" | "READ COMMITTED" | "REPEATABLE READ" | "SNAPSHOT" | "SERIALIZABLE" | undefined; }; }; output: { id: string; }; outputFormat: "json"; status: ContentfulStatusCode; }; }; } & { "/transaction/:txId/query": { $post: { input: { json: { operation: string; plan: Record; params: Record; model?: string | undefined; comments?: Record | undefined; }; } & { param: { txId: string; }; }; output: { data: JSONValue; }; outputFormat: "json"; status: ContentfulStatusCode; }; }; } & { "/transaction/:txId/commit": { $post: { input: { param: { txId: string; }; }; output: {}; outputFormat: "json"; status: ContentfulStatusCode; }; }; } & { "/transaction/:txId/rollback": { $post: { input: { param: { txId: string; }; }; output: {}; outputFormat: "json"; status: ContentfulStatusCode; }; }; }, "/">; declare type CustomHeader = string & {}; /** * Data type can be a string, ArrayBuffer, Uint8Array (buffer), or ReadableStream. */ declare type Data = string | ArrayBuffer | ReadableStream | Uint8Array; declare type DataRule = { type: 'rowCountEq'; args: number; } | { type: 'rowCountNeq'; args: number; } | { type: 'affectedRowCountEq'; args: number; } | { type: 'never'; }; /** * Logs a debug message using the active logger. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event * @throws {Error} if no active logger is found */ declare function debug(message: string, attributes?: ExtendedAttributes): void; /** * Interface representing a renderer for content. * * @interface DefaultRenderer * @param {string | Promise} content - The content to be rendered, which can be either a string or a Promise resolving to a string. * @returns {Response | Promise} - The response after rendering the content, which can be either a Response or a Promise resolving to a Response. */ declare interface DefaultRenderer { (content: string | Promise): Response | Promise; } declare type DeprecatedStatusCode = 305 | 306; declare type DynamicArgType = ArgType | { arity: 'tuple'; elements: ArgType[]; }; declare type Endpoint = { input: any; output: any; outputFormat: ResponseFormat; status: StatusCode; }; declare type Env = { Bindings?: Bindings; Variables?: Variables; }; /** * Logs an error message using the active logger. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event * @throws {Error} if no active logger is found */ declare function error(message: string, attributes?: ExtendedAttributes): void; declare type ErrorHandler = (err: Error | HTTPResponseError, c: Context_2) => Response | Promise; /** * Defines Exception. * * string or an object with one of (message or name or code) and optional stack */ declare type Exception = ExceptionWithCode | ExceptionWithMessage | ExceptionWithName | string; declare interface ExceptionWithCode { code: string | number; name?: string; message?: string; stack?: string; } declare interface ExceptionWithMessage { code?: string | number; message: string; name?: string; stack?: string; } declare interface ExceptionWithName { code?: string | number; message?: string; name: string; stack?: string; } /** * Interface for the execution context in a web worker or similar environment. */ declare interface ExecutionContext { /** * Extends the lifetime of the event callback until the promise is settled. * * @param promise - A promise to wait for. */ waitUntil(promise: Promise): void; /** * Allows the event to be passed through to subsequent event listeners. */ passThroughOnException(): void; /** * For compatibility with Wrangler 4.x. */ props: any; } /** * Log event in a format expected by the Prisma Client. */ declare type ExportableLogEvent = { level: LogLevel; spanId: ExportableSpanId; timestamp: HrTime; message: string; attributes: Attributes; }; /** * Span ID to be used in the logs and traces exported to Prisma Client. * * Prisma Client doesn't particularly care about the format and content of the * span ID, as it is only used for the purposes of re-creating the span * hierarchy, with brand new trace and span IDs assigned by the local tracer * provider on the client. Moreover, Query Engine doesn't even have a concept of * a trace ID, as it's using Tokio `tracing` and not OpenTelemetry internally. * * We use dash-separated OpenTelemetry trace ID and span ID to construct a * single unique identifier for each span. To avoid accidentally assigning * OpenTelemetry span IDs to `spanId` properties, we encode this on the type level. */ declare type ExportableSpanId = `${TraceId}-${SpanId}`; /** * Extension of the {@link Attributes} type to allow recording errors. */ declare type ExtendedAttributes = { [key: string]: AttributeValue | Error | undefined; }; declare type ExtendedSpanOptions = SpanOptions & { name: string; }; declare type ExtendedSpanOptions_2 = SpanOptions & { name: string; }; declare type ExtractHandlerResponse = T extends (c: any, next: any) => Promise ? Exclude extends never ? never : Exclude extends Response | TypedResponse ? Exclude : never : T extends (c: any, next: any) => infer R ? R extends Response | TypedResponse ? R : never : never; declare type ExtractInput = I extends Input ? unknown extends I['in'] ? {} : I['in'] : I; declare type ExtractParams = string extends Path ? Record : Path extends `${infer _Start}:${infer Param}/${infer Rest}` ? { [K in Param | keyof ExtractParams<`/${Rest}`>]: string; } : Path extends `${infer _Start}:${infer Param}` ? { [K in Param]: string; } : never; declare type ExtractStringKey = keyof S & string; declare abstract class FetchEventLike { abstract readonly request: Request; abstract respondWith(promise: Response | Promise): void; abstract passThroughOnException(): void; abstract waitUntil(promise: Promise): void; } declare type FieldInitializer = { type: 'value'; value: PrismaValue; } | { type: 'lastInsertId'; }; declare type FieldOperation = { type: 'set'; value: PrismaValue; } | { type: 'add'; value: PrismaValue; } | { type: 'subtract'; value: PrismaValue; } | { type: 'multiply'; value: PrismaValue; } | { type: 'divide'; value: PrismaValue; }; declare type FieldScalarType = { type: 'string' | 'int' | 'bigint' | 'float' | 'boolean' | 'json' | 'object' | 'datetime' | 'decimal' | 'unsupported'; } | { type: 'enum'; name: string; } | { type: 'bytes'; encoding: 'array' | 'base64' | 'hex'; }; declare type FieldType = { arity: Arity; } & FieldScalarType; declare type FlattenIfIntersect = T extends infer O ? { [K in keyof O]: O[K]; } : never; declare type FormValue = string | Blob; declare type Fragment = { type: 'stringChunk'; chunk: string; } | { type: 'parameter'; } | { type: 'parameterTuple'; } | { type: 'parameterTupleList'; itemPrefix: string; itemSeparator: string; itemSuffix: string; groupSeparator: string; }; /** * Interface for getting context variables. * * @template E - Environment type. */ declare interface Get { (key: Key): E['Variables'][Key]; (key: Key): ContextVariableMap[Key]; } declare const GET_MATCH_RESULT: symbol; declare type GetPath = (request: Request, options?: { env?: E['Bindings']; }) => string; declare type H = any> = Handler | MiddlewareHandler; declare type Handler = any> = (c: Context_2, next: Next) => R; declare interface HandlerInterface {

extends never ? BasePath : ExtractStringKey, I extends Input = BlankInput, R extends HandlerResponse = any, E2 extends Env = E>(handler: H): Hono, S & ToSchema>, BasePath>;

extends never ? BasePath : ExtractStringKey, I extends Input = BlankInput, I2 extends Input = I, R extends HandlerResponse = any, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(...handlers: [H & M1, H]): Hono, S & ToSchema | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(path: P, handler: H): Hono, I, MergeTypedResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(...handlers: [H & M1, H & M2, H]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, M1 extends H = H>(path: P, ...handlers: [H & M1, H]): Hono, I2, MergeTypedResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(...handlers: [H & M1, H & M2, H & M3, H]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, M1 extends H = H, M2 extends H = H>(path: P, ...handlers: [H & M1, H & M2, H]): Hono, I3, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(...handlers: [ H & M1, H & M2, H & M3, H & M4, H ]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, M1 extends H = H, M2 extends H = H, M3 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H ]): Hono, I4, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H ]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H & M4, H ]): Hono, I5, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H ]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H ]): Hono, I6, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H & M7, H ]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H ]): Hono, I7, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H & M7, H & M8, H ]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H & M7, H ]): Hono, I8, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H & M7, H & M8, H & M9, H ]): Hono, S & ToSchema | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H & M7, H & M8, H ]): Hono, I9, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

, R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, M1 extends H = H, M2 extends H = H, M3 extends H = H, M4 extends H = H, M5 extends H = H, M6 extends H = H, M7 extends H = H, M8 extends H = H, M9 extends H = H>(path: P, ...handlers: [ H & M1, H & M2, H & M3, H & M4, H & M5, H & M6, H & M7, H & M8, H & M9, H ]): Hono, I10, MergeTypedResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse | MergeMiddlewareResponse>, BasePath>;

extends never ? BasePath : ExtractStringKey, I extends Input = BlankInput, R extends HandlerResponse = any>(...handlers: H[]): Hono>, BasePath>;

= any>(path: P, ...handlers: H, I, R>[]): Hono, I, MergeTypedResponse>, BasePath>;

= any, I extends Input = BlankInput>(path: P): Hono, I, MergeTypedResponse>, BasePath>; } declare type HandlerResponse = Response | TypedResponse | Promise>; declare type HeaderRecord = Record<'Content-Type', BaseMime> | Record | Record; declare class Hono { get: HandlerInterface; post: HandlerInterface; put: HandlerInterface; delete: HandlerInterface; options: HandlerInterface; patch: HandlerInterface; all: HandlerInterface; on: OnHandlerInterface; use: MiddlewareHandlerInterface; router: Router<[H, RouterRoute]>; readonly getPath: GetPath; private _basePath; routes: RouterRoute[]; constructor(options?: HonoOptions); private errorHandler; /** * `.route()` allows grouping other Hono instance in routes. * * @see {@link https://hono.dev/docs/api/routing#grouping} * * @param {string} path - base Path * @param {Hono} app - other Hono instance * @returns {Hono} routed Hono instance * * @example * ```ts * const app = new Hono() * const app2 = new Hono() * * app2.get("/user", (c) => c.text("user")) * app.route("/api", app2) // GET /api/user * ``` */ route(path: SubPath, app: Hono): Hono> | S, BasePath>; /** * `.basePath()` allows base paths to be specified. * * @see {@link https://hono.dev/docs/api/routing#base-path} * * @param {string} path - base Path * @returns {Hono} changed Hono instance * * @example * ```ts * const api = new Hono().basePath('/api') * ``` */ basePath(path: SubPath): Hono>; /** * `.onError()` handles an error and returns a customized Response. * * @see {@link https://hono.dev/docs/api/hono#error-handling} * * @param {ErrorHandler} handler - request Handler for error * @returns {Hono} changed Hono instance * * @example * ```ts * app.onError((err, c) => { * console.error(`${err}`) * return c.text('Custom Error Message', 500) * }) * ``` */ onError: (handler: ErrorHandler) => Hono; /** * `.notFound()` allows you to customize a Not Found Response. * * @see {@link https://hono.dev/docs/api/hono#not-found} * * @param {NotFoundHandler} handler - request handler for not-found * @returns {Hono} changed Hono instance * * @example * ```ts * app.notFound((c) => { * return c.text('Custom 404 Message', 404) * }) * ``` */ notFound: (handler: NotFoundHandler) => Hono; /** * `.mount()` allows you to mount applications built with other frameworks into your Hono application. * * @see {@link https://hono.dev/docs/api/hono#mount} * * @param {string} path - base Path * @param {Function} applicationHandler - other Request Handler * @param {MountOptions} [options] - options of `.mount()` * @returns {Hono} mounted Hono instance * * @example * ```ts * import { Router as IttyRouter } from 'itty-router' * import { Hono } from 'hono' * // Create itty-router application * const ittyRouter = IttyRouter() * // GET /itty-router/hello * ittyRouter.get('/hello', () => new Response('Hello from itty-router')) * * const app = new Hono() * app.mount('/itty-router', ittyRouter.handle) * ``` * * @example * ```ts * const app = new Hono() * // Send the request to another application without modification. * app.mount('/app', anotherApp, { * replaceRequest: (req) => req, * }) * ``` */ mount(path: string, applicationHandler: (request: Request, ...args: any) => Response | Promise, options?: MountOptions): Hono; /** * `.fetch()` will be entry point of your app. * * @see {@link https://hono.dev/docs/api/hono#fetch} * * @param {Request} request - request Object of request * @param {Env} Env - env Object * @param {ExecutionContext} - context of execution * @returns {Response | Promise} response of request * */ fetch: (request: Request, Env?: E['Bindings'] | {}, executionCtx?: ExecutionContext) => Response | Promise; /** * `.request()` is a useful method for testing. * You can pass a URL or pathname to send a GET request. * app will return a Response object. * ```ts * test('GET /hello is ok', async () => { * const res = await app.request('/hello') * expect(res.status).toBe(200) * }) * ``` * @see https://hono.dev/docs/api/hono#request */ request: (input: RequestInfo | URL, requestInit?: RequestInit, Env?: E["Bindings"] | {}, executionCtx?: ExecutionContext) => Response | Promise; /** * `.fire()` automatically adds a global fetch event listener. * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers. * @deprecated * Use `fire` from `hono/service-worker` instead. * ```ts * import { Hono } from 'hono' * import { fire } from 'hono/service-worker' * * const app = new Hono() * // ... * fire(app) * ``` * @see https://hono.dev/docs/api/hono#fire * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ */ fire: () => void; } declare type HonoOptions = { /** * `strict` option specifies whether to distinguish whether the last path is a directory or not. * * @see {@link https://hono.dev/docs/api/hono#strict-mode} * * @default true */ strict?: boolean; /** * `router` option specifies which router to use. * * @see {@link https://hono.dev/docs/api/hono#router-option} * * @example * ```ts * const app = new Hono({ router: new RegExpRouter() }) * ``` */ router?: Router<[H, RouterRoute]>; /** * `getPath` can handle the host header value. * * @see {@link https://hono.dev/docs/api/routing#routing-with-host-header-value} * * @example * ```ts * const app = new Hono({ * getPath: (req) => * '/' + req.headers.get('host') + req.url.replace(/^https?:\/\/[^/]+(\/[^?]*)/, '$1'), * }) * * app.get('/www1.example.com/hello', () => c.text('hello www1')) * * // A following request will match the route: * // new Request('http://www1.example.com/hello', { * // headers: { host: 'www1.example.com' }, * // }) * ``` */ getPath?: GetPath; }; declare class HonoRequest

{ [GET_MATCH_RESULT]: Result<[unknown, RouterRoute]>; /** * `.raw` can get the raw Request object. * * @see {@link https://hono.dev/docs/api/request#raw} * * @example * ```ts * // For Cloudflare Workers * app.post('/', async (c) => { * const metadata = c.req.raw.cf?.hostMetadata? * ... * }) * ``` */ raw: Request; routeIndex: number; /** * `.path` can get the pathname of the request. * * @see {@link https://hono.dev/docs/api/request#path} * * @example * ```ts * app.get('/about/me', (c) => { * const pathname = c.req.path // `/about/me` * }) * ``` */ path: string; bodyCache: BodyCache; constructor(request: Request, path?: string, matchResult?: Result<[unknown, RouterRoute]>); /** * `.req.param()` gets the path parameters. * * @see {@link https://hono.dev/docs/api/routing#path-parameter} * * @example * ```ts * const name = c.req.param('name') * // or all parameters at once * const { id, comment_id } = c.req.param() * ``` */ param = ParamKeys

>(key: P2 extends `${infer _}?` ? never : P2): string; param> = RemoveQuestion>>(key: P2): string | undefined; param(key: string): string | undefined; param(): Simplify>>>; /** * `.query()` can get querystring parameters. * * @see {@link https://hono.dev/docs/api/request#query} * * @example * ```ts * // Query params * app.get('/search', (c) => { * const query = c.req.query('q') * }) * * // Get all params at once * app.get('/search', (c) => { * const { q, limit, offset } = c.req.query() * }) * ``` */ query(key: string): string | undefined; query(): Record; /** * `.queries()` can get multiple querystring parameter values, e.g. /search?tags=A&tags=B * * @see {@link https://hono.dev/docs/api/request#queries} * * @example * ```ts * app.get('/search', (c) => { * // tags will be string[] * const tags = c.req.queries('tags') * }) * ``` */ queries(key: string): string[] | undefined; queries(): Record; /** * `.header()` can get the request header value. * * @see {@link https://hono.dev/docs/api/request#header} * * @example * ```ts * app.get('/', (c) => { * const userAgent = c.req.header('User-Agent') * }) * ``` */ header(name: RequestHeader): string | undefined; header(name: string): string | undefined; header(): Record; /** * `.parseBody()` can parse Request body of type `multipart/form-data` or `application/x-www-form-urlencoded` * * @see {@link https://hono.dev/docs/api/request#parsebody} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.parseBody() * }) * ``` */ parseBody, T extends BodyData>(options?: Options): Promise; parseBody(options?: Partial): Promise; /** * `.json()` can parse Request body of type `application/json` * * @see {@link https://hono.dev/docs/api/request#json} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.json() * }) * ``` */ json(): Promise; /** * `.text()` can parse Request body of type `text/plain` * * @see {@link https://hono.dev/docs/api/request#text} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.text() * }) * ``` */ text(): Promise; /** * `.arrayBuffer()` parse Request body as an `ArrayBuffer` * * @see {@link https://hono.dev/docs/api/request#arraybuffer} * * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.arrayBuffer() * }) * ``` */ arrayBuffer(): Promise; /** * Parses the request body as a `Blob`. * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.blob(); * }); * ``` * @see https://hono.dev/docs/api/request#blob */ blob(): Promise; /** * Parses the request body as `FormData`. * @example * ```ts * app.post('/entry', async (c) => { * const body = await c.req.formData(); * }); * ``` * @see https://hono.dev/docs/api/request#formdata */ formData(): Promise; /** * Adds validated data to the request. * * @param target - The target of the validation. * @param data - The validated data to add. */ addValidatedData(target: keyof ValidationTargets, data: {}): void; /** * Gets validated data from the request. * * @param target - The target of the validation. * @returns The validated data. * * @see https://hono.dev/docs/api/request#valid */ valid(target: T): InputToDataByTarget; /** * `.url()` can get the request url strings. * * @see {@link https://hono.dev/docs/api/request#url} * * @example * ```ts * app.get('/about/me', (c) => { * const url = c.req.url // `http://localhost:8787/about/me` * ... * }) * ``` */ get url(): string; /** * `.method()` can get the method name of the request. * * @see {@link https://hono.dev/docs/api/request#method} * * @example * ```ts * app.get('/about/me', (c) => { * const method = c.req.method // `GET` * }) * ``` */ get method(): string; /** * `.matchedRoutes()` can return a matched route in the handler * * @deprecated * * Use matchedRoutes helper defined in "hono/route" instead. * * @see {@link https://hono.dev/docs/api/request#matchedroutes} * * @example * ```ts * app.use('*', async function logger(c, next) { * await next() * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => { * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]') * console.log( * method, * ' ', * path, * ' '.repeat(Math.max(10 - path.length, 0)), * name, * i === c.req.routeIndex ? '<- respond from here' : '' * ) * }) * }) * ``` */ get matchedRoutes(): RouterRoute[]; /** * `routePath()` can retrieve the path registered within the handler * * @deprecated * * Use routePath helper defined in "hono/route" instead. * * @see {@link https://hono.dev/docs/api/request#routepath} * * @example * ```ts * app.get('/posts/:id', (c) => { * return c.json({ path: c.req.routePath }) * }) * ``` */ get routePath(): string; } declare type HonoServer = ReturnType; /** * Defines High-Resolution Time. * * The first number, HrTime[0], is UNIX Epoch time in seconds since 00:00:00 UTC on 1 January 1970. * The second number, HrTime[1], represents the partial second elapsed since Unix Epoch time represented by first number in nanoseconds. * For example, 2021-01-01T12:30:10.150Z in UNIX Epoch time in milliseconds is represented as 1609504210150. * The first number is calculated by converting and truncating the Epoch time in milliseconds to seconds: * HrTime[0] = Math.trunc(1609504210150 / 1000) = 1609504210. * The second number is calculated by converting the digits after the decimal point of the subtraction, (1609504210150 / 1000) - HrTime[0], to nanoseconds: * HrTime[1] = Number((1609504210.150 - HrTime[0]).toFixed(9)) * 1e9 = 150000000. * This is represented in HrTime format as [1609504210, 150000000]. */ declare type HrTime = [number, number]; /** * Interface representing a function that responds with HTML content. * * @param html - The HTML content to respond with, which can be a string or a Promise that resolves to a string. * @param status - (Optional) The HTTP status code for the response. * @param headers - (Optional) A record of headers to include in the response. * @param init - (Optional) The response initialization object. * * @returns A Response object or a Promise that resolves to a Response object. */ declare interface HTMLRespond { >(html: T, status?: ContentfulStatusCode, headers?: HeaderRecord): T extends string ? Response : Promise; >(html: T, init?: ResponseOrInit): T extends string ? Response : Promise; } declare interface HTTPResponseError extends Error { getResponse: () => Response; } declare type IfAnyThenEmptyObject = 0 extends 1 & T ? {} : T; /** * Logs an informational message using the active logger. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event * @throws {Error} if no active logger is found */ declare function info(message: string, attributes?: ExtendedAttributes): void; /** * @module * HTTP Status utility. */ declare type InfoStatusCode = 100 | 101 | 102 | 103; declare type InMemoryOps = { pagination: Pagination | null; distinct: string[] | null; reverse: boolean; linkingFields: string[] | null; nested: Record; }; declare type Input = { in?: {}; out?: {}; outputFormat?: ResponseFormat; }; declare type InputToDataByTarget = T extends { [K in Target]: infer R; } ? R : never; declare type IntersectNonAnyTypes = T extends [infer Head, ...infer Rest] ? ProcessHead & IntersectNonAnyTypes : {}; declare type InvalidJSONValue = undefined | symbol | ((...args: unknown[]) => unknown); declare type InvalidToNull = T extends InvalidJSONValue ? null : T; declare type IsAny = boolean extends (T extends never ? true : false) ? true : false; declare type IsInvalid = T extends InvalidJSONValue ? true : false; declare type IsolationLevel = 'READ UNCOMMITTED' | 'READ COMMITTED' | 'REPEATABLE READ' | 'SNAPSHOT' | 'SERIALIZABLE'; declare type JoinExpression = { child: QueryPlanNode; on: [left: string, right: string][]; parentField: string; isRelationUnique: boolean; }; declare type JSONArray = (JSONPrimitive | JSONObject | JSONArray)[]; declare type JSONObject = { [key: string]: JSONPrimitive | JSONArray | JSONObject | object | InvalidJSONValue; }; /** * Convert a type to a JSON-compatible type. * * Non-JSON values such as `Date` implement `.toJSON()`, * so they can be transformed to a value assignable to `JSONObject` * * `JSON.stringify()` throws a `TypeError` when it encounters a `bigint` value, * unless a custom `replacer` function or `.toJSON()` method is provided. * * This behaviour can be controlled by the `TError` generic type parameter, * which defaults to `bigint | ReadonlyArray`. * You can set it to `never` to disable this check. */ declare type JSONParsed> = T extends { toJSON(): infer J; } ? (() => J) extends () => JSONPrimitive ? J : (() => J) extends () => { toJSON(): unknown; } ? {} : JSONParsed : T extends JSONPrimitive ? T : T extends InvalidJSONValue ? never : T extends ReadonlyArray ? { [K in keyof T]: JSONParsed, TError>; } : T extends Set | Map | Record ? {} : T extends object ? T[keyof T] extends TError ? never : { [K in keyof OmitSymbolKeys as IsInvalid extends true ? never : K]: boolean extends IsInvalid ? JSONParsed | undefined : JSONParsed; } : T extends unknown ? T extends TError ? never : JSONValue : never; declare type JSONPrimitive = string | boolean | number | null; /** * Interface for responding with JSON. * * @interface JSONRespond * @template T - The type of the JSON value or simplified unknown type. * @template U - The type of the status code. * * @param {T} object - The JSON object to be included in the response. * @param {U} [status] - An optional status code for the response. * @param {HeaderRecord} [headers] - An optional record of headers to include in the response. * * @returns {JSONRespondReturn} - The response after rendering the JSON object, typed with the provided object and status code types. */ declare interface JSONRespond { (object: T, status?: U, headers?: HeaderRecord): JSONRespondReturn; (object: T, init?: ResponseOrInit): JSONRespondReturn; } /** * @template T - The type of the JSON value or simplified unknown type. * @template U - The type of the status code. * * @returns {Response & TypedResponse, U, 'json'>} - The response after rendering the JSON object, typed with the provided object and status code types. */ declare type JSONRespondReturn = Response & TypedResponse, U, 'json'>; declare type JSONValue = JSONObject | JSONArray | JSONPrimitive; declare type KnownResponseFormat = 'json' | 'text' | 'redirect'; declare type Layout> = (props: T) => any; /** * A pointer from the current {@link Span} to another span in the same trace or * in a different trace. * Few examples of Link usage. * 1. Batch Processing: A batch of elements may contain elements associated * with one or more traces/spans. Since there can only be one parent * SpanContext, Link is used to keep reference to SpanContext of all * elements in the batch. * 2. Public Endpoint: A SpanContext in incoming client request on a public * endpoint is untrusted from service provider perspective. In such case it * is advisable to start a new trace with appropriate sampling decision. * However, it is desirable to associate incoming SpanContext to new trace * initiated on service provider side so two traces (from Client and from * Service Provider) can be correlated. */ declare interface Link { /** The {@link SpanContext} of a linked span. */ context: SpanContext; /** A set of {@link SpanAttributes} on the link. */ attributes?: SpanAttributes; /** Count of attributes of the link that were dropped due to collection limits */ droppedAttributesCount?: number; } export declare namespace log { export { debug, query, info, warn, error } } /** * Internal representation of a log event. */ declare class LogEvent { readonly level: LogLevel; readonly traceId: TraceId; readonly spanId: SpanId; readonly timestamp: Temporal.Instant; readonly message: string; readonly attributes: ExtendedAttributes; constructor(level: LogLevel, message: string, attributes?: ExtendedAttributes, timestamp?: Temporal.Instant); export(): ExportableLogEvent; } /** * Output format of printed log events. */ export declare type LogFormat = 'json' | 'text'; /** * Core logger class that writes log events to a sink. */ declare class Logger { /** The log sink that will receive log events */ readonly sink: LogSink; /** * Creates a new logger instance. * * @param sink The sink that will receive log events */ constructor(sink: LogSink); /** * Logs a message with the specified level and attributes. * * @param level The log level * @param message The message to log * @param attributes Optional key-value pairs to include with the log event */ log(level: LogLevel, message: string, attributes?: ExtendedAttributes): void; /** * Logs a debug message. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event */ debug(message: string, attributes?: ExtendedAttributes): void; /** * Logs a database query event. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event */ query(message: string, attributes?: ExtendedAttributes): void; /** * Logs an informational message. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event */ info(message: string, attributes?: ExtendedAttributes): void; /** * Logs a warning message. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event */ warn(message: string, attributes?: ExtendedAttributes): void; /** * Logs an error message. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event */ error(message: string, attributes?: ExtendedAttributes): void; } /** * Level of a log event. * * This is mostly standard but includes an additional `query` level because * Prisma Client treats it as such. In the query engine it was emulated with * unclear semantics on top of the actual levels, but here we explicitly define * it as a real level between `debug` and `info`. */ export declare type LogLevel = (typeof validLogLevels)[number]; /** * Log options for the logging middleware. */ export declare interface LogOptions { /** Minimum log level to output */ logLevel: ConsoleLogLevel; /** Format of log output */ logFormat: LogFormat; } /** * Represents a log sink that writes log events to a destination. */ declare interface LogSink { write(event: LogEvent): void; } declare type MergeEndpointParamsWithPath = T extends unknown ? { input: T['input'] extends { param: infer _; } ? ExtractParams extends never ? T['input'] : FlattenIfIntersect as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string; }; }> : RemoveBlankRecord> extends never ? T['input'] : T['input'] & { param: { [K in keyof ExtractParams as K extends `${infer Prefix}{${infer _}}` ? Prefix : K]: string; }; }; output: T['output']; outputFormat: T['outputFormat']; status: T['status']; } : never; declare type MergeMiddlewareResponse = MergeTypedResponseStrict>; declare type MergePath = B extends '' ? MergePath : A extends '' ? B : A extends '/' ? B : A extends `${infer P}/` ? B extends `/${infer Q}` ? `${P}/${Q}` : `${P}/${B}` : B extends `/${infer Q}` ? Q extends '' ? A : `${A}/${Q}` : `${A}/${B}`; declare type MergeSchemaPath = { [P in keyof OrigSchema as MergePath]: [OrigSchema[P]] extends [ Record ] ? { [M in keyof OrigSchema[P]]: MergeEndpointParamsWithPath; } : never; }; declare type MergeTypedResponse = T extends Promise ? T2 extends TypedResponse ? T2 : TypedResponse : T extends TypedResponse ? T : TypedResponse; declare type MergeTypedResponseStrict = T extends Promise ? T2 extends TypedResponse ? T2 : never : T extends TypedResponse ? T : never; declare type MiddlewareHandler = Response> = (c: Context_2, next: Next) => Promise; declare interface MiddlewareHandlerInterface { (...handlers: MiddlewareHandler>>[]): Hono, S, BasePath>; (handler: MiddlewareHandler>>): Hono, S, BasePath>; , P extends string = MergePath>>(...handlers: [MiddlewareHandler, MiddlewareHandler]): Hono, S, BasePath>;

, E2 extends Env = E>(path: P, handler: MiddlewareHandler): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(path: P, ...handlers: [MiddlewareHandler, MiddlewareHandler]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(path: P, ...handlers: [MiddlewareHandler, MiddlewareHandler, MiddlewareHandler]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(path: P, ...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(path: P, ...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(path: P, ...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(path: P, ...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(path: P, ...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, ChangePathOfSchema, BasePath>; , E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>, P extends string = MergePath>>(...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, S, BasePath>;

, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(path: P, ...handlers: [ MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler, MiddlewareHandler ]): Hono, ChangePathOfSchema, BasePath>;

(path: P, ...handlers: MiddlewareHandler>[]): Hono; } declare type MountOptionHandler = (c: Context_2) => unknown; declare type MountOptions = MountOptionHandler | { optionHandler?: MountOptionHandler; replaceRequest?: MountReplaceRequest | false; }; declare type MountReplaceRequest = (originalRequest: Request) => Request; /** * Interface for creating a new response. */ declare interface NewResponse { (data: Data | null, status?: StatusCode, headers?: HeaderRecord): Response; (data: Data | null, init?: ResponseOrInit): Response; } declare type Next = () => Promise; declare type NotFoundHandler = (c: Context_2) => Response | Promise; declare const officialPrismaAdapters: readonly ["@prisma/adapter-planetscale", "@prisma/adapter-neon", "@prisma/adapter-libsql", "@prisma/adapter-better-sqlite3", "@prisma/adapter-d1", "@prisma/adapter-pg", "@prisma/adapter-mssql", "@prisma/adapter-mariadb"]; /** * symbol keys are omitted through `JSON.stringify` */ declare type OmitSymbolKeys = { [K in keyof T as K extends symbol ? never : K]: T[K]; }; declare interface OnHandlerInterface { , R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(method: M, path: P, handler: H): Hono, S & ToSchema, I, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(method: M, path: P, ...handlers: [H, H]): Hono, S & ToSchema, I2, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(method: M, path: P, ...handlers: [H, H, H]): Hono, S & ToSchema, I3, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(method: M, path: P, ...handlers: [ H, H, H, H ]): Hono, S & ToSchema, I4, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(method: M, path: P, ...handlers: [ H, H, H, H, H ]): Hono, S & ToSchema, I5, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(method: M, path: P, ...handlers: [ H, H, H, H, H, H ]): Hono, S & ToSchema, I6, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(method: M, path: P, ...handlers: [ H, H, H, H, H, H, H ]): Hono, S & ToSchema, I7, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(method: M, path: P, ...handlers: [ H, H, H, H, H, H, H, H ]): Hono, S & ToSchema, I8, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(method: M, path: P, ...handlers: [ H, H, H, H, H, H, H, H, H ]): Hono, S & ToSchema, I9, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(method: M, path: P, ...handlers: [ H, H, H, H, H, H, H, H, H, H ]): Hono, S & ToSchema, I10, MergeTypedResponse>>, BasePath>; = any, I extends Input = BlankInput>(method: M, path: P, ...handlers: H, I, R>[]): Hono, I, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, E2 extends Env = E>(methods: Ms, path: P, handler: H): Hono, S & ToSchema, I, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>>(methods: Ms, path: P, ...handlers: [H, H]): Hono, S & ToSchema, I2, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>>(methods: Ms, path: P, ...handlers: [H, H, H]): Hono, S & ToSchema, I3, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H ]): Hono, S & ToSchema, I4, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H, H ]): Hono, S & ToSchema, I5, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H, H, H ]): Hono, S & ToSchema, I6, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H, H, H, H ]): Hono, S & ToSchema, I7, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H, H, H, H, H ]): Hono, S & ToSchema, I8, MergeTypedResponse>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H, H, H, H, H, H ]): Hono, S & ToSchema, I9, MergeTypedResponse>>, BasePath>; , R extends HandlerResponse = any, I extends Input = BlankInput, I2 extends Input = I, I3 extends Input = I & I2, I4 extends Input = I & I2 & I3, I5 extends Input = I & I2 & I3 & I4, I6 extends Input = I & I2 & I3 & I4 & I5, I7 extends Input = I & I2 & I3 & I4 & I5 & I6, I8 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7, I9 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8, I10 extends Input = I & I2 & I3 & I4 & I5 & I6 & I7 & I8 & I9, E2 extends Env = E, E3 extends Env = IntersectNonAnyTypes<[E, E2]>, E4 extends Env = IntersectNonAnyTypes<[E, E2, E3]>, E5 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4]>, E6 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5]>, E7 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6]>, E8 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7]>, E9 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8]>, E10 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9]>, E11 extends Env = IntersectNonAnyTypes<[E, E2, E3, E4, E5, E6, E7, E8, E9, E10]>>(methods: Ms, path: P, ...handlers: [ H, H, H, H, H, H, H, H, H, H ]): Hono, S & ToSchema, I10, MergeTypedResponse>>, BasePath>;

= any, I extends Input = BlankInput>(methods: string[], path: P, ...handlers: H, I, R>[]): Hono, I, MergeTypedResponse>, BasePath>; = any, E2 extends Env = E>(methods: string | string[], paths: string[], ...handlers: H[]): Hono>, BasePath>; } /** * Configuration options for the query plan executor server. */ export declare interface Options { /** Database connection URL */ databaseUrl: string; /** Maximum time to wait for a query to complete */ queryTimeout: Temporal.Duration; /** Maximum timeout allowed for a transaction */ maxTransactionTimeout: Temporal.Duration; /** Maximum time to wait for a transaction to start */ maxTransactionWaitTime: Temporal.Duration; /** Maximum size of a response in bytes */ maxResponseSize: number; /** * Initializes a logging context and creates a logger with the specified options * in the scope of each HTTP request in a middleware. This is useful when the * lifetime of the server needs to be managed externally, but it is less efficient * than creating a logger once and running the server inside its scope. */ perRequestLogContext?: LogOptions; } declare type Pagination = { cursor: Record | null; take: number | null; skip: number | null; }; /** * Type representing a map of parameter indices. */ declare type ParamIndexMap = Record; declare type ParamKey = Component extends `:${infer NameWithPattern}` ? NameWithPattern extends `${infer Name}{${infer Rest}` ? Rest extends `${infer _Pattern}?` ? `${Name}?` : Name : NameWithPattern : never; declare type ParamKeys = Path extends `${infer Component}/${infer Rest}` ? ParamKey | ParamKeys : ParamKey; declare type ParamKeyToRecord = T extends `${infer R}?` ? Record : { [K in T]: string; }; /** * Type representing a map of parameters. */ declare type Params = Record; /** * Type representing a stash of parameters. */ declare type ParamStash = string[]; declare type ParseBodyOptions = { /** * Determines whether all fields with multiple values should be parsed as arrays. * @default false * @example * const data = new FormData() * data.append('file', 'aaa') * data.append('file', 'bbb') * data.append('message', 'hello') * * If all is false: * parseBody should return { file: 'bbb', message: 'hello' } * * If all is true: * parseBody should return { file: ['aaa', 'bbb'], message: 'hello' } */ all: boolean; /** * Determines whether all fields with dot notation should be parsed as nested objects. * @default false * @example * const data = new FormData() * data.append('obj.key1', 'value1') * data.append('obj.key2', 'value2') * * If dot is false: * parseBody should return { 'obj.key1': 'value1', 'obj.key2': 'value2' } * * If dot is true: * parseBody should return { obj: { key1: 'value1', key2: 'value2' } } */ dot: boolean; }; declare type ParsedFormValue = string | File; /** * Parses a duration string into a Temporal.Duration object. * * @param duration - The duration string to parse. * @returns The parsed Temporal.Duration object. * @throws {Error} If the duration string is invalid. */ export declare function parseDuration(duration: string): Temporal.Duration; /** * Parses an integer string into a number. * * @param value - The integer string to parse. * @returns The parsed number. * @throws {Error} If the integer string is invalid. */ export declare function parseInteger(value: string): number; /** * Parses a string into a valid {@link LogFormat}. * * @param format The string to parse * @returns The parsed LogFormat * @throws {Error} if the format is not supported */ export declare function parseLogFormat(format: string): LogFormat; /** * Parses a log level string into a LogLevel. * * Throws an error if the string is not a valid log level. */ export declare function parseLogLevel(level: string): LogLevel; /** * Parses a string as a size in bytes. * Supports both plain integers (interpreted as bytes) and strings with size units. * * @param value The string to parse * @returns The size in bytes * @throws Error if the value is invalid */ export declare function parseSize(value: string): number; declare interface PlaceholderFormat { prefix: string; hasNumbering: boolean; } declare type PrismaValue = string | boolean | number | PrismaValue[] | null | Record | PrismaValuePlaceholder | PrismaValueGenerator; declare type PrismaValueGenerator = { prisma__type: 'generatorCall'; prisma__value: { name: string; args: PrismaValue[]; }; }; declare type PrismaValuePlaceholder = { prisma__type: 'param'; prisma__value: { name: string; type: string; }; }; declare type ProcessHead = IfAnyThenEmptyObject; /** * Extracts the props for the renderer. */ declare type PropsForRenderer = [...Required>] extends [unknown, infer Props] ? Props : unknown; declare type Provider = 'mysql' | 'postgres' | 'sqlite' | 'sqlserver'; /** * Logs a database query event using the active logger. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event * @throws {Error} if no active logger is found */ declare function query(message: string, attributes?: ExtendedAttributes): void; declare interface Queryable extends AdapterInfo { /** * Execute a query and return its result. */ queryRaw(params: Query): Promise; /** * Execute a query and return the number of affected rows. */ executeRaw(params: Query): Promise; } declare type QueryEvent = { timestamp: Date; query: string; params: unknown[]; duration: number; }; declare type QueryPlanBinding = { name: string; expr: QueryPlanNode; }; declare type QueryPlanDbQuery = { type: 'rawSql'; sql: string; args: PrismaValue[]; argTypes: ArgType[]; } | { type: 'templateSql'; fragments: Fragment[]; placeholderFormat: PlaceholderFormat; args: PrismaValue[]; argTypes: DynamicArgType[]; chunkable: boolean; }; declare type QueryPlanNode = { type: 'value'; args: PrismaValue; } | { type: 'seq'; args: QueryPlanNode[]; } | { type: 'get'; args: { name: string; }; } | { type: 'let'; args: { bindings: QueryPlanBinding[]; expr: QueryPlanNode; }; } | { type: 'getFirstNonEmpty'; args: { names: string[]; }; } | { type: 'query'; args: QueryPlanDbQuery; } | { type: 'execute'; args: QueryPlanDbQuery; } | { type: 'reverse'; args: QueryPlanNode; } | { type: 'sum'; args: QueryPlanNode[]; } | { type: 'concat'; args: QueryPlanNode[]; } | { type: 'unique'; args: QueryPlanNode; } | { type: 'required'; args: QueryPlanNode; } | { type: 'join'; args: { parent: QueryPlanNode; children: JoinExpression[]; }; } | { type: 'mapField'; args: { field: string; records: QueryPlanNode; }; } | { type: 'transaction'; args: QueryPlanNode; } | { type: 'dataMap'; args: { expr: QueryPlanNode; structure: ResultNode; enums: Record>; }; } | { type: 'validate'; args: { expr: QueryPlanNode; rules: DataRule[]; } & ValidationError; } | { type: 'if'; args: { value: QueryPlanNode; rule: DataRule; then: QueryPlanNode; else: QueryPlanNode; }; } | { type: 'unit'; } | { type: 'diff'; args: { from: QueryPlanNode; to: QueryPlanNode; fields: string[]; }; } | { type: 'initializeRecord'; args: { expr: QueryPlanNode; fields: Record; }; } | { type: 'mapRecord'; args: { expr: QueryPlanNode; fields: Record; }; } | { type: 'process'; args: { expr: QueryPlanNode; operations: InMemoryOps; }; }; declare type RedirectStatusCode = 300 | 301 | 302 | 303 | 304 | DeprecatedStatusCode | 307 | 308; declare type RemoveBlankRecord = T extends Record ? K extends string ? T : never : never; declare type RemoveQuestion = T extends `${infer R}?` ? R : T; /** * Renderer type which can either be a ContextRenderer or DefaultRenderer. */ declare type Renderer = ContextRenderer extends Function ? ContextRenderer : DefaultRenderer; /** * @module * HTTP Headers utility. */ declare type RequestHeader = 'A-IM' | 'Accept' | 'Accept-Additions' | 'Accept-CH' | 'Accept-Charset' | 'Accept-Datetime' | 'Accept-Encoding' | 'Accept-Features' | 'Accept-Language' | 'Accept-Patch' | 'Accept-Post' | 'Accept-Ranges' | 'Accept-Signature' | 'Access-Control' | 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Access-Control-Request-Headers' | 'Access-Control-Request-Method' | 'Age' | 'Allow' | 'ALPN' | 'Alt-Svc' | 'Alt-Used' | 'Alternates' | 'AMP-Cache-Transform' | 'Apply-To-Redirect-Ref' | 'Authentication-Control' | 'Authentication-Info' | 'Authorization' | 'Available-Dictionary' | 'C-Ext' | 'C-Man' | 'C-Opt' | 'C-PEP' | 'C-PEP-Info' | 'Cache-Control' | 'Cache-Status' | 'Cal-Managed-ID' | 'CalDAV-Timezones' | 'Capsule-Protocol' | 'CDN-Cache-Control' | 'CDN-Loop' | 'Cert-Not-After' | 'Cert-Not-Before' | 'Clear-Site-Data' | 'Client-Cert' | 'Client-Cert-Chain' | 'Close' | 'CMCD-Object' | 'CMCD-Request' | 'CMCD-Session' | 'CMCD-Status' | 'CMSD-Dynamic' | 'CMSD-Static' | 'Concealed-Auth-Export' | 'Configuration-Context' | 'Connection' | 'Content-Base' | 'Content-Digest' | 'Content-Disposition' | 'Content-Encoding' | 'Content-ID' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-MD5' | 'Content-Range' | 'Content-Script-Type' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Style-Type' | 'Content-Type' | 'Content-Version' | 'Cookie' | 'Cookie2' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Embedder-Policy-Report-Only' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Opener-Policy-Report-Only' | 'Cross-Origin-Resource-Policy' | 'CTA-Common-Access-Token' | 'DASL' | 'Date' | 'DAV' | 'Default-Style' | 'Delta-Base' | 'Deprecation' | 'Depth' | 'Derived-From' | 'Destination' | 'Differential-ID' | 'Dictionary-ID' | 'Digest' | 'DPoP' | 'DPoP-Nonce' | 'Early-Data' | 'EDIINT-Features' | 'ETag' | 'Expect' | 'Expect-CT' | 'Expires' | 'Ext' | 'Forwarded' | 'From' | 'GetProfile' | 'Hobareg' | 'Host' | 'HTTP2-Settings' | 'If' | 'If-Match' | 'If-Modified-Since' | 'If-None-Match' | 'If-Range' | 'If-Schedule-Tag-Match' | 'If-Unmodified-Since' | 'IM' | 'Include-Referred-Token-Binding-ID' | 'Isolation' | 'Keep-Alive' | 'Label' | 'Last-Event-ID' | 'Last-Modified' | 'Link' | 'Link-Template' | 'Location' | 'Lock-Token' | 'Man' | 'Max-Forwards' | 'Memento-Datetime' | 'Meter' | 'Method-Check' | 'Method-Check-Expires' | 'MIME-Version' | 'Negotiate' | 'NEL' | 'OData-EntityId' | 'OData-Isolation' | 'OData-MaxVersion' | 'OData-Version' | 'Opt' | 'Optional-WWW-Authenticate' | 'Ordering-Type' | 'Origin' | 'Origin-Agent-Cluster' | 'OSCORE' | 'OSLC-Core-Version' | 'Overwrite' | 'P3P' | 'PEP' | 'PEP-Info' | 'Permissions-Policy' | 'PICS-Label' | 'Ping-From' | 'Ping-To' | 'Position' | 'Pragma' | 'Prefer' | 'Preference-Applied' | 'Priority' | 'ProfileObject' | 'Protocol' | 'Protocol-Info' | 'Protocol-Query' | 'Protocol-Request' | 'Proxy-Authenticate' | 'Proxy-Authentication-Info' | 'Proxy-Authorization' | 'Proxy-Features' | 'Proxy-Instruction' | 'Proxy-Status' | 'Public' | 'Public-Key-Pins' | 'Public-Key-Pins-Report-Only' | 'Range' | 'Redirect-Ref' | 'Referer' | 'Referer-Root' | 'Referrer-Policy' | 'Refresh' | 'Repeatability-Client-ID' | 'Repeatability-First-Sent' | 'Repeatability-Request-ID' | 'Repeatability-Result' | 'Replay-Nonce' | 'Reporting-Endpoints' | 'Repr-Digest' | 'Retry-After' | 'Safe' | 'Schedule-Reply' | 'Schedule-Tag' | 'Sec-GPC' | 'Sec-Purpose' | 'Sec-Token-Binding' | 'Sec-WebSocket-Accept' | 'Sec-WebSocket-Extensions' | 'Sec-WebSocket-Key' | 'Sec-WebSocket-Protocol' | 'Sec-WebSocket-Version' | 'Security-Scheme' | 'Server' | 'Server-Timing' | 'Set-Cookie' | 'Set-Cookie2' | 'SetProfile' | 'Signature' | 'Signature-Input' | 'SLUG' | 'SoapAction' | 'Status-URI' | 'Strict-Transport-Security' | 'Sunset' | 'Surrogate-Capability' | 'Surrogate-Control' | 'TCN' | 'TE' | 'Timeout' | 'Timing-Allow-Origin' | 'Topic' | 'Traceparent' | 'Tracestate' | 'Trailer' | 'Transfer-Encoding' | 'TTL' | 'Upgrade' | 'Urgency' | 'URI' | 'Use-As-Dictionary' | 'User-Agent' | 'Variant-Vary' | 'Vary' | 'Via' | 'Want-Content-Digest' | 'Want-Digest' | 'Want-Repr-Digest' | 'Warning' | 'WWW-Authenticate' | 'X-Content-Type-Options' | 'X-Frame-Options'; /** * Resource limits defined for the user. */ declare type ResourceLimits = { /** * Maximum duration for a query to run before it is canceled. */ queryTimeout: Temporal.Duration; /** * Maximum allowed transaction duration. If a client specifies a longer * duration when starting an interactive transaction, the Query Plan Executor * will respond with an error. */ maxTransactionTimeout: Temporal.Duration; /** * Maximum allowed size of a response in bytes. */ maxResponseSize: number; }; declare type ResponseFormat = KnownResponseFormat | string; declare type ResponseHeader = 'Access-Control-Allow-Credentials' | 'Access-Control-Allow-Headers' | 'Access-Control-Allow-Methods' | 'Access-Control-Allow-Origin' | 'Access-Control-Expose-Headers' | 'Access-Control-Max-Age' | 'Age' | 'Allow' | 'Cache-Control' | 'Clear-Site-Data' | 'Content-Disposition' | 'Content-Encoding' | 'Content-Language' | 'Content-Length' | 'Content-Location' | 'Content-Range' | 'Content-Security-Policy' | 'Content-Security-Policy-Report-Only' | 'Content-Type' | 'Cookie' | 'Cross-Origin-Embedder-Policy' | 'Cross-Origin-Opener-Policy' | 'Cross-Origin-Resource-Policy' | 'Date' | 'ETag' | 'Expires' | 'Last-Modified' | 'Location' | 'Permissions-Policy' | 'Pragma' | 'Retry-After' | 'Save-Data' | 'Sec-CH-Prefers-Color-Scheme' | 'Sec-CH-Prefers-Reduced-Motion' | 'Sec-CH-UA' | 'Sec-CH-UA-Arch' | 'Sec-CH-UA-Bitness' | 'Sec-CH-UA-Form-Factor' | 'Sec-CH-UA-Full-Version' | 'Sec-CH-UA-Full-Version-List' | 'Sec-CH-UA-Mobile' | 'Sec-CH-UA-Model' | 'Sec-CH-UA-Platform' | 'Sec-CH-UA-Platform-Version' | 'Sec-CH-UA-WoW64' | 'Sec-Fetch-Dest' | 'Sec-Fetch-Mode' | 'Sec-Fetch-Site' | 'Sec-Fetch-User' | 'Sec-GPC' | 'Server' | 'Server-Timing' | 'Service-Worker-Navigation-Preload' | 'Set-Cookie' | 'Strict-Transport-Security' | 'Timing-Allow-Origin' | 'Trailer' | 'Transfer-Encoding' | 'Upgrade' | 'Vary' | 'WWW-Authenticate' | 'Warning' | 'X-Content-Type-Options' | 'X-DNS-Prefetch-Control' | 'X-Frame-Options' | 'X-Permitted-Cross-Domain-Policies' | 'X-Powered-By' | 'X-Robots-Tag' | 'X-XSS-Protection'; declare type ResponseHeadersInit = [string, string][] | Record<'Content-Type', BaseMime> | Record | Record | Headers; declare interface ResponseInit_2 { headers?: ResponseHeadersInit; status?: T; statusText?: string; } declare type ResponseOrInit = ResponseInit_2 | Response; /** * Type representing the result of a route match. * * The result can be in one of two formats: * 1. An array of handlers with their corresponding parameter index maps, followed by a parameter stash. * 2. An array of handlers with their corresponding parameter maps. * * Example: * * [[handler, paramIndexMap][], paramArray] * ```typescript * [ * [ * [middlewareA, {}], // '*' * [funcA, {'id': 0}], // '/user/:id/*' * [funcB, {'id': 0, 'action': 1}], // '/user/:id/:action' * ], * ['123', 'abc'] * ] * ``` * * [[handler, params][]] * ```typescript * [ * [ * [middlewareA, {}], // '*' * [funcA, {'id': '123'}], // '/user/:id/*' * [funcB, {'id': '123', 'action': 'abc'}], // '/user/:id/:action' * ] * ] * ``` */ declare type Result = [[T, ParamIndexMap][], ParamStash] | [[T, Params][]]; declare type ResultNode = { type: 'affectedRows'; } | { type: 'object'; fields: Record; serializedName: string | null; skipNulls: boolean; } | { type: 'field'; dbName: string; fieldType: FieldType; }; /** * Interface representing a router. * * @template T - The type of the handler. */ declare interface Router { /** * The name of the router. */ name: string; /** * Adds a route to the router. * * @param method - The HTTP method (e.g., 'get', 'post'). * @param path - The path for the route. * @param handler - The handler for the route. */ add(method: string, path: string, handler: T): void; /** * Matches a route based on the given method and path. * * @param method - The HTTP method (e.g., 'get', 'post'). * @param path - The path to match. * @returns The result of the match. */ match(method: string, path: string): Result; } declare interface RouterRoute { basePath: string; path: string; method: string; handler: H; } declare type Schema = { [Path: string]: { [Method: `$${Lowercase}`]: Endpoint; }; }; /** * `provider` property as defined in Prisma Schema (may differ from {@link @prisma/driver-adapter-utils#Provider}). */ declare type SchemaProvider = 'cockroachdb' | 'mongodb' | 'mysql' | 'postgres' | 'postgresql' | 'prisma+postgres' | 'sqlite' | 'sqlserver'; /** * A query plan executor server compatible with `@hono/node-server`, `Deno.serve` etc. */ export declare class Server { #private; private constructor(); static create(options: Options): Promise; get fetch(): HonoServer['fetch']; shutdown(): Promise; } declare type ServerErrorStatusCode = 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 510 | 511; /** * Interface for setting context variables. * * @template E - Environment type. */ declare interface Set_2 { (key: Key, value: E['Variables'][Key]): void; (key: Key, value: ContextVariableMap[Key]): void; } declare interface SetHeaders { (name: 'Content-Type', value?: BaseMime, options?: SetHeadersOptions): void; (name: ResponseHeader, value?: string, options?: SetHeadersOptions): void; (name: string, value?: string, options?: SetHeadersOptions): void; } declare interface SetHeadersOptions { append?: boolean; } /** * Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. * @copyright from sindresorhus/type-fest */ declare type Simplify = { [KeyType in keyof T]: T[KeyType]; } & {}; declare type SimplifyBodyData = { [K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K] ? string | File | (string | File)[] | BodyDataValueDotAll : string | File | BodyDataValueDot extends T[K] ? string | File | BodyDataValueDot : string | File | (string | File)[] extends T[K] ? string | File | (string | File)[] : string | File; } & {}; /** * An interface that represents a span. A span represents a single operation * within a trace. Examples of span might include remote procedure calls or a * in-process function calls to sub-components. A Trace has a single, top-level * "root" Span that in turn may have zero or more child Spans, which in turn * may have children. * * Spans are created by the {@link Tracer.startSpan} method. */ declare interface Span { /** * Returns the {@link SpanContext} object associated with this Span. * * Get an immutable, serializable identifier for this span that can be used * to create new child spans. Returned SpanContext is usable even after the * span ends. * * @returns the SpanContext object associated with this Span. */ spanContext(): SpanContext; /** * Sets an attribute to the span. * * Sets a single Attribute with the key and value passed as arguments. * * @param key the key for this attribute. * @param value the value for this attribute. Setting a value null or * undefined is invalid and will result in undefined behavior. */ setAttribute(key: string, value: SpanAttributeValue): this; /** * Sets attributes to the span. * * @param attributes the attributes that will be added. * null or undefined attribute values * are invalid and will result in undefined behavior. */ setAttributes(attributes: SpanAttributes): this; /** * Adds an event to the Span. * * @param name the name of the event. * @param [attributesOrStartTime] the attributes that will be added; these are * associated with this event. Can be also a start time * if type is {@type TimeInput} and 3rd param is undefined * @param [startTime] start time of the event. */ addEvent(name: string, attributesOrStartTime?: SpanAttributes | TimeInput, startTime?: TimeInput): this; /** * Adds a single link to the span. * * Links added after the creation will not affect the sampling decision. * It is preferred span links be added at span creation. * * @param link the link to add. */ addLink(link: Link): this; /** * Adds multiple links to the span. * * Links added after the creation will not affect the sampling decision. * It is preferred span links be added at span creation. * * @param links the links to add. */ addLinks(links: Link[]): this; /** * Sets a status to the span. If used, this will override the default Span * status. Default is {@link SpanStatusCode.UNSET}. SetStatus overrides the value * of previous calls to SetStatus on the Span. * * @param status the SpanStatus to set. */ setStatus(status: SpanStatus): this; /** * Updates the Span name. * * This will override the name provided via {@link Tracer.startSpan}. * * Upon this update, any sampling behavior based on Span name will depend on * the implementation. * * @param name the Span name. */ updateName(name: string): this; /** * Marks the end of Span execution. * * Call to End of a Span MUST not have any effects on child spans. Those may * still be running and can be ended later. * * Do not return `this`. The Span generally should not be used after it * is ended so chaining is not desired in this context. * * @param [endTime] the time to set as Span's end time. If not provided, * use the current time as the span's end time. */ end(endTime?: TimeInput): void; /** * Returns the flag whether this span will be recorded. * * @returns true if this Span is active and recording information like events * with the `AddEvent` operation and attributes using `setAttributes`. */ isRecording(): boolean; /** * Sets exception as a span event * @param exception the exception the only accepted values are string or Error * @param [time] the time to set as Span's event time. If not provided, * use the current time. */ recordException(exception: Exception, time?: TimeInput): void; } /** * @deprecated please use {@link Attributes} */ declare type SpanAttributes = Attributes; /** * @deprecated please use {@link AttributeValue} */ declare type SpanAttributeValue = AttributeValue; declare type SpanCallback = (span?: Span, context?: Context) => R; /** * A SpanContext represents the portion of a {@link Span} which must be * serialized and propagated along side of a {@link Baggage}. */ declare interface SpanContext { /** * The ID of the trace that this span belongs to. It is worldwide unique * with practically sufficient probability by being made as 16 randomly * generated bytes, encoded as a 32 lowercase hex characters corresponding to * 128 bits. */ traceId: string; /** * The ID of the Span. It is globally unique with practically sufficient * probability by being made as 8 randomly generated bytes, encoded as a 16 * lowercase hex characters corresponding to 64 bits. */ spanId: string; /** * Only true if the SpanContext was propagated from a remote parent. */ isRemote?: boolean; /** * Trace flags to propagate. * * It is represented as 1 byte (bitmap). Bit to represent whether trace is * sampled or not. When set, the least significant bit documents that the * caller may have recorded trace data. A caller who does not record trace * data out-of-band leaves this flag unset. * * see {@link TraceFlags} for valid flag values. */ traceFlags: number; /** * Tracing-system-specific info to propagate. * * The tracestate field value is a `list` as defined below. The `list` is a * series of `list-members` separated by commas `,`, and a list-member is a * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs * surrounding `list-members` are ignored. There can be a maximum of 32 * `list-members` in a `list`. * More Info: https://www.w3.org/TR/trace-context/#tracestate-field * * Examples: * Single tracing system (generic format): * tracestate: rojo=00f067aa0ba902b7 * Multiple tracing systems (with different formatting): * tracestate: rojo=00f067aa0ba902b7,congo=t61rcWkgMzE */ traceState?: TraceState; } /** * OpenTelemetry span ID. * * `@opentelemetry/api` uses plain `string` as a type and documents the * additional requirements, we can have a better type. */ declare type SpanId = string & { length: 16; }; declare enum SpanKind { /** Default value. Indicates that the span is used internally. */ INTERNAL = 0, /** * Indicates that the span covers server-side handling of an RPC or other * remote request. */ SERVER = 1, /** * Indicates that the span covers the client-side wrapper around an RPC or * other remote request. */ CLIENT = 2, /** * Indicates that the span describes producer sending a message to a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ PRODUCER = 3, /** * Indicates that the span describes consumer receiving a message from a * broker. Unlike client and server, there is no direct critical path latency * relationship between producer and consumer spans. */ CONSUMER = 4 } /** * Options needed for span creation */ declare interface SpanOptions { /** * The SpanKind of a span * @default {@link SpanKind.INTERNAL} */ kind?: SpanKind; /** A span's attributes */ attributes?: SpanAttributes; /** {@link Link}s span to other spans */ links?: Link[]; /** A manually specified start time for the created `Span` object. */ startTime?: TimeInput; /** The new span should be a root span. (Ignore parent from context). */ root?: boolean; } declare interface SpanStatus { /** The status code of this message. */ code: SpanStatusCode; /** A developer-facing error message. */ message?: string; } /** * An enumeration of status codes. */ declare enum SpanStatusCode { /** * The default status. */ UNSET = 0, /** * The operation has been validated by an Application developer or * Operator to have completed successfully. */ OK = 1, /** * The operation contains an error. */ ERROR = 2 } export declare interface SqlDriverAdapter extends SqlQueryable { /** * Execute multiple SQL statements separated by semicolon. */ executeScript(script: string): Promise; /** * Start new transaction. */ startTransaction(isolationLevel?: IsolationLevel): Promise; /** * Optional method that returns extra connection info */ getConnectionInfo?(): ConnectionInfo; /** * Dispose of the connection and release any resources. */ dispose(): Promise; } declare type SqlQuery = { sql: string; args: Array; argTypes: Array; }; declare interface SqlQueryable extends Queryable { } declare interface SqlResultSet { /** * List of column types appearing in a database query, in the same order as `columnNames`. * They are used within the Query Engine to convert values from JS to Quaint values. */ columnTypes: Array; /** * List of column names appearing in a database query, in the same order as `columnTypes`. */ columnNames: Array; /** * List of rows retrieved from a database query. * Each row is a list of values, whose length matches `columnNames` and `columnTypes`. */ rows: Array>; /** * The last ID of an `INSERT` statement, if any. * This is required for `AUTO_INCREMENT` columns in databases based on MySQL and SQLite. */ lastInsertId?: string; } /** * If you want to use an unofficial status, use `UnofficialStatusCode`. */ declare type StatusCode = InfoStatusCode | SuccessStatusCode | RedirectStatusCode | ClientErrorStatusCode | ServerErrorStatusCode | UnofficialStatusCode; declare type SuccessStatusCode = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 226; export { Temporal } /** * Interface for responding with text. * * @interface TextRespond * @template T - The type of the text content. * @template U - The type of the status code. * * @param {T} text - The text content to be included in the response. * @param {U} [status] - An optional status code for the response. * @param {HeaderRecord} [headers] - An optional record of headers to include in the response. * * @returns {Response & TypedResponse} - The response after rendering the text content, typed with the provided text and status code types. */ declare interface TextRespond { (text: T, status?: U, headers?: HeaderRecord): Response & TypedResponse; (text: T, init?: ResponseOrInit): Response & TypedResponse; } /** * Defines TimeInput. * * hrtime, epoch milliseconds, performance.now() or Date */ declare type TimeInput = HrTime | number | Date; declare type ToSchema = Simplify<{ [K in P]: { [K2 in M as AddDollar]: Simplify<{ input: AddParam, P>; } & (IsAny extends true ? { output: {}; outputFormat: ResponseFormat; status: StatusCode; } : RorO extends TypedResponse ? { output: unknown extends T ? {} : T; outputFormat: I extends { outputFormat: string; } ? I['outputFormat'] : F; status: U; } : { output: unknown extends RorO ? {} : RorO; outputFormat: unknown extends RorO ? 'json' : I extends { outputFormat: string; } ? I['outputFormat'] : 'json'; status: StatusCode; })>; }; }>; /** * OpenTelemetry trace ID. * * `@opentelemetry/api` uses plain `string` as a type and documents the * additional requirements, we can have a better type. */ declare type TraceId = string & { length: 32; }; /** * Tracer provides an interface for creating {@link Span}s. */ declare interface Tracer { /** * Starts a new {@link Span}. Start the span without setting it on context. * * This method do NOT modify the current Context. * * @param name The name of the span * @param [options] SpanOptions used for span creation * @param [context] Context to use to extract parent * @returns Span The newly created span * @example * const span = tracer.startSpan('op'); * span.setAttribute('key', 'value'); * span.end(); */ startSpan(name: string, options?: SpanOptions, context?: Context): Span; /** * Starts a new {@link Span} and calls the given function passing it the * created span as first argument. * Additionally the new span gets set in context and this context is activated * for the duration of the function call. * * @param name The name of the span * @param [options] SpanOptions used for span creation * @param [context] Context to use to extract parent * @param fn function called in the context of the span and receives the newly created span as an argument * @returns return value of fn * @example * const something = tracer.startActiveSpan('op', span => { * try { * do some work * span.setStatus({code: SpanStatusCode.OK}); * return something; * } catch (err) { * span.setStatus({ * code: SpanStatusCode.ERROR, * message: err.message, * }); * throw err; * } finally { * span.end(); * } * }); * * @example * const span = tracer.startActiveSpan('op', span => { * try { * do some work * return span; * } catch (err) { * span.setStatus({ * code: SpanStatusCode.ERROR, * message: err.message, * }); * throw err; * } * }); * do some more work * span.end(); */ startActiveSpan unknown>(name: string, fn: F): ReturnType; startActiveSpan unknown>(name: string, options: SpanOptions, fn: F): ReturnType; startActiveSpan unknown>(name: string, options: SpanOptions, context: Context, fn: F): ReturnType; } declare interface TraceState { /** * Create a new TraceState which inherits from this TraceState and has the * given key set. * The new entry will always be added in the front of the list of states. * * @param key key of the TraceState entry. * @param value value of the TraceState entry. */ set(key: string, value: string): TraceState; /** * Return a new TraceState which inherits from this TraceState but does not * contain the given key. * * @param key the key for the TraceState entry to be removed. */ unset(key: string): TraceState; /** * Returns the value to which the specified key is mapped, or `undefined` if * this map contains no mapping for the key. * * @param key with which the specified value is to be associated. * @returns the value to which the specified key is mapped, or `undefined` if * this map contains no mapping for the key. */ get(key: string): string | undefined; /** * Serializes the TraceState to a `list` as defined below. The `list` is a * series of `list-members` separated by commas `,`, and a list-member is a * key/value pair separated by an equals sign `=`. Spaces and horizontal tabs * surrounding `list-members` are ignored. There can be a maximum of 32 * `list-members` in a `list`. * * @returns the serialized string. */ serialize(): string; } /** * An implementation of {@link TracingHelper} from `@prisma/client-engine-runtime` * that both hooks into into the real OpenTelemetry instrumentation and, if there * is an active {@link TracingCollector}, converts the spans into the format * expected by the client and sends them to the collector. */ declare class TracingHandler implements TracingHelper { #private; constructor(tracer: Tracer); runInChildSpan(nameOrOptions: string | ExtendedSpanOptions_2, callback: (span?: Span, context?: Context) => R): R; } declare interface TracingHelper { runInChildSpan(nameOrOptions: string | ExtendedSpanOptions, callback: SpanCallback): R; } declare interface Transaction extends AdapterInfo, SqlQueryable { /** * Transaction options. */ readonly options: TransactionOptions; /** * Commit the transaction. */ commit(): Promise; /** * Roll back the transaction. */ rollback(): Promise; } declare type TransactionInfo = { id: string; }; export declare class TransactionManager { #private; private transactions; private closedTransactions; private readonly driverAdapter; private readonly transactionOptions; private readonly tracingHelper; constructor({ driverAdapter, transactionOptions, tracingHelper, onQuery, provider, }: { driverAdapter: SqlDriverAdapter; transactionOptions: TransactionOptions_2; tracingHelper: TracingHelper; onQuery?: (event: QueryEvent) => void; provider?: SchemaProvider; }); /** * Starts an internal transaction. The difference to `startTransaction` is that it does not * use the default transaction options from the `TransactionManager`, which in practice means * that it does not apply the default timeouts. */ startInternalTransaction(options?: TransactionOptions_2): Promise; startTransaction(options?: TransactionOptions_2): Promise; commitTransaction(transactionId: string): Promise; rollbackTransaction(transactionId: string): Promise; getTransaction(txInfo: TransactionInfo, operation: string): Promise; cancelAllTransactions(): Promise; } declare type TransactionOptions = { usePhantomQuery: boolean; }; declare type TransactionOptions_2 = { maxWait?: number; timeout?: number; isolationLevel?: IsolationLevel; }; declare type TypedResponse = { _data: T; _status: U; _format: F; }; declare type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never; /** * `UnofficialStatusCode` can be used to specify an unofficial status code. * @example * * ```ts * app.get('/unknown', (c) => { * return c.text("Unknown Error", 520 as UnofficialStatusCode) * }) * ``` */ declare type UnofficialStatusCode = -1; declare type ValidationError = { error_identifier: 'RELATION_VIOLATION'; context: { relation: string; modelA: string; modelB: string; }; } | { error_identifier: 'MISSING_RELATED_RECORD'; context: { model: string; relation: string; relationType: string; operation: string; neededFor?: string; }; } | { error_identifier: 'MISSING_RECORD'; context: { operation: string; }; } | { error_identifier: 'INCOMPLETE_CONNECT_INPUT'; context: { expectedRows: number; }; } | { error_identifier: 'INCOMPLETE_CONNECT_OUTPUT'; context: { expectedRows: number; relation: string; relationType: string; }; } | { error_identifier: 'RECORDS_NOT_CONNECTED'; context: { relation: string; parent: string; child: string; }; }; declare type ValidationTargets = { json: any; form: Record; query: Record; param: Record; header: Record; cookie: Record; }; /** * List of all supported log levels. */ declare const validLogLevels: readonly ["debug", "query", "info", "warn", "error"]; declare type Variables = object; export { version } /** * Logs a warning message using the active logger. * * @param message The message to log * @param attributes Optional key-value pairs to include with the log event * @throws {Error} if no active logger is found */ declare function warn(message: string, attributes?: ExtendedAttributes): void; /** * Runs a function with a new OpenTelemetry context containing the provided logger. * * @param logger The logger to make active * @param fn The function to run with the logger in context * @returns The return value of the function */ export declare function withActiveLogger(logger: Logger, fn: () => T): T; export { }