Skip to content

index

Classes

ClassDescription
BadRequestExceptionException for 400 Bad Request errors
ConfigurableModuleBuilderFactory that lets you create configurable modules and provides a way to reduce the majority of dynamic module boilerplate.
ConsoleLogger-
Container-
DIErrorError thrown when the DI container cannot resolve a dependency.
EventEmitterEvent emitter for dispatching and handling events
FileValidationError-
ForbiddenExceptionException for 403 Forbidden errors
HttpAdapterHostHost class for accessing the HTTP adapter. Used to abstract the underlying HTTP server.
HttpExceptionBase class for HTTP exceptions
Injector-
InstanceWrapper-
InternalServerErrorExceptionException for 500 Internal Server Error errors
LifecycleManagerClass to manage lifecycle hooks across the application
Logger-
ModuleRefModuleRef provides a way to access providers within a module. It is automatically injected by the framework and allows retrieving providers dynamically at runtime.
NotFoundExceptionException for 404 Not Found errors
ReflectorHelper class for retrieving metadata from classes and methods using reflect-metadata.
StreamableFileStreamable file class for handling file streams
UnauthorizedExceptionException for 401 Unauthorized errors

Functions

FunctionDescription
addGlobalExceptionFilter-
applyDecoratorsApplies multiple decorators to a target (class, method, or property). Useful for composing multiple decorators into a single one.
CatchDecorator that marks a class as an exception filter. The decorated class must implement the ExceptionFilter interface.
ControllerController decorator that defines a controller with a route prefix.
Cookies-
createClassMetadataCacheLazily-populated WeakMap cache for class-level Reflect metadata. Automatically garbage-collects entries when the class is collected.
createElysiaApplicationCreates an Elysia-Nest application with microservices support.
createElysiaPluginHelper function to create the Elysia plugin from module metadata.
createLoggerOptionsProviderFactory to create logger options provider with custom options
createMetadataCacheLazily-populated cache for generic Reflect metadata keyed by (target, metadataKey). Two-level lookup: WeakMap<object, Map<key, T>>.
createMethodMetadataCacheLazily-populated cache for method-level Reflect metadata. Two-level lookup: WeakMap<object, Map<string
createParamDecorator-
EventSubscriberDecorator to mark a class as an event subscriber
forwardRef-
getCatchExceptionsMetadataGet the exception types that a filter catches
getElysiaHooksMetadataGet all Elysia lifecycle hooks metadata for a controller
getEventEmitterGet the global event emitter instance
getLifecycleManagerGet the global lifecycle manager instance
GlobalMarks a module as global, meaning its providers can be accessed from any other module without explicitly importing it.
HeaderDecorator that sets HTTP headers for the response.
Headers-
HttpCodeDecorator that sets the HTTP status code for the response.
Inject-
Injectable-
isCatchFilterCheck if a class is marked as an exception filter
isClassMiddleware-
isClassProvider-
isCustomProvider-
isExistingProvider-
isFactoryProvider-
isForwardRef-
isFunctionCheck if value is a function
isLogLevelEnabled-
isNilCheck if value is nil (null or undefined)
isObjectCheck if value is an object
isStringCheck if value is a string
isTypeProvider-
isUndefinedCheck if value is undefined
isValidationError-
isValueProvider-
MiddlewareMarks a class as middleware. Implies @Injectable().
ModuleModule decorator that creates an Elysia plugin from the module configuration.
OnCloseMarks a gateway method as the WebSocket close handler. Called when a client disconnects.
OnEventDecorator to mark a method as an event handler
OnMessageMarks a gateway method as the WebSocket message handler. Called when a message is received from a client.
OnOpenMarks a gateway method as the WebSocket open handler. Called when a client establishes a connection.
Optional-
parseValidationError-
processParametersExtract and validate parameters based on metadata
registerEventHandlersFunction to register event handlers from a class instance
Schema-
SetMetadataDecorator that assigns metadata to the class using the specified key.
UseGuardsDecorator that binds guards to the scope of the controller or method, depending on its context.
UseInterceptorsDecorator that binds interceptors to the scope of the controller or method, depending on its context.
WebSocketGatewayClass decorator that marks a class as a WebSocket gateway.

Interfaces

InterfaceDescription
ApplicationOptions-
BaseProvider-
BeforeApplicationShutdownInterface for lifecycle hooks called before the application is closed This method is called after all OnModuleDestroy hooks have been called
CallHandlerCall handler interface for interceptors
CanActivateInterface for guards
ClassProvider-
ConfigurableModuleAsyncOptionsInterface that represents the module async options object Factory method name varies depending on the "FactoryClassMethodKey" type argument.
ConfigurableModuleBuilderOptions-
ConfigurableModuleHostConfigurable module host. See properties for more details
ConsoleLoggerOptions-
ContextId-
ControllerMetadataController metadata type
DynamicModuleDynamic module configuration
ElysiaHookMetadataMetadata for Elysia lifecycle hooks
ElysiaNestMiddlewareInterface for class-based middleware. Instances will be resolved from the DI container.
EventHandlerRegistrationEvent handler registration with metadata
ExceptionContextContext for exception filters
ExceptionFilterInterface for exception filters
ExceptionFilterMetadata-
ExecutionContextExecution context interface providing access to the request/response and handler information
ExistingProvider-
FactoryProvider-
FileValidationOptions-
ForwardReference-
GetOptionsOptions for ModuleRef.get() method
HttpAdapterInterface for HTTP adapter - abstracts HTTP server operations
HttpArgumentsHostHTTP context interface for request/response access
IEventEmitterInterface for event emitter
InjectableOptions-
InstancePerContext-
InterceptorInterface for request interceptors
InterceptorMetadata-
LoggerOptions-
LoggerService-
ModuleMetadata-
ModuleOptions-
NestInterceptorElysia-Nest interceptor interface
OnApplicationBootstrapInterface for lifecycle hooks called when the application is bootstrapped This method is called after all modules have been initialized
OnApplicationShutdownInterface for lifecycle hooks called when the application is shutting down This method is called when all connections are closed and the application is about to exit
OnEventOptionsOptions for the OnEvent decorator
OnModuleDestroyInterface for lifecycle hooks called before a module is destroyed This method is called when the application is shutting down
OnModuleInitInterface for lifecycle hooks called when a module is initialized This method is called once all the modules are instantiated but before the application is fully started
ParamInfo-
ParamMetadata-
PipeMetadataMetadata for pipes
PipeTransformInterface for pipes
RequestContext-
ResponseInterceptorInterface for response interceptors
RouteMetadata-
RouteSchemaOptions-
RpcArgumentsHostRPC context interface
ScopeOptions-
Type-
ValidationErrorDetails-
ValueProvider-
WsArgumentsHostWebSocket context interface
WsGatewayMetadata-
WsHandlerMetadata-

Type Aliases

Type AliasDescription
ConfigurableModuleClsClass that represents a blueprint/prototype for a configurable Nest module. This class provides static methods for constructing dynamic modules. Their names can be controlled through the "MethodKey" type argument.
ConfigurableModuleOptionsFactoryInterface that must be implemented by the module options factory class. Method key varies depending on the "FactoryClassMethodKey" type argument.
ElysiaHookNameType for Elysia lifecycle hook names
ElysiaWsContextThe WebSocket context object passed to gateway handler methods. Wraps Elysia's ElysiaWS with an untyped data payload for general use.
EventHandlerEvent handler function type
FunctionalMiddlewareFunctional middleware type. Directly an Elysia handler or a similar function.
GuardContext-
InjectionToken-
LogLevel-
MiddlewareTypeRepresents either a class type that implements ElysiaNestMiddleware or a functional middleware.
OptionalFactoryDependency-
Provider-
ProviderToken-
TypeProvider-
WsHandlerType-

Enumerations

EnumerationDescription
HttpStatusStandard HTTP status codes.
Scope-

Variables

VariableDescription
All-
APP_FILTERInjection token for exception filters Use this token to provide a global exception filter
APP_FILTERS_METADATA-
Body-
CATCH_EXCEPTIONS_METADATAMetadata key for storing caught exception types
CATCH_WATERMARKMetadata key for marking a class as an exception filter
Ctx-
Delete-
DIContainer-
ELYSIA_HOOKS_METADATA-
ElysiaContext-
EVENT_LISTENER_METADATA-
EVENTS_METADATA-
EXCEPTION_FILTER_METADATA-
File-
Files-
Form-
Get-
GLOBAL_MODULE_METADATA-
GUARDS_METADATA-
Head-
HEADERS_METADATA-
HTTP_CODE_METADATA-
INJECT_METADATA-
INJECTABLE_METADATA-
INJECTABLE_SOURCE-
INTERCEPTORS_METADATA-
Ip-
LOG_LEVELS-
LOGGER_OPTIONS-
LoggerOptionsProviderDefault logger options provider
MODULE_METADATA-
OnAfterHandleHook called after request handler
OnAfterResponseHook called after response is sent
OnBeforeHandleHook called before request handler
OnErrorHook called when error occurs
OnMapResponseHook called to map response
OnParseHook called to parse request body
OnRequestHook called when new request is received
OnTransformHook called to transform parsed body
OPTIONAL_METADATA-
Options-
Param-
PARAMS_METADATA-
Patch-
PIPES_METADATA-
Post-
Put-
Query-
RawBody-
Req-
Request-
Res-
Response-
RESPONSE_INTERCEPTORS_METADATA-
ROUTE_METADATA-
ROUTE_PREFIX_METADATA-
ROUTE_SCHEMA_METADATA-
SCHEDULED_JOB_METADATA-
Session-
STATIC_CONTEXT-
WS_GATEWAY_METADATA-
WS_HANDLER_METADATA-

Released under the MIT License.