import { type TObject, type TSchema, type TModule, type TRef, type TAnySchema } from '@sinclair/typebox';
import type { Context } from './context';
import { type Sucrose } from './sucrose';
import type { WSLocalHook } from './ws/types';
import type { ElysiaAdapter } from './adapter/types';
import type { ListenCallback, Serve, Server } from './universal/server';
import { PromiseGroup } from './utils';
import { ValidationError, type ParseError, type NotFoundError, type InternalServerError, type ElysiaCustomStatusResponse } from './error';
import type { TraceHandler } from './trace';
import type { ElysiaConfig, SingletonBase, DefinitionBase, Handler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, PreHandler, BodyHandler, OptionalHandler, ErrorHandler, LifeCycleStore, MaybePromise, Prettify, AddPrefix, AddSuffix, AddPrefixCapitalize, AddSuffixCapitalize, MaybeArray, GracefulHandler, MapResponse, MacroToProperty, TransformHandler, MetadataBase, RouteBase, CreateEden, ComposeElysiaResponse, InlineHandler, HookContainer, LifeCycleType, EphemeralType, ExcludeElysiaResponse, ModelValidator, ContextAppendType, Reconcile, AfterResponseHandler, HigherOrderFunction, ResolvePath, JoinPath, ValidatorLayer, MergeElysiaInstances, Macro, MacroToContext, StandaloneValidator, GuardSchemaType, Or, DocumentDecoration, AfterHandler, NonResolvableMacroKey, StandardSchemaV1Like, ElysiaHandlerToResponseSchema, ElysiaHandlerToResponseSchemas, ExtractErrorFromHandle, ElysiaHandlerToResponseSchemaAmbiguous, GuardLocalHook, PickIfExists, SimplifyToSchema, UnionResponseStatus, CreateEdenResponse, MacroProperty, MaybeValueOrVoidFunction, IntersectIfObjectSchema, UnknownRouteSchema, MaybeFunction, InlineHandlerNonMacro, Router } from './types';
export type AnyElysia = Elysia<any, any, any, any, any, any, any>;
/**
 * ### Elysia Server
 * Main instance to create web server using Elysia
 *
 * ---
 * @example
 * ```typescript
 * import { Elysia } from 'elysia'
 *
 * new Elysia()
 *     .get("/", () => "Hello")
 *     .listen(3000)
 * ```
 */
export default class Elysia<const in out BasePath extends string = '', const in out Singleton extends SingletonBase = {
    decorator: {};
    store: {};
    derive: {};
    resolve: {};
}, const in out Definitions extends DefinitionBase = {
    typebox: {};
    error: {};
}, const in out Metadata extends MetadataBase = {
    schema: {};
    standaloneSchema: {};
    macro: {};
    macroFn: {};
    parser: {};
    response: {};
}, const in out Routes extends RouteBase = {}, const in out Ephemeral extends EphemeralType = {
    derive: {};
    resolve: {};
    schema: {};
    standaloneSchema: {};
    response: {};
}, const in out Volatile extends EphemeralType = {
    derive: {};
    resolve: {};
    schema: {};
    standaloneSchema: {};
    response: {};
}> {
    config: ElysiaConfig<BasePath>;
    server: Server | null;
    private dependencies;
    '~Prefix': BasePath;
    '~Singleton': Singleton;
    '~Definitions': Definitions;
    '~Metadata': Metadata;
    '~Ephemeral': Ephemeral;
    '~Volatile': Volatile;
    '~Routes': Routes;
    protected singleton: SingletonBase;
    get store(): Singleton['store'];
    get decorator(): Singleton['decorator'];
    protected definitions: {
        typebox: TModule<{}, {}>;
        type: Record<string, TSchema | StandardSchemaV1Like>;
        error: Record<string, Error>;
    };
    protected extender: {
        macro: Macro;
        higherOrderFunctions: HookContainer<HigherOrderFunction>[];
    };
    protected validator: ValidatorLayer;
    protected standaloneValidator: StandaloneValidator;
    event: Partial<LifeCycleStore>;
    protected telemetry: undefined | {
        stack: string | undefined;
    };
    router: Router;
    protected routeTree: Record<string, number>;
    get routes(): InternalRoute[];
    protected getGlobalRoutes(): InternalRoute[];
    protected getGlobalDefinitions(): {
        typebox: TModule<{}, {}>;
        type: Record<string, TSchema | StandardSchemaV1Like>;
        error: Record<string, Error>;
    };
    protected inference: Sucrose.Inference;
    private getServer;
    private getParent;
    '~parser': {
        [K: string]: BodyHandler<any, any>;
    };
    private _promisedModules;
    private get promisedModules();
    constructor(config?: ElysiaConfig<BasePath>);
    '~adapter': ElysiaAdapter;
    env(model: TObject, _env?: NodeJS.ProcessEnv): this;
    /**
     * @private DO_NOT_USE_OR_YOU_WILL_BE_FIRED
     * @version 1.1.0
     *
     * ! Do not use unless you know exactly what you are doing
     * ? Add Higher order function to Elysia.fetch
     */
    wrap(fn: HigherOrderFunction): this;
    get models(): {
        [K in keyof Definitions['typebox']]: ModelValidator<Definitions['typebox'][K]>;
    } & {
        modules: TModule<Extract<Definitions['typebox'], TAnySchema>> | Extract<Definitions['typebox'], StandardSchemaV1Like>;
    };
    private add;
    private setHeaders?;
    headers(header: Context['set']['headers'] | undefined): this;
    /**
     * ### start | Life cycle event
     * Called after server is ready for serving
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onStart(({ server }) => {
     *         console.log("Running at ${server?.url}:${server?.port}")
     *     })
     *     .listen(3000)
     * ```
     */
    onStart(handler: MaybeArray<GracefulHandler<this>>): this;
    /**
     * ### request | Life cycle event
     * Called on every new request is accepted
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onRequest(({ method, url }) => {
     *         saveToAnalytic({ method, url })
     *     })
     * ```
     */
    onRequest<const Schema extends RouteSchema, const Handler extends PreHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: {};
        resolve: {};
    }>>(handler: Handler): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### request | Life cycle event
     * Called on every new request is accepted
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onRequest(({ method, url }) => {
     *         saveToAnalytic({ method, url })
     *     })
     * ```
     */
    onRequest<const Schema extends RouteSchema, const Handlers extends PreHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: {};
        resolve: {};
    }>[]>(handler: Handlers): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### parse | Life cycle event
     * Callback function to handle body parsing
     *
     * If truthy value is returned, will be assigned to `context.body`
     * Otherwise will skip the callback and look for the next one.
     *
     * Equivalent to Express's body parser
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onParse((request, contentType) => {
     *         if(contentType === "application/json")
     *             return request.json()
     *     })
     * ```
     */
    onParse<const Schema extends RouteSchema>(parser: MaybeArray<BodyHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: {};
    }>>): this;
    /**
     * ### parse | Life cycle event
     * Callback function to handle body parsing
     *
     * If truthy value is returned, will be assigned to `context.body`
     * Otherwise will skip the callback and look for the next one.
     *
     * Equivalent to Express's body parser
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onParse((request, contentType) => {
     *         if(contentType === "application/json")
     *             return request.json()
     *     })
     * ```
     */
    onParse<const Schema extends RouteSchema, const Type extends LifeCycleType>(options: {
        as: Type;
    }, parser: MaybeArray<BodyHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, 'global' extends Type ? {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: {};
    } : 'scoped' extends Type ? {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: {};
    } : {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: {};
    }>>): this;
    onParse<const Parsers extends keyof Metadata['parser']>(parser: Parsers): this;
    /**
     * ### parse | Life cycle event
     * Callback function to handle body parsing
     *
     * If truthy value is returned, will be assigned to `context.body`
     * Otherwise will skip the callback and look for the next one.
     *
     * Equivalent to Express's body parser
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onParse((request, contentType) => {
     *         if(contentType === "application/json")
     *             return request.json()
     *     })
     * ```
     */
    parser<const Parser extends string, const Schema extends RouteSchema, const Handler extends BodyHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: {};
    }>>(name: Parser, parser: Handler): Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'] & {
            [K in Parser]: Handler;
        };
        response: Metadata['response'];
    }, Routes, Ephemeral, Volatile>;
    /**
     * ### transform | Life cycle event
     * Assign or transform anything related to context before validation.
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onTransform(({ params }) => {
     *         if(params.id)
     *             params.id = +params.id
     *     })
     * ```
     */
    onTransform<const Schema extends RouteSchema>(handler: MaybeArray<TransformHandler<UnknownRouteSchema<ResolvePath<BasePath>>, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: {};
    }>>): this;
    /**
     * ### transform | Life cycle event
     * Assign or transform anything related to context before validation.
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onTransform(({ params }) => {
     *         if(params.id)
     *             params.id = +params.id
     *     })
     * ```
     */
    onTransform<const Schema extends RouteSchema, const Type extends LifeCycleType>(options: {
        as: Type;
    }, handler: MaybeArray<TransformHandler<UnknownRouteSchema<'global' extends Type ? {
        [name: string]: string | undefined;
    } : 'scoped' extends Type ? {
        [name: string]: string | undefined;
    } : ResolvePath<BasePath>>, 'global' extends Type ? {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: {};
    } : 'scoped' extends Type ? {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: {};
    } : {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: {};
    }>>): this;
    /**
     * Derive new property for each request with access to `Context`.
     *
     * If error is thrown, the scope will skip to handling error instead.
     *
     * ---
     * @example
     * new Elysia()
     *     .state('counter', 1)
     *     .derive(({ store }) => ({
     *         increase() {
     *             store.counter++
     *         }
     *     }))
     */
    resolve<const Resolver extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any>, const Type extends LifeCycleType>(options: {
        as: Type;
    }, resolver: (context: Context<MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    })>) => MaybePromise<Resolver | void>): Type extends 'global' ? Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'] & ExcludeElysiaResponse<Resolver>;
    }, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ExtractErrorFromHandle<Resolver>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'] & ExcludeElysiaResponse<Resolver>;
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ExtractErrorFromHandle<Resolver>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & ExcludeElysiaResponse<Resolver>;
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<Resolver>>;
    }>;
    /**
     * Derive new property for each request with access to `Context`.
     *
     * If error is thrown, the scope will skip to handling error instead.
     *
     * ---
     * @example
     * new Elysia()
     *     .state('counter', 1)
     *     .derive(({ store }) => ({
     *         increase() {
     *             store.counter++
     *         }
     *     }))
     */
    resolve<const Resolver extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any> | void>(resolver: (context: Context<MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, BasePath>) => MaybePromise<Resolver | void>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & ExcludeElysiaResponse<Resolver>;
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<Resolver>>;
    }>;
    mapResolve<const NewResolver extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any>>(mapper: (context: Context<MergeSchema<Metadata['schema'], MergeSchema<Ephemeral['schema'], Volatile['schema']>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, BasePath>) => MaybePromise<NewResolver | void>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: ExcludeElysiaResponse<NewResolver>;
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<NewResolver>>;
    }>;
    mapResolve<const NewResolver extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any>, const Type extends LifeCycleType>(options: {
        as: Type;
    }, mapper: (context: Context<MergeSchema<Metadata['schema'], MergeSchema<Ephemeral['schema'], Volatile['schema']>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    })>) => MaybePromise<NewResolver | void>): Type extends 'global' ? Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: ExcludeElysiaResponse<NewResolver>;
    }, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ExtractErrorFromHandle<NewResolver>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'] & ExcludeElysiaResponse<NewResolver>;
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ExtractErrorFromHandle<NewResolver>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & ExcludeElysiaResponse<NewResolver>;
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<NewResolver>>;
    }>;
    /**
     * ### Before Handle | Life cycle event
     * Execute after validation and before the main route handler.
     *
     * If truthy value is returned, will be assigned as `Response` and skip the main handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onBeforeHandle(({ params: { id }, status }) => {
     *         if(id && !isExisted(id)) {
     * 	           status(401)
     *
     *             return "Unauthorized"
     * 	       }
     *     })
     * ```
     */
    onBeforeHandle<const Schema extends RouteSchema, const Handler extends OptionalHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>>(handler: Handler): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### Before Handle | Life cycle event
     * Execute after validation and before the main route handler.
     *
     * If truthy value is returned, will be assigned as `Response` and skip the main handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onBeforeHandle(({ params: { id }, status }) => {
     *         if(id && !isExisted(id)) {
     * 	           status(401)
     *
     *             return "Unauthorized"
     * 	       }
     *     })
     * ```
     */
    onBeforeHandle<const Schema extends RouteSchema, const Handlers extends OptionalHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>[]>(handlers: Handlers): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }>;
    /**
     * ### Before Handle | Life cycle event
     * Execute after validation and before the main route handler.
     *
     * If truthy value is returned, will be assigned as `Response` and skip the main handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onBeforeHandle(({ params: { id }, status }) => {
     *         if(id && !isExisted(id)) {
     * 	           status(401)
     *
     *             return "Unauthorized"
     * 	       }
     *     })
     * ```
     */
    onBeforeHandle<const Schema extends RouteSchema, const Type extends LifeCycleType, const Handler extends OptionalHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }), BasePath>>(options: {
        as: Type;
    }, handler: Handler): Type extends 'global' ? Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### Before Handle | Life cycle event
     * Execute after validation and before the main route handler.
     *
     * If truthy value is returned, will be assigned as `Response` and skip the main handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onBeforeHandle(({ params: { id }, status }) => {
     *         if(id && !isExisted(id)) {
     * 	           status(401)
     *
     *             return "Unauthorized"
     * 	       }
     *     })
     * ```
     */
    onBeforeHandle<const Schema extends RouteSchema, const Type extends LifeCycleType, const Handlers extends OptionalHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }), BasePath>[]>(options: {
        as: Type;
    }, handlers: Handlers): Type extends 'global' ? Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }>;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterHandle((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    onAfterHandle<const Schema extends RouteSchema, const Handler extends AfterHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>>(handler: Handler): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterHandle((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    onAfterHandle<const Schema extends RouteSchema, const Handlers extends AfterHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>[]>(handlers: Handlers): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }>;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterHandle((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    onAfterHandle<const Schema extends RouteSchema, const Type extends LifeCycleType, const Handler extends AfterHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    })>>(options: {
        as: Type;
    }, handler: Handler): Type extends 'global' ? Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterHandle((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    onAfterHandle<const Schema extends RouteSchema, const Type extends LifeCycleType, const Handlers extends AfterHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    })>[]>(options: {
        as: Type;
    }, handler: Handlers): Type extends 'global' ? Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }>;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .mapResponse((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    mapResponse<const Schema extends RouteSchema>(handler: MaybeArray<MapResponse<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>>): this;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .mapResponse((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    mapResponse<const Schema extends RouteSchema, Type extends LifeCycleType>(options: {
        as: Type;
    }, handler: MaybeArray<MapResponse<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    })>>): this;
    /**
     * ### response | Life cycle event
     * Call AFTER main handler is executed
     * Good for analytic metrics
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterResponse(() => {
     *         cleanup()
     *     })
     * ```
     */
    onAfterResponse<const Schema extends RouteSchema>(handler: MaybeArray<AfterResponseHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>>): this;
    /**
     * ### response | Life cycle event
     * Call AFTER main handler is executed
     * Good for analytic metrics
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterResponse(() => {
     *         cleanup()
     * 	   })
     * ```
     */
    onAfterResponse<const Schema extends RouteSchema, const Type extends LifeCycleType>(options: {
        as: Type;
    }, handler: MaybeArray<AfterResponseHandler<MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    })>>): this;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterHandle((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    trace<const Schema extends RouteSchema>(handler: MaybeArray<TraceHandler<Schema, Singleton>>): this;
    /**
     * ### After Handle | Life cycle event
     * Intercept request **after** main handler is called.
     *
     * If truthy value is returned, will be assigned as `Response`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onAfterHandle((context, response) => {
     *         if(typeof response === "object")
     *             return JSON.stringify(response)
     *     })
     * ```
     */
    trace<const Schema extends RouteSchema>(options: {
        as: LifeCycleType;
    }, handler: MaybeArray<TraceHandler<Schema, Singleton>>): this;
    /**
     * Register errors
     *
     * ---
     * @example
     * ```typescript
     * class CustomError extends Error {
     *     constructor() {
     *         super()
     *     }
     * }
     *
     * new Elysia()
     *     .error('CUSTOM_ERROR', CustomError)
     * ```
     */
    error<const Errors extends Record<string, {
        prototype: Error;
    }>>(errors: Errors): Elysia<BasePath, Singleton, {
        typebox: Definitions['typebox'];
        error: Definitions['error'] & {
            [K in keyof Errors]: Errors[K] extends {
                prototype: infer LiteralError extends Error;
            } ? LiteralError : Errors[K];
        };
    }, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * Register errors
     *
     * ---
     * @example
     * ```typescript
     * class CustomError extends Error {
     *     constructor() {
     *         super()
     *     }
     * }
     *
     * new Elysia()
     *     .error({
     *         CUSTOM_ERROR: CustomError
     *     })
     * ```
     */
    error<Name extends string, const CustomError extends {
        prototype: Error;
    }>(name: Name, errors: CustomError): Elysia<BasePath, Singleton, {
        typebox: Definitions['typebox'];
        error: Definitions['error'] & {
            [name in Name]: CustomError extends {
                prototype: infer LiteralError extends Error;
            } ? LiteralError : CustomError;
        };
    }, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * Register errors
     *
     * ---
     * @example
     * ```typescript
     * class CustomError extends Error {
     *     constructor() {
     *         super()
     *     }
     * }
     *
     * new Elysia()
     *     .error('CUSTOM_ERROR', CustomError)
     * ```
     */
    error<const NewErrors extends Record<string, Error>>(mapper: (decorators: Definitions['error']) => NewErrors): Elysia<BasePath, Singleton, {
        typebox: Definitions['typebox'];
        error: {
            [K in keyof NewErrors]: NewErrors[K] extends {
                prototype: infer LiteralError extends Error;
            } ? LiteralError : never;
        };
    }, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### Error | Life cycle event
     * Called when error is thrown during processing request
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onError(({ code }) => {
     *         if(code === "NOT_FOUND")
     *             return "Path not found :("
     *     })
     * ```
     */
    onError<const Schema extends RouteSchema, const Handler extends ErrorHandler<Definitions['error'], MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton, Ephemeral, Volatile>>(handler: Handler): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### Error | Life cycle event
     * Called when error is thrown during processing request
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onError(({ code }) => {
     *         if(code === "NOT_FOUND")
     *             return "Path not found :("
     *     })
     * ```
     */
    onError<const Schema extends RouteSchema, const Handlers extends ErrorHandler<Definitions['error'], MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton, Ephemeral, Volatile>[]>(handler: Handlers): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }>;
    /**
     * ### Error | Life cycle event
     * Called when error is thrown during processing request
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onError(({ code }) => {
     *         if(code === "NOT_FOUND")
     *             return "Path not found :("
     *     })
     * ```
     */
    onError<const Schema extends RouteSchema, const Type extends LifeCycleType, const Handler extends ErrorHandler<Definitions['error'], MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Type extends 'global' ? {
        store: Singleton['store'];
        decorator: Singleton['decorator'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: Singleton['resolve'] & Ephemeral['resolve'] & Volatile['resolve'];
    } : Type extends 'scoped' ? {
        store: Singleton['store'];
        decorator: Singleton['decorator'];
        derive: Singleton['derive'] & Ephemeral['derive'];
        resolve: Singleton['resolve'] & Ephemeral['resolve'];
    } : Singleton, Type extends 'global' ? Ephemeral : {
        derive: Partial<Ephemeral['derive']>;
        resolve: Partial<Ephemeral['resolve']>;
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: Ephemeral['response'];
    }, Type extends 'global' ? Ephemeral : Type extends 'scoped' ? Ephemeral : {
        derive: Partial<Ephemeral['derive']>;
        resolve: Partial<Ephemeral['resolve']>;
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: Ephemeral['response'];
    }>>(options: {
        as: Type;
    }, handler: Handler): Type extends 'global' ? Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchema<Handler>>;
    }>;
    /**
     * ### Error | Life cycle event
     * Called when error is thrown during processing request
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onError(({ code }) => {
     *         if(code === "NOT_FOUND")
     *             return "Path not found :("
     *     })
     * ```
     */
    onError<const Schema extends RouteSchema, const Type extends LifeCycleType, const Handlers extends ErrorHandler<Definitions['error'], MergeSchema<Schema, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Type extends 'global' ? {
        store: Singleton['store'];
        decorator: Singleton['decorator'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: Singleton['resolve'] & Ephemeral['resolve'] & Volatile['resolve'];
    } : Type extends 'scoped' ? {
        store: Singleton['store'];
        decorator: Singleton['decorator'];
        derive: Singleton['derive'] & Ephemeral['derive'];
        resolve: Singleton['resolve'] & Ephemeral['resolve'];
    } : Singleton, Type extends 'global' ? Ephemeral : {
        derive: Partial<Ephemeral['derive']>;
        resolve: Partial<Ephemeral['resolve']>;
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: Ephemeral['response'];
    }, Type extends 'global' ? Ephemeral : Type extends 'scoped' ? Ephemeral : {
        derive: Partial<Ephemeral['derive']>;
        resolve: Partial<Ephemeral['resolve']>;
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: Ephemeral['response'];
    }>[]>(options: {
        as: Type;
    }, handler: Handlers): Type extends 'global' ? Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ElysiaHandlerToResponseSchemas<Handlers>>;
    }>;
    /**
     * ### stop | Life cycle event
     * Called after server stop serving request
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .onStop((app) => {
     *         cleanup()
     *     })
     * ```
     */
    onStop(handler: MaybeArray<GracefulHandler<this>>): this;
    /**
     * ### on
     * Syntax sugar for attaching life cycle event by name
     *
     * Does the exact same thing as `.on[Event]()`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .on('error', ({ code }) => {
     *         if(code === "NOT_FOUND")
     *             return "Path not found :("
     *     })
     * ```
     */
    on<Event extends keyof LifeCycleStore>(type: Event, handlers: MaybeArray<Extract<LifeCycleStore[Event], HookContainer[]>[0]['fn']>): this;
    /**
     * ### on
     * Syntax sugar for attaching life cycle event by name
     *
     * Does the exact same thing as `.on[Event]()`
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .on('error', ({ code }) => {
     *         if(code === "NOT_FOUND")
     *             return "Path not found :("
     *     })
     * ```
     */
    on<const Event extends keyof LifeCycleStore>(options: {
        as: LifeCycleType;
    }, type: Event, handlers: MaybeArray<Extract<LifeCycleStore[Event], Function[]>[0]>): this;
    as(type: 'global'): Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & Ephemeral['derive'] & Volatile['derive'];
        resolve: Singleton['resolve'] & Ephemeral['resolve'] & Volatile['resolve'];
    }, Definitions, {
        schema: MergeSchema<MergeSchema<Volatile['schema'], Ephemeral['schema']>, Metadata['schema']>;
        standaloneSchema: Metadata['standaloneSchema'] & Volatile['standaloneSchema'] & Ephemeral['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: Metadata['response'] & Ephemeral['response'] & Volatile['response'];
    }, Routes, {
        derive: {};
        resolve: {};
        schema: {};
        standaloneSchema: {};
        response: {};
    }, {
        derive: {};
        resolve: {};
        schema: {};
        standaloneSchema: {};
        response: {};
    }>;
    as(type: 'scoped'): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
        schema: MergeSchema<Volatile['schema'], Ephemeral['schema']>;
        standaloneSchema: Volatile['standaloneSchema'] & Ephemeral['standaloneSchema'];
        response: Volatile['response'] & Ephemeral['response'];
    }, {
        derive: {};
        resolve: {};
        schema: {};
        standaloneSchema: {};
        response: {};
    }>;
    group<const Prefix extends string, const NewElysia extends AnyElysia>(prefix: Prefix, run: (group: Elysia<Prefix extends '' ? BasePath : JoinPath<BasePath, Prefix>, Singleton, Definitions, {
        schema: MergeSchema<UnwrapRoute<{}, Definitions['typebox']>, Metadata['schema']>;
        standaloneSchema: UnwrapRoute<{}, Definitions['typebox']> & Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: Metadata['response'];
    }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & NewElysia['~Routes'], Ephemeral, Volatile>;
    group<const Prefix extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Prefix>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<Definitions['error'], Schema, Singleton>>, const NewElysia extends AnyElysia>(prefix: Prefix, schema: GuardLocalHook<Input, Schema & MacroContext, Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'] & MacroContext['response'];
    }, keyof Metadata['parser'], BeforeHandle, AfterHandle, ErrorHandle>, run: (group: Elysia<JoinPath<BasePath, Prefix>, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'] & MacroContext['resolve'];
    }, Definitions, {
        schema: Schema;
        standaloneSchema: Metadata['standaloneSchema'] & Schema & MacroContext;
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: Metadata['response'] & MacroContext['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle>;
    }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & NewElysia['~Routes'], Ephemeral, Volatile>;
    /**
     * ### guard
     * Encapsulate and pass hook into all child handler
     *
     * ---
     * @example
     * ```typescript
     * import { t } from 'elysia'
     *
     * new Elysia()
     *     .guard({
     *         body: t.Object({
     *             username: t.String(),
     *             password: t.String()
     *         })
     *     })
     * ```
     */
    guard<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, Metadata['schema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey | 'as'>, Definitions['typebox']>, const GuardType extends GuardSchemaType, const AsType extends LifeCycleType, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<Definitions['error'], Schema, Singleton>>>(hook: GuardLocalHook<Input, Schema & MacroContext, Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'] & MacroContext['response'];
    }, keyof Metadata['parser'], BeforeHandle, AfterHandle, ErrorHandle, GuardType, AsType>): Or<GuardSchemaType extends GuardType ? true : false, GuardType extends 'override' ? true : false> extends true ? Or<LifeCycleType extends AsType ? true : false, AsType extends 'local' ? true : false> extends true ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & MacroContext['resolve'];
        schema: {} extends PickIfExists<Input, keyof InputSchema> ? Volatile['schema'] : MergeSchema<UnwrapRoute<Input, Definitions['typebox']>, Metadata['schema']>;
        standaloneSchema: Volatile['standaloneSchema'] & SimplifyToSchema<MacroContext>;
        response: Volatile['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return'];
    }> : AsType extends 'global' ? Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'] & MacroContext['resolve'];
    }, Definitions, {
        schema: {} extends PickIfExists<Input, keyof InputSchema> ? Metadata['schema'] : MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, Metadata['schema']>;
        standaloneSchema: Metadata['standaloneSchema'] & SimplifyToSchema<MacroContext>;
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: Metadata['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return'];
    }, Routes, Ephemeral, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'] & MacroContext['resolve'];
        schema: {} extends PickIfExists<Input, keyof InputSchema> ? EphemeralType['schema'] : MergeSchema<UnwrapRoute<Input, Definitions['typebox']>, Metadata['schema'] & Ephemeral['schema']>;
        standaloneSchema: Ephemeral['standaloneSchema'] & SimplifyToSchema<MacroContext>;
        response: Ephemeral['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return'];
    }, Volatile> : Or<LifeCycleType extends AsType ? true : false, AsType extends 'local' ? true : false> extends true ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & MacroContext['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: SimplifyToSchema<MacroContext> & ({} extends PickIfExists<Input, keyof InputSchema> ? Volatile['standaloneSchema'] : Volatile['standaloneSchema'] & UnwrapRoute<Input, Definitions['typebox']>);
        response: Volatile['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return'];
    }> : AsType extends 'global' ? Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'] & MacroContext['resolve'];
    }, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: SimplifyToSchema<MacroContext> & ({} extends PickIfExists<Input, keyof InputSchema> ? Metadata['standaloneSchema'] : UnwrapRoute<Input, Definitions['typebox'], BasePath> & Metadata['standaloneSchema']);
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: Metadata['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return'];
    }, Routes, Ephemeral, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'];
        resolve: Ephemeral['resolve'] & MacroContext['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: SimplifyToSchema<MacroContext> & ({} extends PickIfExists<Input, keyof InputSchema> ? Ephemeral['standaloneSchema'] : Ephemeral['standaloneSchema'] & UnwrapRoute<Input, Definitions['typebox']>);
        response: Ephemeral['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle> & MacroContext['return'];
    }, Volatile>;
    guard<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey | 'as'>, Definitions['typebox']>, const BeforeHandle extends MaybeArray<OptionalHandler<Schema, Singleton>>, const AfterHandle extends MaybeArray<AfterHandler<Schema, Singleton>>, const ErrorHandle extends MaybeArray<ErrorHandler<any, Schema, Singleton>>, const NewElysia extends AnyElysia>(schema: GuardLocalHook<Input, Schema & MacroContext, Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, keyof Metadata['parser'], BeforeHandle, AfterHandle, ErrorHandle>, run: (group: Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'] & MacroContext['resolve'];
    }, Definitions, {
        schema: Schema;
        standaloneSchema: Metadata['standaloneSchema'] & Schema & MacroContext;
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: Metadata['response'] & MacroContext['response'] & ElysiaHandlerToResponseSchemaAmbiguous<BeforeHandle> & ElysiaHandlerToResponseSchemaAmbiguous<AfterHandle> & ElysiaHandlerToResponseSchemaAmbiguous<ErrorHandle>;
    }, {}, Ephemeral, Volatile>) => NewElysia): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & NewElysia['~Routes'], Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & MacroContext['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: Volatile['response'] & MacroContext['response'];
    }>;
    /**
     * Entire Instance
     **/
    use<const NewElysia extends AnyElysia>(instance: MaybePromise<NewElysia>): Elysia<BasePath, {
        decorator: Singleton['decorator'] & NewElysia['~Singleton']['decorator'];
        store: Prettify<Singleton['store'] & NewElysia['~Singleton']['store']>;
        derive: Singleton['derive'] & NewElysia['~Singleton']['derive'];
        resolve: Singleton['resolve'] & NewElysia['~Singleton']['resolve'];
    }, Definitions & NewElysia['~Definitions'], Metadata & NewElysia['~Metadata'], BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, Ephemeral, Volatile & NewElysia['~Ephemeral']>;
    /**
     * Entire multiple Instance
     **/
    use<const Instances extends AnyElysia[]>(instance: MaybePromise<Instances>): MergeElysiaInstances<Instances, BasePath>;
    /**
     * Import fn
     */
    use<const NewElysia extends AnyElysia>(plugin: Promise<{
        default: (elysia: AnyElysia) => MaybePromise<NewElysia>;
    }>): Elysia<BasePath, {
        decorator: Singleton['decorator'] & NewElysia['~Singleton']['decorator'];
        store: Prettify<Singleton['store'] & NewElysia['~Singleton']['store']>;
        derive: Singleton['derive'] & NewElysia['~Singleton']['derive'];
        resolve: Singleton['resolve'] & NewElysia['~Singleton']['resolve'];
    }, Definitions & NewElysia['~Definitions'], Metadata & NewElysia['~Metadata'], BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, Ephemeral & NewElysia['~Ephemeral'], Volatile & NewElysia['~Volatile']>;
    /**
     * Import entire instance
     */
    use<const LazyLoadElysia extends AnyElysia>(plugin: Promise<{
        default: LazyLoadElysia;
    }>): Elysia<BasePath, {
        decorator: Singleton['decorator'] & Partial<LazyLoadElysia['~Singleton']['decorator']>;
        store: Prettify<Singleton['store'] & Partial<LazyLoadElysia['~Singleton']['store']>>;
        derive: Singleton['derive'] & Partial<LazyLoadElysia['~Singleton']['derive']>;
        resolve: Singleton['resolve'] & Partial<LazyLoadElysia['~Singleton']['resolve']>;
    }, Definitions & LazyLoadElysia['~Definitions'], Metadata & LazyLoadElysia['~Metadata'], BasePath extends `` ? Routes & LazyLoadElysia['~Routes'] : Routes & CreateEden<BasePath, LazyLoadElysia['~Routes']>, Ephemeral, {
        schema: Volatile['schema'] & Partial<LazyLoadElysia['~Ephemeral']['schema']>;
        standaloneSchema: Volatile['standaloneSchema'] & Partial<LazyLoadElysia['~Ephemeral']['standaloneSchema']>;
        resolve: Volatile['resolve'] & Partial<LazyLoadElysia['~Ephemeral']['resolve']>;
        derive: Volatile['derive'] & Partial<LazyLoadElysia['~Ephemeral']['derive']>;
        response: Volatile['response'] & LazyLoadElysia['~Ephemeral']['response'];
    }>;
    /**
     * Inline fn
     */
    use<const NewElysia extends AnyElysia, const Param extends AnyElysia = this>(plugin: (app: Param) => NewElysia): Elysia<BasePath, {
        decorator: Singleton['decorator'] & NewElysia['~Singleton']['decorator'];
        store: Prettify<Singleton['store'] & NewElysia['~Singleton']['store']>;
        derive: Singleton['derive'] & NewElysia['~Singleton']['derive'];
        resolve: Singleton['resolve'] & NewElysia['~Singleton']['resolve'];
    }, Definitions & NewElysia['~Definitions'], Metadata & NewElysia['~Metadata'], BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, Ephemeral & NewElysia['~Ephemeral'], Volatile & NewElysia['~Volatile']>;
    /**
     * Inline async fn
     */
    use<const NewElysia extends AnyElysia, const Param extends AnyElysia = this>(plugin: ((app: Param) => Promise<NewElysia>) | Promise<(app: Param) => NewElysia>): Elysia<BasePath, {
        decorator: Singleton['decorator'] & Partial<NewElysia['~Singleton']['decorator']>;
        store: Prettify<Singleton['store'] & Partial<NewElysia['~Singleton']['store']>>;
        derive: Singleton['derive'] & Partial<NewElysia['~Singleton']['derive']>;
        resolve: Singleton['resolve'] & Partial<NewElysia['~Singleton']['resolve']>;
    }, Definitions & NewElysia['~Definitions'], Metadata & NewElysia['~Metadata'], BasePath extends `` ? Routes & NewElysia['~Routes'] : Routes & CreateEden<BasePath, NewElysia['~Routes']>, {
        schema: Ephemeral['schema'] & Partial<NewElysia['~Ephemeral']['schema']>;
        standaloneSchema: Ephemeral['standaloneSchema'] & Partial<NewElysia['~Ephemeral']['standaloneSchema']>;
        resolve: Ephemeral['resolve'] & Partial<NewElysia['~Ephemeral']['resolve']>;
        derive: Ephemeral['derive'] & Partial<NewElysia['~Ephemeral']['derive']>;
        response: Ephemeral['response'] & NewElysia['~Ephemeral']['response'];
    }, {
        schema: Volatile['schema'] & Partial<NewElysia['~Volatile']['schema']>;
        standaloneSchema: Volatile['standaloneSchema'] & Partial<NewElysia['~Volatile']['standaloneSchema']>;
        resolve: Volatile['resolve'] & Partial<NewElysia['~Volatile']['resolve']>;
        derive: Volatile['derive'] & Partial<NewElysia['~Volatile']['derive']>;
        response: Volatile['response'] & NewElysia['~Volatile']['response'];
    }>;
    /**
     * conditional undefined ignore type
     */
    use(instance: MaybeArray<MaybePromise<AnyElysia>> | MaybePromise<AnyElysia | ((app: AnyElysia) => MaybePromise<AnyElysia>)> | Promise<{
        default: AnyElysia | ((app: AnyElysia) => MaybePromise<AnyElysia>);
    }> | undefined | false): this;
    private propagatePromiseModules;
    private _use;
    macro<const Name extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Property extends MaybeValueOrVoidFunction<MacroProperty<Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string> & {
        [name in Name]?: boolean;
    }, Schema & MacroContext, Singleton & {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']> & MacroContext['resolve'];
    }, Definitions['error']>>>(name: Name, macro: (Input extends any ? Input : Prettify<Input>) & Property): Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'] & {
            [name in Name]?: Property extends (a: infer Params) => any ? Params : boolean;
        };
        macroFn: Metadata['macroFn'] & {
            [name in Name]: Property;
        };
        parser: Metadata['parser'];
        response: Metadata['response'];
    }, Routes, Ephemeral, Volatile>;
    macro<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const NewMacro extends Macro<Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, Input, IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, Singleton & {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    }, Definitions['error']>>(macro: NewMacro): Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'] & Partial<MacroToProperty<NewMacro>>;
        macroFn: Metadata['macroFn'] & NewMacro;
        parser: Metadata['parser'];
        response: Metadata['response'];
    }, Routes, Ephemeral, Volatile>;
    macro<const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const NewMacro extends MaybeFunction<Macro<Input, IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], BasePath>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, Singleton & {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    }, Definitions['error']>>>(macro: NewMacro): Elysia<BasePath, Singleton, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'] & Partial<MacroToProperty<NewMacro>>;
        macroFn: Metadata['macroFn'] & NewMacro;
        parser: Metadata['parser'];
        response: Metadata['response'];
    }, Routes, Ephemeral, Volatile>;
    private applyMacro;
    mount(handle: ((request: Request) => MaybePromise<Response>) | AnyElysia, detail?: {
        detail?: DocumentDecoration;
    }): this;
    mount(path: string, handle: ((request: Request) => MaybePromise<Response>) | AnyElysia, detail?: {
        detail?: DocumentDecoration;
    }): this;
    /**
     * ### get
     * Register handler for path with method [GET]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .get('/', () => 'hi')
     *     .get('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    get<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends {} extends MacroContext ? InlineHandlerNonMacro<NoInfer<Schema>, NoInfer<Decorator>> : InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        get: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### post
     * Register handler for path with method [POST]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .post('/', () => 'hi')
     *     .post('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    post<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends {} extends MacroContext ? InlineHandlerNonMacro<NoInfer<Schema>, NoInfer<Decorator>> : InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        post: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### put
     * Register handler for path with method [PUT]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .put('/', () => 'hi')
     *     .put('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    put<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends {} extends MacroContext ? InlineHandlerNonMacro<NoInfer<Schema>, NoInfer<Decorator>> : InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        put: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### patch
     * Register handler for path with method [PATCH]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .patch('/', () => 'hi')
     *     .patch('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    patch<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        patch: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### delete
     * Register handler for path with method [DELETE]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .delete('/', () => 'hi')
     *     .delete('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    delete<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        delete: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### options
     * Register handler for path with method [POST]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .options('/', () => 'hi')
     *     .options('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    options<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        options: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### all
     * Register handler for path with method [ALL]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .all('/', () => 'hi')
     *     .all('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    all<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        [method in string]: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### head
     * Register handler for path with method [HEAD]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .head('/', () => 'hi')
     *     .head('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    head<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        head: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### connect
     * Register handler for path with method [CONNECT]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .connect('/', () => 'hi')
     *     .connect('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    connect<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        connect: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### route
     * Register handler for path with method [ROUTE]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .route('/', () => 'hi')
     *     .route('/with-hook', () => 'hi', {
     *         response: t.String()
     *     })
     * ```
     */
    route<const Method extends HTTPMethod, const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const Decorator extends Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, const MacroContext extends {} extends Metadata['macroFn'] ? {} : MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>, Definitions['typebox']>, const Handle extends InlineHandler<NoInfer<Schema>, NoInfer<Decorator>, MacroContext>>(method: Method, path: Path, handler: Handle, hook?: LocalHook<Input, Schema & MacroContext, Decorator, Definitions['error'], keyof Metadata['parser']> & {
        config?: {
            allowMeta?: boolean;
            mount?: Function;
        };
    }): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        [method in Method]: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Handle, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### ws
     * Register handler for path with method [ws]
     *
     * ---
     * @example
     * ```typescript
     * import { Elysia, t } from 'elysia'
     *
     * new Elysia()
     *     .ws('/', {
     *         message(ws, message) {
     *             ws.send(message)
     *         }
     *     })
     * ```
     */
    ws<const Path extends string, const Input extends Metadata['macro'] & InputSchema<keyof Definitions['typebox'] & string>, const Schema extends IntersectIfObjectSchema<MergeSchema<UnwrapRoute<Input, Definitions['typebox'], JoinPath<BasePath, Path>>, MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>>>, Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema']>, const MacroContext extends MacroToContext<Metadata['macroFn'], Omit<Input, NonResolvableMacroKey>>>(path: Path, options: WSLocalHook<Input, Schema, Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'] & MacroContext['resolve'];
    }>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes & CreateEden<JoinPath<BasePath, Path>, {
        subscribe: CreateEdenResponse<Path, Schema, MacroContext, ComposeElysiaResponse<Schema & MacroContext & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], {} extends Schema['response'] ? unknown : Schema['response'] extends {
            [200]: any;
        } ? Schema['response'][200] : unknown, UnionResponseStatus<Metadata['response'], UnionResponseStatus<Ephemeral['response'], UnionResponseStatus<Volatile['response'], MacroContext['return'] & {}>>>>>;
    }>, Ephemeral, Volatile>;
    /**
     * ### state
     * Assign global mutatable state accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .state('counter', 0)
     *     .get('/', (({ counter }) => ++counter)
     * ```
     */
    state<const Name extends string | number | symbol, Value>(name: Name, value: Value): Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Prettify<Singleton['store'] & {
            [name in Name]: Value;
        }>;
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### state
     * Assign global mutatable state accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .state({ counter: 0 })
     *     .get('/', (({ counter }) => ++counter)
     * ```
     */
    state<Store extends Record<string, unknown>>(store: Store): Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Prettify<Singleton['store'] & Store>;
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### state
     * Assign global mutatable state accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .state('counter', 0)
     *     .get('/', (({ counter }) => ++counter)
     * ```
     */
    state<const Type extends ContextAppendType, const Name extends string | number | symbol, Value>(options: {
        as: Type;
    }, name: Name, value: Value): Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Type extends 'override' ? Reconcile<Singleton['store'], {
            [name in Name]: Value;
        }, true> : Prettify<Singleton['store'] & {
            [name in Name]: Value;
        }>;
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### state
     * Assign global mutatable state accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .state({ counter: 0 })
     *     .get('/', (({ counter }) => ++counter)
     * ```
     */
    state<const Type extends ContextAppendType, Store extends Record<string, unknown>>(options: {
        as: Type;
    }, store: Store): Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Type extends 'override' ? Reconcile<Singleton['store'], Store> : Prettify<Singleton['store'] & Store>;
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    state<NewStore extends Record<string, unknown>>(mapper: (decorators: Singleton['store']) => NewStore): Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: NewStore;
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### decorate
     * Define custom method to `Context` accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .decorate('getDate', () => Date.now())
     *     .get('/', (({ getDate }) => getDate())
     * ```
     */
    decorate<const Name extends string, Value>(name: Name, value: Value): Elysia<BasePath, {
        decorator: Singleton['decorator'] & {
            [name in Name]: Value;
        };
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### decorate
     * Define custom method to `Context` accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .decorate('getDate', () => Date.now())
     *     .get('/', (({ getDate }) => getDate())
     * ```
     */
    decorate<NewDecorators extends Record<string, unknown>>(decorators: NewDecorators): Elysia<BasePath, {
        decorator: Singleton['decorator'] & NewDecorators;
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    decorate<NewDecorators extends Record<string, unknown>>(mapper: (decorators: Singleton['decorator']) => NewDecorators): Elysia<BasePath, {
        decorator: NewDecorators;
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### decorate
     * Define custom method to `Context` accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .decorate({ as: 'override' }, 'getDate', () => Date.now())
     *     .get('/', (({ getDate }) => getDate())
     * ```
     */
    decorate<const Type extends ContextAppendType, const Name extends string, Value>(options: {
        as: Type;
    }, name: Name, value: Value): Elysia<BasePath, {
        decorator: Type extends 'override' ? Reconcile<Singleton['decorator'], {
            [name in Name]: Value;
        }, true> : Singleton['decorator'] & {
            [name in Name]: Value;
        };
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * ### decorate
     * Define custom method to `Context` accessible for all handler
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .decorate('getDate', () => Date.now())
     *     .get('/', (({ getDate }) => getDate())
     * ```
     */
    decorate<const Type extends ContextAppendType, NewDecorators extends Record<string, unknown>>(options: {
        as: Type;
    }, decorators: NewDecorators): Elysia<BasePath, {
        decorator: Type extends 'override' ? Reconcile<Singleton['decorator'], NewDecorators, true> : Singleton['decorator'] & NewDecorators;
        store: Singleton['store'];
        derive: Singleton['derive'];
        resolve: Singleton['resolve'];
    }, Definitions, Metadata, Routes, Ephemeral, Volatile>;
    /**
     * Derive new property for each request with access to `Context`.
     *
     * If error is thrown, the scope will skip to handling error instead.
     *
     * ---
     * @example
     * new Elysia()
     *     .state('counter', 1)
     *     .derive(({ store }) => ({
     *         increase() {
     *             store.counter++
     *         }
     *     }))
     */
    derive<const Derivative extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any> | void>(transform: (context: Context<MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'], Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }>) => MaybePromise<Derivative>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'] & ExcludeElysiaResponse<Derivative>;
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<Derivative>>;
    }>;
    /**
     * Derive new property for each request with access to `Context`.
     *
     * If error is thrown, the scope will skip to handling error instead.
     *
     * ---
     * @example
     * new Elysia()
     *     .state('counter', 1)
     *     .derive(({ store }) => ({
     *         increase() {
     *             store.counter++
     *         }
     *     }))
     */
    derive<const Derivative extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any> | void, const Type extends LifeCycleType>(options: {
        as: Type;
    }, transform: (context: Context<MergeSchema<Volatile['schema'], MergeSchema<Ephemeral['schema'], Metadata['schema']>, BasePath> & Metadata['standaloneSchema'] & Ephemeral['standaloneSchema'] & Volatile['standaloneSchema'] & 'global' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : 'scoped' extends Type ? {
        params: {
            [name: string]: string | undefined;
        };
    } : {}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }), BasePath>) => MaybePromise<Derivative>): Type extends 'global' ? Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & ExcludeElysiaResponse<Derivative>;
        resolve: Singleton['resolve'];
    }, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ExtractErrorFromHandle<Derivative>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'] & ExcludeElysiaResponse<Derivative>;
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ExtractErrorFromHandle<Derivative>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'] & ExcludeElysiaResponse<Derivative>;
        resolve: Ephemeral['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<Derivative>>;
    }>;
    model<const Name extends string, const Model extends TSchema | StandardSchemaV1Like>(name: Name, model: Model): Elysia<BasePath, Singleton, {
        typebox: Definitions['typebox'] & {
            [name in Name]: Model;
        };
        error: Definitions['error'];
    }, Metadata, Routes, Ephemeral, Volatile>;
    model<const Recorder extends Record<string, TSchema | StandardSchemaV1Like>>(record: Recorder): Elysia<BasePath, Singleton, {
        typebox: Definitions['typebox'] & Recorder;
        error: Definitions['error'];
    }, Metadata, Routes, Ephemeral, Volatile>;
    model<const NewType extends Record<string, TSchema | StandardSchemaV1Like>>(mapper: (decorators: Definitions['typebox'] extends infer Models ? {
        [Name in keyof Models]: Models[Name] extends TSchema ? TRef<Name & string> : Models[Name];
    } : {}) => NewType): Elysia<BasePath, Singleton, {
        typebox: {
            [Name in keyof NewType]: NewType[Name] extends TRef<Name & string> ? Definitions['typebox'][Name] : NewType[Name];
        };
        error: Definitions['error'];
    }, Metadata, Routes, Ephemeral, Volatile>;
    Ref<K extends keyof Extract<Definitions['typebox'], TAnySchema> & string>(key: K): TRef<K>;
    mapDerive<const NewDerivative extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any>>(mapper: (context: Context<{}, Singleton & {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }, BasePath>) => MaybePromise<NewDerivative>): Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: ExcludeElysiaResponse<NewDerivative>;
        resolve: Volatile['resolve'];
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<NewDerivative>>;
    }>;
    mapDerive<const NewDerivative extends Record<string, unknown> | ElysiaCustomStatusResponse<any, any, any>, const Type extends LifeCycleType>(options: {
        as: Type;
    }, mapper: (context: Context<{}, Singleton & ('global' extends Type ? {
        derive: Partial<Ephemeral['derive'] & Volatile['derive']>;
        resolve: Partial<Ephemeral['resolve'] & Volatile['resolve']>;
    } : 'scoped' extends Type ? {
        derive: Ephemeral['derive'] & Partial<Volatile['derive']>;
        resolve: Ephemeral['resolve'] & Partial<Volatile['resolve']>;
    } : {
        derive: Ephemeral['derive'] & Volatile['derive'];
        resolve: Ephemeral['resolve'] & Volatile['resolve'];
    }), BasePath>) => MaybePromise<NewDerivative>): Type extends 'global' ? Elysia<BasePath, {
        decorator: Singleton['decorator'];
        store: Singleton['store'];
        derive: Singleton['derive'] & ExcludeElysiaResponse<NewDerivative>;
        resolve: Singleton['resolve'];
    }, Definitions, {
        schema: Metadata['schema'];
        standaloneSchema: Metadata['standaloneSchema'];
        macro: Metadata['macro'];
        macroFn: Metadata['macroFn'];
        parser: Metadata['parser'];
        response: UnionResponseStatus<Metadata['response'], ExtractErrorFromHandle<NewDerivative>>;
    }, Routes, Ephemeral, Volatile> : Type extends 'scoped' ? Elysia<BasePath, Singleton, Definitions, Metadata, Routes, {
        derive: Ephemeral['derive'] & ExcludeElysiaResponse<NewDerivative>;
        resolve: Ephemeral['resolve'];
        schema: Ephemeral['schema'];
        standaloneSchema: Ephemeral['standaloneSchema'];
        response: UnionResponseStatus<Ephemeral['response'], ExtractErrorFromHandle<NewDerivative>>;
    }, Volatile> : Elysia<BasePath, Singleton, Definitions, Metadata, Routes, Ephemeral, {
        derive: Volatile['derive'];
        resolve: Volatile['resolve'] & ExcludeElysiaResponse<NewDerivative>;
        schema: Volatile['schema'];
        standaloneSchema: Volatile['standaloneSchema'];
        response: UnionResponseStatus<Volatile['response'], ExtractErrorFromHandle<NewDerivative>>;
    }>;
    affix<const Base extends 'prefix' | 'suffix', const Type extends 'all' | 'decorator' | 'state' | 'model' | 'error', const Word extends string>(base: Base, type: Type, word: Word): Elysia<BasePath, {
        decorator: Type extends 'decorator' | 'all' ? 'prefix' extends Base ? Word extends `${string}${'_' | '-' | ' '}` ? AddPrefix<Word, Singleton['decorator']> : AddPrefixCapitalize<Word, Singleton['decorator']> : AddSuffixCapitalize<Word, Singleton['decorator']> : Singleton['decorator'];
        store: Type extends 'state' | 'all' ? 'prefix' extends Base ? Word extends `${string}${'_' | '-' | ' '}` ? AddPrefix<Word, Singleton['store']> : AddPrefixCapitalize<Word, Singleton['store']> : AddSuffix<Word, Singleton['store']> : Singleton['store'];
        derive: Type extends 'decorator' | 'all' ? 'prefix' extends Base ? Word extends `${string}${'_' | '-' | ' '}` ? AddPrefix<Word, Singleton['derive']> : AddPrefixCapitalize<Word, Singleton['derive']> : AddSuffixCapitalize<Word, Singleton['derive']> : Singleton['derive'];
        resolve: Type extends 'decorator' | 'all' ? 'prefix' extends Base ? Word extends `${string}${'_' | '-' | ' '}` ? AddPrefix<Word, Singleton['resolve']> : AddPrefixCapitalize<Word, Singleton['resolve']> : AddSuffixCapitalize<Word, Singleton['resolve']> : Singleton['resolve'];
    }, {
        typebox: Type extends 'model' | 'all' ? 'prefix' extends Base ? Word extends `${string}${'_' | '-' | ' '}` ? AddPrefix<Word, Definitions['typebox']> : AddPrefixCapitalize<Word, Definitions['typebox']> : AddSuffixCapitalize<Word, Definitions['typebox']> : Definitions['typebox'];
        error: Type extends 'error' | 'all' ? 'prefix' extends Base ? Word extends `${string}${'_' | '-' | ' '}` ? AddPrefix<Word, Definitions['error']> : AddPrefixCapitalize<Word, Definitions['error']> : AddSuffixCapitalize<Word, Definitions['error']> : Definitions['error'];
    }, Metadata, Routes, Ephemeral, Volatile>;
    prefix<const Type extends 'all' | 'decorator' | 'state' | 'model' | 'error', const Word extends string>(type: Type, word: Word): Elysia<BasePath, {
        decorator: Type extends "decorator" | "all" ? Word extends `${string} ` | `${string}-` | `${string}_` ? AddPrefix<Word, Singleton["decorator"]> : AddPrefixCapitalize<Word, Singleton["decorator"]> : Singleton["decorator"];
        store: Type extends "all" | "state" ? Word extends `${string} ` | `${string}-` | `${string}_` ? AddPrefix<Word, Singleton["store"]> : AddPrefixCapitalize<Word, Singleton["store"]> : Singleton["store"];
        derive: Type extends "decorator" | "all" ? Word extends `${string} ` | `${string}-` | `${string}_` ? AddPrefix<Word, Singleton["derive"]> : AddPrefixCapitalize<Word, Singleton["derive"]> : Singleton["derive"];
        resolve: Type extends "decorator" | "all" ? Word extends `${string} ` | `${string}-` | `${string}_` ? AddPrefix<Word, Singleton["resolve"]> : AddPrefixCapitalize<Word, Singleton["resolve"]> : Singleton["resolve"];
    }, {
        typebox: Type extends "all" | "model" ? Word extends `${string} ` | `${string}-` | `${string}_` ? AddPrefix<Word, Definitions["typebox"]> : AddPrefixCapitalize<Word, Definitions["typebox"]> : Definitions["typebox"];
        error: Type extends "error" | "all" ? Word extends `${string} ` | `${string}-` | `${string}_` ? AddPrefix<Word, Definitions["error"]> : AddPrefixCapitalize<Word, Definitions["error"]> : Definitions["error"];
    }, Metadata, Routes, Ephemeral, Volatile>;
    suffix<const Type extends 'all' | 'decorator' | 'state' | 'model' | 'error', const Word extends string>(type: Type, word: Word): Elysia<BasePath, {
        decorator: Type extends "decorator" | "all" ? AddSuffixCapitalize<Word, Singleton["decorator"]> : Singleton["decorator"];
        store: Type extends "all" | "state" ? AddSuffix<Word, Singleton["store"]> : Singleton["store"];
        derive: Type extends "decorator" | "all" ? AddSuffixCapitalize<Word, Singleton["derive"]> : Singleton["derive"];
        resolve: Type extends "decorator" | "all" ? AddSuffixCapitalize<Word, Singleton["resolve"]> : Singleton["resolve"];
    }, {
        typebox: Type extends "all" | "model" ? AddSuffixCapitalize<Word, Definitions["typebox"]> : Definitions["typebox"];
        error: Type extends "error" | "all" ? AddSuffixCapitalize<Word, Definitions["error"]> : Definitions["error"];
    }, Metadata, Routes, Ephemeral, Volatile>;
    compile(): this;
    handle: (request: Request) => Promise<Response>;
    /**
     * Use handle can be either sync or async to save performance.
     *
     * Beside benchmark purpose, please use 'handle' instead.
     */
    get fetch(): (request: Request) => MaybePromise<Response>;
    /**
     * Custom handle written by adapter
     */
    protected _handle?(...a: unknown[]): unknown;
    protected handleError: (context: Partial<Context<MergeSchema<Metadata["schema"], MergeSchema<Ephemeral["schema"], Volatile["schema"]>> & Metadata["standaloneSchema"] & Ephemeral["standaloneSchema"] & Volatile["standaloneSchema"], Singleton & {
        derive: Ephemeral["derive"] & Volatile["derive"];
        resolve: Ephemeral["resolve"] & Volatile["resolve"];
    }, BasePath>> & {
        request: Request;
    }, error: Error | ValidationError | ParseError | NotFoundError | InternalServerError) => Promise<any>;
    /**
     * ### listen
     * Assign current instance to port and start serving
     *
     * ---
     * @example
     * ```typescript
     * new Elysia()
     *     .get("/", () => 'hi')
     *     .listen(3000)
     * ```
     */
    listen: (options: string | number | Partial<Serve>, callback?: ListenCallback) => this;
    /**
     * ### stop
     * Stop server from serving
     *
     * ---
     * @example
     * ```typescript
     * const app = new Elysia()
     *     .get("/", () => 'hi')
     *     .listen(3000)
     *
     * // Sometime later
     * app.stop()
     * ```
     *
     * @example
     * ```typescript
     * const app = new Elysia()
     *     .get("/", () => 'hi')
     *     .listen(3000)
     *
     * app.stop(true) // Abruptly any requests inflight
     * ```
     */
    stop: (closeActiveConnections?: boolean) => Promise<this>;
    [Symbol.dispose]: () => void;
    /**
     * Wait until all lazy loaded modules all load is fully
     */
    get modules(): PromiseGroup;
}
export { Elysia };
export { t } from './type-system';
export { validationDetail, fileType } from './type-system/utils';
export type { ElysiaTypeCustomError, ElysiaTypeCustomErrorCallback } from './type-system/types';
export { serializeCookie, Cookie, type CookieOptions } from './cookies';
export type { Context, PreContext, ErrorContext } from './context';
export { ELYSIA_TRACE, type TraceEvent, type TraceListener, type TraceHandler, type TraceProcess, type TraceStream } from './trace';
export { getSchemaValidator, getResponseSchemaValidator } from './schema';
export { replaceSchemaTypeFromManyOptions as replaceSchemaType } from './replace-schema';
export { mergeHook, mergeObjectArray, redirect, StatusMap, InvertedStatusMap, form, replaceUrlPath, checksum, cloneInference, deduplicateChecksum, ELYSIA_FORM_DATA, ELYSIA_REQUEST_ID, sse } from './utils';
export { status, mapValueError, ParseError, NotFoundError, ValidationError, InvalidFileType, InternalServerError, InvalidCookieSignature, ERROR_CODE, ElysiaStatus, ElysiaCustomStatusResponse, type SelectiveStatus } from './error';
export type { EphemeralType, CreateEden, ComposeElysiaResponse, ElysiaConfig, SingletonBase, DefinitionBase, RouteBase, Handler, ComposedHandler, InputSchema, LocalHook, MergeSchema, RouteSchema, UnwrapRoute, InternalRoute, HTTPMethod, SchemaValidator, VoidHandler, PreHandler, BodyHandler, OptionalHandler, AfterResponseHandler, ErrorHandler, LifeCycleEvent, LifeCycleStore, LifeCycleType, MaybePromise, UnwrapSchema, AnySchema, ModelsToTypes, Checksum, DocumentDecoration, InferContext, InferHandler, ResolvePath, MapResponse, BaseMacro, MacroManager, MacroToProperty, MergeElysiaInstances, MaybeArray, ModelValidator, MetadataBase, UnwrapBodySchema, UnwrapGroupGuardRoute, ModelValidatorError, ExcludeElysiaResponse, SSEPayload, StandaloneInputSchema, MergeStandaloneSchema, MergeTypeModule, GracefulHandler, AfterHandler, InlineHandler, ResolveHandler, TransformHandler, HTTPHeaders, EmptyRouteSchema, ExtractErrorFromHandle } from './types';
export { env } from './universal/env';
export { file, ElysiaFile } from './universal/file';
export type { ElysiaAdapter } from './adapter';
export { TypeSystemPolicy } from '@sinclair/typebox/system';
export type { Static, TSchema } from '@sinclair/typebox';
