@elysiumjs/core 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,167 @@
1
+ import type { WriteStream } from 'node:tty';
2
+ /**
3
+ * ANSI color codes and styles for console output.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ */
6
+ export declare enum ConsoleFormat {
7
+ BLACK = 0,
8
+ RED = 1,
9
+ GREEN = 2,
10
+ YELLOW = 3,
11
+ BLUE = 4,
12
+ MAGENTA = 5,
13
+ CYAN = 6,
14
+ WHITE = 7,
15
+ GRAY = 8,
16
+ BOLD = 9,
17
+ UNDERLINE = 10,
18
+ ITALIC = 11,
19
+ INVERSE = 12
20
+ }
21
+ /**
22
+ * A utility class for console IO with various formatting options.
23
+ * @author Axel Nana <axel.nana@workbud.com>
24
+ */
25
+ export declare class InteractsWithConsole {
26
+ protected static readonly SPACE_WIDTH = 60;
27
+ /**
28
+ * Write a message to the console.
29
+ * @param message The message to write.
30
+ * @param newLine Whether to add a newline at the end (default: `true`).
31
+ * @param out The output stream to write to (default: `process.stdout`).
32
+ */
33
+ write(message: string, newLine?: boolean, out?: WriteStream): void;
34
+ /**
35
+ * Write a new line to the console.
36
+ */
37
+ newLine(): void;
38
+ /**
39
+ * Write an info message to the console (blue text).
40
+ * @param message The message to write.
41
+ */
42
+ info(message: string): void;
43
+ /**
44
+ * Write a success message to the console (green text).
45
+ * @param message The message to write.
46
+ */
47
+ success(message: string): void;
48
+ /**
49
+ * Write a warning message to the console (yellow text).
50
+ * @param message The message to write.
51
+ */
52
+ warning(message: string): void;
53
+ /**
54
+ * Write an error message to the console (red text).
55
+ * @param message The message to write.
56
+ */
57
+ error(message: string): void;
58
+ /**
59
+ * Write a debug message to the console (gray text).
60
+ * Only shown if the DEBUG environment variable is set.
61
+ * @param message The message to write.
62
+ */
63
+ debug(message: string): void;
64
+ /**
65
+ * Display a JavaScript error in the console with its message, stack trace,
66
+ * and any additional relevant information.
67
+ * @param error The error to display.
68
+ * @param title Optional title to display before the error message (default: '').
69
+ */
70
+ trace(error: Error & Record<string, any>, title?: string): void;
71
+ /**
72
+ * Write a title to the console (bold text with underline).
73
+ * @param title The title to write.
74
+ */
75
+ title(title: string): void;
76
+ /**
77
+ * Write a section header to the console (bold text).
78
+ * @param header The section header to write.
79
+ */
80
+ section(header: string): void;
81
+ /**
82
+ * Create a table from an array of objects and write it to the console.
83
+ * @param data The array of objects to display.
84
+ * @param columns Optional column configuration.
85
+ */
86
+ table<T extends Record<string, any>>(data: T[], columns?: {
87
+ [K in keyof T]?: {
88
+ header?: string;
89
+ width?: number;
90
+ format?: (value: T[K]) => string;
91
+ };
92
+ }): void;
93
+ /**
94
+ * Format text with multiple ANSI styles.
95
+ * @param text The text to format.
96
+ * @param styles The styles to apply.
97
+ * @returns The formatted text.
98
+ */
99
+ format(text: string, ...styles: ConsoleFormat[]): string;
100
+ /**
101
+ * Format text as bold.
102
+ * @param text The text to format.
103
+ * @returns The formatted text.
104
+ */
105
+ bold(text: string): string;
106
+ /**
107
+ * Format text as italic.
108
+ * @param text The text to format.
109
+ * @returns The formatted text.
110
+ */
111
+ italic(text: string): string;
112
+ /**
113
+ * Format text as underline.
114
+ * @param text The text to format.
115
+ * @returns The formatted text.
116
+ */
117
+ underline(text: string): string;
118
+ /**
119
+ * Clear the console screen.
120
+ */
121
+ clear(): void;
122
+ /**
123
+ * Move the cursor to a specific position.
124
+ * @param x The x coordinate (column).
125
+ * @param y The y coordinate (row).
126
+ */
127
+ moveCursor(x: number, y: number): void;
128
+ /**
129
+ * Clear the current line in the console.
130
+ */
131
+ clearLine(): void;
132
+ /**
133
+ * Prompt the user for input.
134
+ * @param question The question to ask.
135
+ * @param defaultValue Optional default value.
136
+ * @returns The user's input.
137
+ */
138
+ protected prompt(question: string, defaultValue?: string): Promise<string>;
139
+ /**
140
+ * Prompt the user for a password (input is hidden).
141
+ * @param question The question to ask.
142
+ * @returns The user's password.
143
+ */
144
+ protected promptPassword(question: string): Promise<string>;
145
+ /**
146
+ * Prompt the user for confirmation (yes/no).
147
+ * @param question The question to ask.
148
+ * @param defaultValue Optional default value (true for yes, false for no).
149
+ * @returns True if the user confirmed, false otherwise.
150
+ */
151
+ protected confirm(question: string, defaultValue?: boolean): Promise<boolean>;
152
+ /**
153
+ * Prompt the user to select from a list of options.
154
+ * @param question The question to ask.
155
+ * @param options The options to choose from.
156
+ * @param defaultIndex Optional default option index.
157
+ * @returns The selected option.
158
+ */
159
+ protected select<T extends string>(question: string, options: T[], defaultIndex?: number): Promise<T>;
160
+ /**
161
+ * Format a time value in seconds to a human-readable string.
162
+ * @param seconds The time value in seconds.
163
+ * @returns A formatted time string.
164
+ */
165
+ protected formatTime(seconds: number): string;
166
+ }
167
+ //# sourceMappingURL=console.d.ts.map
@@ -0,0 +1,113 @@
1
+ import type { DrizzleConfig } from 'drizzle-orm';
2
+ import type { BunSQLDatabase } from 'drizzle-orm/bun-sql';
3
+ import type { CacheConfig } from 'drizzle-orm/cache/core/types';
4
+ import { Table } from 'drizzle-orm';
5
+ import { Cache as DrizzleCache } from 'drizzle-orm/cache/core';
6
+ /**
7
+ * Properties used to create a new database connection.
8
+ * @author Axel Nana <axel.nana@workbud.com>
9
+ */
10
+ export type DatabaseConnectionProps<TSchema extends Record<string, unknown> = Record<string, never>> = Omit<DrizzleConfig<TSchema>, 'cache'> & ({
11
+ connection: string | ({
12
+ url?: string;
13
+ } & Bun.SQLOptions);
14
+ } | {
15
+ client: Bun.SQL;
16
+ }) & {
17
+ /**
18
+ * Configures caching behavior for the database connection.
19
+ * Set it to `true` to enable caching with default configurations.
20
+ */
21
+ cache?: true | {
22
+ /**
23
+ * Whether to enable caching.
24
+ */
25
+ enabled?: boolean;
26
+ /**
27
+ * The default TTL for cached data, in seconds.
28
+ * @default 1
29
+ */
30
+ ttl?: number;
31
+ /**
32
+ * The caching strategy.
33
+ * Set it to `all` to cache all queries automatically.
34
+ * Set it to `explicit` to cache queries manually.
35
+ * @default 'explicit'
36
+ */
37
+ strategy?: 'explicit' | 'all';
38
+ /**
39
+ * The storage engine to use.
40
+ * @default 'redis'
41
+ */
42
+ storage?: 'redis' | 'memory';
43
+ };
44
+ };
45
+ /**
46
+ * A database connection.
47
+ * @author Axel Nana <axel.nana@workbud.com>
48
+ */
49
+ export type DatabaseConnection = BunSQLDatabase<Record<string, never>> & {
50
+ $client: Bun.SQL;
51
+ };
52
+ /**
53
+ * Database cache implementation for Drizzle.
54
+ * @author Axel Nana <axel.nana@workbud.com>
55
+ */
56
+ export declare class DatabaseCache extends DrizzleCache {
57
+ #private;
58
+ private readonly cacheStrategy;
59
+ private readonly globalTtl;
60
+ private usedTablesPerKey;
61
+ constructor(cacheStrategy?: 'explicit' | 'all', globalTtl?: number, storageEngine?: 'redis' | 'memory');
62
+ strategy(): 'explicit' | 'all';
63
+ get(key: string): Promise<any[] | undefined>;
64
+ put(key: string, response: any, tables: string[], _isTag: boolean, config?: CacheConfig): Promise<void>;
65
+ onMutate(params: {
66
+ tags: string | string[];
67
+ tables: string | string[] | Table<any> | Table<any>[];
68
+ }): Promise<void>;
69
+ }
70
+ export declare namespace Database {
71
+ /**
72
+ * Retrieves the connection with the given name.
73
+ * @author Axel Nana <axel.nana@workbud.com>
74
+ * @param name The connection name.
75
+ * @returns The connection with the given name.
76
+ */
77
+ const getConnection: (name: string) => DatabaseConnection;
78
+ /**
79
+ * Creates and registers a new connection.
80
+ * @author Axel Nana <axel.nana@workbud.com>
81
+ *
82
+ * This will make the registered connection available for dependency injection with
83
+ * the key `db.connection.{name}`, where `{name}` is replaced with the given name.
84
+ *
85
+ * @param name The connection name.
86
+ * @param config The connection properties.
87
+ * @returns The newly created and registered connection.
88
+ */
89
+ const registerConnection: (name: string, config: DatabaseConnectionProps) => BunSQLDatabase<Record<string, never>> & {
90
+ $client: Bun.SQL;
91
+ };
92
+ /**
93
+ * Checks if a connection with the given name exists.
94
+ * @author Axel Nana <axel.nana@workbud.com>
95
+ * @param name The name of the connection to check.
96
+ * @returns `true` if the connection exists, `false` otherwise.
97
+ */
98
+ const connectionExists: (name: string) => boolean;
99
+ /**
100
+ * Retrieves the default connection.
101
+ * @author Axel Nana <axel.nana@workbud.com>
102
+ * @returns The default connection.
103
+ */
104
+ const getDefaultConnection: () => DatabaseConnection;
105
+ /**
106
+ * Sets the default connection.
107
+ * @author Axel Nana <axel.nana@workbud.com>
108
+ * @param name The name of the connection to set as default.
109
+ * @returns The default connection.
110
+ */
111
+ const setDefaultConnection: (name: string) => DatabaseConnection;
112
+ }
113
+ //# sourceMappingURL=database.d.ts.map
package/dist/env.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import type { AppEnv } from '@elysiumjs/core';
2
+ /**
3
+ * Initializes the environment variables.
4
+ * @author Axel Nana <axel.nana@workbud.com>
5
+ * @param vars The environment variables to initialize.
6
+ */
7
+ export declare const initEnv: (vars: Record<string, unknown>) => void;
8
+ export declare namespace Env {
9
+ /**
10
+ * Gets the value of an environment variable.
11
+ * @author Axel Nana <axel.nana@workbud.com>
12
+ * @param name The name of the environment variable.
13
+ * @param defaultValue The default value to return if the environment variable is not set.
14
+ * @returns The value of the environment variable.
15
+ */
16
+ const get: <TKey extends keyof AppEnv>(name: TKey, defaultValue?: AppEnv[TKey]) => AppEnv[TKey];
17
+ /**
18
+ * Checks if an environment variable exists.
19
+ * @author Axel Nana <axel.nana@workbud.com>
20
+ * @param name The name of the environment variable.
21
+ * @returns `true` if the environment variable exists, `false` otherwise.
22
+ */
23
+ const exists: <TKey extends keyof AppEnv>(name: TKey) => boolean;
24
+ /**
25
+ * Clears the environment variables.
26
+ * @author Axel Nana <axel.nana@workbud.com>
27
+ */
28
+ const clear: () => void;
29
+ }
30
+ //# sourceMappingURL=env.d.ts.map
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Stores the event data with the source.
3
+ * @author Axel Nana <axel.nana@workbud.com>
4
+ */
5
+ export type EventData<TData, TSource = null> = {
6
+ /**
7
+ * The emitted data.
8
+ */
9
+ data: TData;
10
+ /**
11
+ * The source of the event.
12
+ */
13
+ source: TSource | null;
14
+ };
15
+ /**
16
+ * Event handler function.
17
+ * @author Axel Nana <axel.nana@workbud.com>
18
+ */
19
+ export type EventHandler<TData, TSource = any> = (event: EventData<TData, TSource>) => void | Promise<void>;
20
+ /**
21
+ * Properties required when declaring a method as an event listener.
22
+ * @author Axel Nana <axel.nana@workbud.com>
23
+ */
24
+ export type ListenProps = {
25
+ /**
26
+ * The listener mode.
27
+ *
28
+ * Set it to `on` to listen for the event every time it is emitted.
29
+ * Set it to `once` to listen for the event only once.
30
+ */
31
+ mode: 'on' | 'once';
32
+ /**
33
+ * The event name.
34
+ */
35
+ event: string;
36
+ /**
37
+ * Whether to prepend the listener to the event. Defaults to `false`.
38
+ * @default false
39
+ */
40
+ prepend?: boolean;
41
+ };
42
+ export declare namespace Event {
43
+ /**
44
+ * Emits an event with the provided data and source.
45
+ * @author Axel Nana <axel.nana@workbud.com>
46
+ * @param event The event name.
47
+ * @param data The emitted data.
48
+ * @param source The source of the event. Defaults to `null`.
49
+ */
50
+ const emit: <TData, TSource = any>(event: string, data: TData, source?: TSource | null) => void;
51
+ /**
52
+ * Marks a method as an event listener.
53
+ * @author Axel Nana <axel.nana@workbud.com>
54
+ * @param options The decorator options.
55
+ */
56
+ function on(options: Omit<ListenProps, 'mode'>): MethodDecorator;
57
+ /**
58
+ * Registers an event listener for the specified event.
59
+ * @author Axel Nana <axel.nana@workbud.com>
60
+ * @param event The event name.
61
+ * @param handler The event handler function.
62
+ */
63
+ function on<TData, TSource = any>(event: string, handler: EventHandler<TData, TSource>): void;
64
+ /**
65
+ * Marks a method as an event listener that listens for the event only once.
66
+ * @author Axel Nana <axel.nana@workbud.com>
67
+ * @param options The decorator options.
68
+ */
69
+ function once(options: Omit<ListenProps, 'mode'>): MethodDecorator;
70
+ /**
71
+ * Registers an event listener for the specified event that listens for the event only once.
72
+ * @author Axel Nana <axel.nana@workbud.com>
73
+ * @param event The event name.
74
+ * @param handler The event handler function.
75
+ */
76
+ function once<TData, TSource = any>(event: string, handler: EventHandler<TData, TSource>): void;
77
+ /**
78
+ * Removes all event listeners for the specified event.
79
+ * @author Axel Nana <axel.nana@workbud.com>
80
+ * @param event The event name.
81
+ */
82
+ const off: (event: string) => void;
83
+ /**
84
+ * Removes all event listeners.
85
+ * @author Axel Nana <axel.nana@workbud.com>
86
+ */
87
+ const clear: () => void;
88
+ /**
89
+ * Marks a method as an event listener.
90
+ * @param options The decorator options.
91
+ */
92
+ const listen: (options: ListenProps) => MethodDecorator;
93
+ }
94
+ //# sourceMappingURL=event.d.ts.map
package/dist/http.d.ts ADDED
@@ -0,0 +1,242 @@
1
+ import type { AppHttpContext } from '@elysiumjs/core';
2
+ import type { Context as ElysiaContext, Handler, HTTPMethod, TSchema } from 'elysia';
3
+ import type { Class, MergeDeep } from 'type-fest';
4
+ import type { Module } from './module';
5
+ import { Elysia } from 'elysia';
6
+ /**
7
+ * A route is a string that starts with a forward slash.
8
+ * @author Axel Nana <axel.nana@workbud.com>
9
+ */
10
+ export type Route = `/${string}`;
11
+ /**
12
+ * A class for validating data against a schema.
13
+ * @author Axel Nana <axel.nana@workbud.com>
14
+ */
15
+ export type ValidatorClass<T extends TSchema = TSchema> = {
16
+ /**
17
+ * The validation schema. This schema is automatically checked against the input data during
18
+ * the validation stage of the HTTP request.
19
+ */
20
+ readonly schema: T;
21
+ /**
22
+ * Whether the request should be authorized before validation. If the request is not authorized,
23
+ * the validation will be skipped.
24
+ */
25
+ authorize(ctx: Context<T['static']>): Promise<boolean>;
26
+ /**
27
+ * Processes custom validation logic. This method is called after the validation schema is checked
28
+ * against the input data. So it's safe to assume that the schema is valid.
29
+ * @param data The input data to validate.
30
+ * @returns Whether the input data is valid.
31
+ */
32
+ validate(ctx: Context<T['static']>): Promise<boolean>;
33
+ };
34
+ /**
35
+ * Metadata for the HTTP context.
36
+ * @author Axel Nana <axel.nana@workbud.com>
37
+ */
38
+ export type Singleton<TController = unknown, TModule extends Module = Module> = MergeDeep<AppHttpContext, {
39
+ decorator: {
40
+ [key: string]: unknown;
41
+ /**
42
+ * The controller instance.
43
+ */
44
+ controller: () => TController;
45
+ /**
46
+ * The module instance.
47
+ */
48
+ module: TModule;
49
+ };
50
+ resolve: {
51
+ /**
52
+ * The tenant ID.
53
+ */
54
+ readonly tenant: string;
55
+ };
56
+ }>;
57
+ /**
58
+ * The Elysia context with the controller injected.
59
+ * @author Axel Nana <axel.nana@workbud.com>
60
+ */
61
+ export type Context<TBody = unknown, TController = unknown, TModule extends Module = Module> = ElysiaContext<{
62
+ body: TBody;
63
+ }, Singleton<TController, TModule>>;
64
+ export type ElysiaApp = Elysia<Route, Singleton>;
65
+ /**
66
+ * The scope of an HTTP controller.
67
+ * @author Axel Nana <axel.nana@workbud.com>
68
+ */
69
+ export declare enum HttpControllerScope {
70
+ /**
71
+ * The controller is instantiated once in the server and used for every request.
72
+ */
73
+ SERVER = 0,
74
+ /**
75
+ * A new instance of the controller is created for each request.
76
+ */
77
+ REQUEST = 1
78
+ }
79
+ /**
80
+ * Properties required when declaring an HTTP controller using the `@http()` decorator.
81
+ * @author Axel Nana <axel.nana@workbud.com>
82
+ */
83
+ export type HttpControllerProps = {
84
+ /**
85
+ * The path of the HTTP route.
86
+ */
87
+ path: Route;
88
+ /**
89
+ * The scope of the HTTP controller.
90
+ * @default HttpControllerScope.SERVER
91
+ */
92
+ scope?: HttpControllerScope;
93
+ /**
94
+ * The list of tags for the controller.
95
+ * Used in Swagger documentation.
96
+ */
97
+ tags?: Array<string>;
98
+ /**
99
+ * Whether to create a database transaction for all the queries executed
100
+ * for all the request handlers in this controller.
101
+ */
102
+ transactional?: boolean;
103
+ };
104
+ /**
105
+ * Properties required when declaring an HTTP request handler.
106
+ * @author Axel Nana <axel.nana@workbud.com>
107
+ */
108
+ export type RequestHandlerDecoratorProps = {
109
+ /**
110
+ * The HTTP method of the handler.
111
+ */
112
+ method?: HTTPMethod;
113
+ /**
114
+ * The path of the HTTP route.
115
+ */
116
+ path?: Route;
117
+ /**
118
+ * The schema of the response body.
119
+ */
120
+ response?: TSchema | Record<number, TSchema>;
121
+ /**
122
+ * The operation ID for the handler.
123
+ * Used in Swagger documentation.
124
+ */
125
+ operationId?: string;
126
+ /**
127
+ * The description for the handler.
128
+ * Used in Swagger documentation.
129
+ */
130
+ description?: string;
131
+ /**
132
+ * Whether to create a database transaction for all the queries executed
133
+ * for this request handler.
134
+ */
135
+ transactional?: boolean;
136
+ };
137
+ export declare namespace Http {
138
+ /**
139
+ * Marks a class as an HTTP controller.
140
+ * @author Axel Nana <axel.nana@workbud.com>
141
+ * @param props The decorator options.
142
+ */
143
+ const controller: (props?: HttpControllerProps) => (target: Class<any>) => void;
144
+ /**
145
+ * Marks a method as an HTTP "server-sent events" request handler.
146
+ * @author Axel Nana <axel.nana@workbud.com>
147
+ * @param props The request handler properties.
148
+ */
149
+ const sse: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
150
+ /**
151
+ * Marks a method as an HTTP "get" request handler.
152
+ * @author Axel Nana <axel.nana@workbud.com>
153
+ * @param props The request handler properties.
154
+ */
155
+ const get: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
156
+ /**
157
+ * Marks a method as an HTTP "post" request handler.
158
+ * @author Axel Nana <axel.nana@workbud.com>
159
+ * @param props The request handler properties.
160
+ */
161
+ const post: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
162
+ /**
163
+ * Marks a method as an HTTP "put" request handler.
164
+ * @author Axel Nana <axel.nana@workbud.com>
165
+ * @param props The request handler properties.
166
+ */
167
+ const put: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
168
+ /**
169
+ * Marks a method as an HTTP "delete" request handler.
170
+ * @author Axel Nana <axel.nana@workbud.com>
171
+ * @param props The request handler properties.
172
+ */
173
+ const del: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
174
+ /**
175
+ * Marks a method as an HTTP "patch" request handler.
176
+ * @author Axel Nana <axel.nana@workbud.com>
177
+ * @param props The request handler properties.
178
+ */
179
+ const patch: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
180
+ /**
181
+ * Marks a method as an HTTP "head" request handler.
182
+ * @author Axel Nana <axel.nana@workbud.com>
183
+ * @param props The request handler properties.
184
+ */
185
+ const head: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
186
+ /**
187
+ * Marks a method as an HTTP "options" request handler.
188
+ * @author Axel Nana <axel.nana@workbud.com>
189
+ * @param props The request handler properties.
190
+ */
191
+ const options: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
192
+ /**
193
+ * Marks a method as an HTTP "trace" request handler.
194
+ * @author Axel Nana <axel.nana@workbud.com>
195
+ * @param props The request handler properties.
196
+ */
197
+ const trace: (props?: RequestHandlerDecoratorProps) => MethodDecorator;
198
+ /**
199
+ * Marks a method as an HTTP request handler with a custom method.
200
+ * @author Axel Nana <axel.nana@workbud.com>
201
+ * @param props The request handler properties.
202
+ */
203
+ const custom: ({ path, ...rest }: RequestHandlerDecoratorProps & {
204
+ method: HTTPMethod;
205
+ }) => MethodDecorator;
206
+ /**
207
+ * Marks a method as the callback for the request handler.
208
+ * @author Axel Nana <axel.nana@workbud.com>
209
+ */
210
+ const onRequest: () => MethodDecorator;
211
+ /**
212
+ * Resolves the context for the current request in the annotated parameter.
213
+ * @author Axel Nana <axel.nana@workbud.com>
214
+ */
215
+ const context: () => ParameterDecorator;
216
+ /**
217
+ * Resolves the value of a URL parameter in the annotated parameter.
218
+ * @author Axel Nana <axel.nana@workbud.com>
219
+ * @param slug The slug of the parameter.
220
+ * @param schema The schema of the parameter.
221
+ */
222
+ const param: (slug: string, schema?: TSchema) => ParameterDecorator;
223
+ /**
224
+ * Resolves the value of a query parameter in the annotated parameter.
225
+ * @author Axel Nana <axel.nana@workbud.com>
226
+ * @param schema The schema of the query parameter.
227
+ */
228
+ const query: (schema?: TSchema) => ParameterDecorator;
229
+ /**
230
+ * Resolves the value of the request body in the annotated parameter.
231
+ * @author Axel Nana <axel.nana@workbud.com>
232
+ * @param schema The schema of the request body.
233
+ */
234
+ const body: (schema?: TSchema | ValidatorClass) => ParameterDecorator;
235
+ /**
236
+ * Executes a custom function to resolve the value of the parameter from the context.
237
+ * @author Axel Nana <axel.nana@workbud.com>
238
+ * @param handler The custom function that will return the value for the parameter.
239
+ */
240
+ const decorate: (handler: Handler) => (() => ParameterDecorator);
241
+ }
242
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1,21 @@
1
+ import './macros';
2
+ export { type Elysia, type TSchema, type Static, t } from 'elysia';
3
+ export { type AppContext, type ElysiumPlugin, Application } from './app';
4
+ export { Cache } from './cache';
5
+ export { type CommandArgumentProps, type CommandClass, Command, CommandArgumentType } from './command';
6
+ export { ConsoleFormat, InteractsWithConsole } from './console';
7
+ export { Database } from './database';
8
+ export { Env } from './env';
9
+ export { type EventData, type EventHandler, Event } from './event';
10
+ export { type Context, type Route, HttpControllerScope, Http } from './http';
11
+ export { Job } from './job';
12
+ export { Middleware } from './middleware';
13
+ export { type ModelClass, Model, Tenancy } from './model';
14
+ export { type ModuleClass, Module } from './module';
15
+ export { Redis } from './redis';
16
+ export { type IdType, type RepositoryInterface, type RepositoryClass, Repository } from './repository';
17
+ export { ServiceScope, Service } from './service';
18
+ export { type WampRegistrationOptions, type WampSubscriptionOptions, type WampProps, type WampRegistrationHandlerArgs, type WampSubscriptionHandlerArgs, type WampRegistrationHandler, type WampSubscriptionHandler, Wamp } from './wamp';
19
+ export { type WS, type WSError, Websocket } from './websocket';
20
+ export { type QueueOptions, WorkerPool, Worker } from './worker';
21
+ //# sourceMappingURL=index.d.ts.map