@ragemp-mango/core 2.0.6-beta.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.
Files changed (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +20 -0
  3. package/dist/app/constants/index.d.ts +26 -0
  4. package/dist/app/constants/index.js +49 -0
  5. package/dist/app/controller/index.d.ts +70 -0
  6. package/dist/app/controller/index.js +24 -0
  7. package/dist/app/enums/index.d.ts +27 -0
  8. package/dist/app/enums/index.js +16 -0
  9. package/dist/app/index.d.ts +138 -0
  10. package/dist/app/index.js +132 -0
  11. package/dist/app/interfaces/index.d.ts +157 -0
  12. package/dist/app/interfaces/index.js +2 -0
  13. package/dist/app/module/index.d.ts +27 -0
  14. package/dist/app/module/index.js +16 -0
  15. package/dist/app/module-tree/index.d.ts +56 -0
  16. package/dist/app/module-tree/index.js +25 -0
  17. package/dist/app/pipeline/index.d.ts +5 -0
  18. package/dist/app/pipeline/index.js +14 -0
  19. package/dist/app/services/index.d.ts +37 -0
  20. package/dist/app/services/index.js +14 -0
  21. package/dist/app/utils/index.d.ts +16 -0
  22. package/dist/app/utils/index.js +10 -0
  23. package/dist/call-handler.interface-DVdaknsB.d.ts +52 -0
  24. package/dist/chunk-2ADQZWQE.js +170 -0
  25. package/dist/chunk-6YEWPMZJ.js +69 -0
  26. package/dist/chunk-73LIJA6X.js +176 -0
  27. package/dist/chunk-7QVYU63E.js +7 -0
  28. package/dist/chunk-AO6BXG54.js +139 -0
  29. package/dist/chunk-CFHBJ5MV.js +1906 -0
  30. package/dist/chunk-CW7WAA3P.js +1906 -0
  31. package/dist/chunk-DEPJRTVT.js +1 -0
  32. package/dist/chunk-DJZCOYB3.js +17 -0
  33. package/dist/chunk-DXPVUDXD.js +81 -0
  34. package/dist/chunk-E6IQL4S6.js +40 -0
  35. package/dist/chunk-HK7QTFPA.js +81 -0
  36. package/dist/chunk-ITEHLEIP.js +29 -0
  37. package/dist/chunk-M55YEQ7J.js +1 -0
  38. package/dist/chunk-PGWRESZG.js +790 -0
  39. package/dist/chunk-PQK4E654.js +1 -0
  40. package/dist/chunk-RYOUF322.js +68 -0
  41. package/dist/chunk-SKPH3K2M.js +570 -0
  42. package/dist/chunk-TBWHLT75.js +61 -0
  43. package/dist/constants/index.d.ts +8 -0
  44. package/dist/constants/index.js +18 -0
  45. package/dist/controller-Ss0TVrxQ.d.ts +30 -0
  46. package/dist/custom-decorator.type-BHRvXIGz.d.ts +5 -0
  47. package/dist/decorators/index.d.ts +90 -0
  48. package/dist/decorators/index.js +91 -0
  49. package/dist/enums/index.d.ts +66 -0
  50. package/dist/enums/index.js +12 -0
  51. package/dist/errors/index.d.ts +23 -0
  52. package/dist/errors/index.js +17 -0
  53. package/dist/event-destination.enum-DT8jJFwR.d.ts +7 -0
  54. package/dist/event-emmiter.interface-7Ne9W8SM.d.ts +10 -0
  55. package/dist/event-metadata.interface-CREizDNq.d.ts +89 -0
  56. package/dist/execution-context-type.enum-fwYPtPvp.d.ts +6 -0
  57. package/dist/execution-context.interface-DpRN4oVj.d.ts +56 -0
  58. package/dist/index.d.ts +33 -0
  59. package/dist/index.js +190 -0
  60. package/dist/injectable-options.interface-8Gp9oRY6.d.ts +10 -0
  61. package/dist/injectable-scope.enum-CjyQMpW2.d.ts +7 -0
  62. package/dist/injection-token.type-dQTkkP6p.d.ts +5 -0
  63. package/dist/interfaces/index.d.ts +38 -0
  64. package/dist/interfaces/index.js +2 -0
  65. package/dist/logger-service.interface-BGV-o_Fx.d.ts +8 -0
  66. package/dist/method-param-type.enum-BfrJ8zqa.d.ts +11 -0
  67. package/dist/module-metadata.interface-B3bn1vqq.d.ts +59 -0
  68. package/dist/multiplayer-timers.interface-CFDTWwAT.d.ts +22 -0
  69. package/dist/newable.type-BdhG3MZC.d.ts +5 -0
  70. package/dist/nullable.type-C-lE7JU4.d.ts +3 -0
  71. package/dist/pipe-transform.interface-BlzOrUy3.d.ts +14 -0
  72. package/dist/pipes/index.d.ts +12 -0
  73. package/dist/pipes/index.js +9 -0
  74. package/dist/reflectable-decorator.interface-CLOGdtEQ.d.ts +14 -0
  75. package/dist/rpc-call-options.interface-BJ5mHrvT.d.ts +5 -0
  76. package/dist/rpc-error.interface-CeaZLqzE.d.ts +6 -0
  77. package/dist/rpc-metadata.interface-DS-GqgqA.d.ts +11 -0
  78. package/dist/rpc-result.interface-C758heM0.d.ts +10 -0
  79. package/dist/schemas/index.d.ts +189 -0
  80. package/dist/schemas/index.js +39 -0
  81. package/dist/script-event-handler.interface-B-Th4Ssg.d.ts +24 -0
  82. package/dist/script-event-handler.interface-vUr_v6tV.d.ts +5 -0
  83. package/dist/script-rpc-handler.interface-DBpD9-yk.d.ts +8 -0
  84. package/dist/services/index.d.ts +45 -0
  85. package/dist/services/index.js +23 -0
  86. package/dist/types/index.d.ts +9 -0
  87. package/dist/types/index.js +2 -0
  88. package/dist/utils/index.d.ts +16 -0
  89. package/dist/utils/index.js +32 -0
  90. package/package.json +133 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Aurėjus Remeika
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ ## Mango Framework
2
+
3
+ A simple, lightweight, and powerful TypeScript framework for building RageMP servers.
4
+
5
+ ## Features
6
+
7
+ - Mango Framework is built with TypeScript and provides a powerful type system for your application.
8
+ - Mango Framework has a wide range of decorators that allow you to easily create and manage your resource flow.
9
+ - Mango Framework is built with modularity in mind, allowing you to organize your application into small, reusable pieces.
10
+ - Mango Framework uses InversifyJS under the hood to provide a powerful dependency injection for your application.
11
+ - Mango Framework uses controllers to group and listen to events/rpcs together under a single class.
12
+ - Mango Framework uses Guards, Interceptors, and Error Filters to create a powerful pipeline that allows you to easily manage every incoming event/rpc.
13
+
14
+ ## Documentation
15
+
16
+ [Documentation](https://ragemp-mango.vercel.app)
17
+
18
+ ## License
19
+
20
+ [MIT](https://choosealicense.com/licenses/mit/)
@@ -0,0 +1,26 @@
1
+ import { R as RPCResult } from '../../rpc-result.interface-C758heM0.js';
2
+ import '../../rpc-error.interface-CeaZLqzE.js';
3
+
4
+ declare const INTERNAL_APP_CONTAINER = "INTERNAL_APP_CONTAINER";
5
+ declare const GLOBAL_APP_CONTAINER = "GLOBAL_APP_CONTAINER";
6
+ declare const APP_ENVIROMENT = "APP_ENVIROMENT";
7
+ declare const GLOBAL_GUARDS = "GLOBAL_GUARDS";
8
+ declare const GLOBAL_INTERCEPTORS = "GLOBAL_INTERCEPTORS";
9
+ declare const GLOBAL_PIPES = "GLOBAL_PIPES";
10
+ declare const GLOBAL_ERROR_FILTERS = "GLOBAL_ERROR_FILTERS";
11
+ declare const PLUGINS = "PLUGINS";
12
+ declare const ENABLE_SHUTDOWN_HOOKS = "ENABLE_SHUTDOWN_HOOKS";
13
+ declare const CONTAINER_OPTIONS = "CONTAINER_OPTIONS";
14
+ declare const LOG_ERROR_STACKTRACE = "LOG_ERROR_STACKTRACE";
15
+ declare const MANGO_LOG_PREFIX = "\uD83E\uDD6D";
16
+ declare const MANGO_REQUEST_FACTORY = "MANGO_REQUEST_FACTORY";
17
+ declare const MANGO_RESPONSE_FACTORY = "MANGO_RESPONSE_FACTORY";
18
+ declare const EXECUTION_CONTEXT_FACTORY = "EXECUTION_CONTEXT_FACTORY";
19
+ declare const MULTIPLAYER_SERVICE = "MULTIPLAYER_SERVICE";
20
+ declare const RPC_RESULT_TIMEOUT: RPCResult;
21
+ declare const RPC_RESULT_HANDLER_NOT_FOUND: RPCResult;
22
+ declare const RPC_RESULT_UNKNOWN: RPCResult;
23
+ declare const RPC_RESULT_PLAYER_DISCONNECTED: RPCResult;
24
+ declare const RPC_RESULT_PLAYER_NOT_FOUND: RPCResult;
25
+
26
+ export { APP_ENVIROMENT, CONTAINER_OPTIONS, ENABLE_SHUTDOWN_HOOKS, EXECUTION_CONTEXT_FACTORY, GLOBAL_APP_CONTAINER, GLOBAL_ERROR_FILTERS, GLOBAL_GUARDS, GLOBAL_INTERCEPTORS, GLOBAL_PIPES, INTERNAL_APP_CONTAINER, LOG_ERROR_STACKTRACE, MANGO_LOG_PREFIX, MANGO_REQUEST_FACTORY, MANGO_RESPONSE_FACTORY, MULTIPLAYER_SERVICE, PLUGINS, RPC_RESULT_HANDLER_NOT_FOUND, RPC_RESULT_PLAYER_DISCONNECTED, RPC_RESULT_PLAYER_NOT_FOUND, RPC_RESULT_TIMEOUT, RPC_RESULT_UNKNOWN };
@@ -0,0 +1,49 @@
1
+ import {
2
+ APP_ENVIROMENT,
3
+ CONTAINER_OPTIONS,
4
+ ENABLE_SHUTDOWN_HOOKS,
5
+ EXECUTION_CONTEXT_FACTORY,
6
+ GLOBAL_APP_CONTAINER,
7
+ GLOBAL_ERROR_FILTERS,
8
+ GLOBAL_GUARDS,
9
+ GLOBAL_INTERCEPTORS,
10
+ GLOBAL_PIPES,
11
+ INTERNAL_APP_CONTAINER,
12
+ LOG_ERROR_STACKTRACE,
13
+ MANGO_LOG_PREFIX,
14
+ MANGO_REQUEST_FACTORY,
15
+ MANGO_RESPONSE_FACTORY,
16
+ MULTIPLAYER_SERVICE,
17
+ PLUGINS,
18
+ RPC_RESULT_HANDLER_NOT_FOUND,
19
+ RPC_RESULT_PLAYER_DISCONNECTED,
20
+ RPC_RESULT_PLAYER_NOT_FOUND,
21
+ RPC_RESULT_TIMEOUT,
22
+ RPC_RESULT_UNKNOWN
23
+ } from "../../chunk-HK7QTFPA.js";
24
+ import "../../chunk-DXPVUDXD.js";
25
+ import "../../chunk-7QVYU63E.js";
26
+ export {
27
+ APP_ENVIROMENT,
28
+ CONTAINER_OPTIONS,
29
+ ENABLE_SHUTDOWN_HOOKS,
30
+ EXECUTION_CONTEXT_FACTORY,
31
+ GLOBAL_APP_CONTAINER,
32
+ GLOBAL_ERROR_FILTERS,
33
+ GLOBAL_GUARDS,
34
+ GLOBAL_INTERCEPTORS,
35
+ GLOBAL_PIPES,
36
+ INTERNAL_APP_CONTAINER,
37
+ LOG_ERROR_STACKTRACE,
38
+ MANGO_LOG_PREFIX,
39
+ MANGO_REQUEST_FACTORY,
40
+ MANGO_RESPONSE_FACTORY,
41
+ MULTIPLAYER_SERVICE,
42
+ PLUGINS,
43
+ RPC_RESULT_HANDLER_NOT_FOUND,
44
+ RPC_RESULT_PLAYER_DISCONNECTED,
45
+ RPC_RESULT_PLAYER_NOT_FOUND,
46
+ RPC_RESULT_TIMEOUT,
47
+ RPC_RESULT_UNKNOWN
48
+ };
49
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,70 @@
1
+ import { N as Newable } from '../../newable.type-BdhG3MZC.js';
2
+ import { P as Pipe, A as ArgumentMetadata } from '../../pipe-transform.interface-BlzOrUy3.js';
3
+ import { E as EventHandler } from '../../script-event-handler.interface-B-Th4Ssg.js';
4
+ import { G as Guard, I as Interceptor, a as ErrorFilter, E as EventMetadata } from '../../event-metadata.interface-CREizDNq.js';
5
+ import { C as Controller, M as ModuleContainer } from '../../controller-Ss0TVrxQ.js';
6
+ import { b as ExecutionContextBase } from '../../execution-context.interface-DpRN4oVj.js';
7
+ import { R as RPCMetadata } from '../../rpc-metadata.interface-DS-GqgqA.js';
8
+ import { C as ControllerMetadata } from '../../module-metadata.interface-B3bn1vqq.js';
9
+ import { S as ScriptRPCHandler } from '../../script-rpc-handler.interface-DBpD9-yk.js';
10
+ import { a as CallHandler } from '../../call-handler.interface-DVdaknsB.js';
11
+ import 'inversify';
12
+ import '../../method-param-type.enum-BfrJ8zqa.js';
13
+ import '../../script-event-handler.interface-vUr_v6tV.js';
14
+ import '../../execution-context-type.enum-fwYPtPvp.js';
15
+ import '../../rpc-error.interface-CeaZLqzE.js';
16
+ import 'croner';
17
+ import '../../injection-token.type-dQTkkP6p.js';
18
+ import '../../injectable-scope.enum-CjyQMpW2.js';
19
+
20
+ declare class ControllerEventHandler {
21
+ private readonly appEnv;
22
+ private readonly multiplayerService;
23
+ private readonly eventService;
24
+ private readonly controllerFlowHandler;
25
+ private readonly pipelineHandler;
26
+ private readonly loggerService;
27
+ private readonly createMangoRequest;
28
+ private readonly createExecutionContext;
29
+ registerEvent(guards: (Newable<Guard> | Guard)[], interceptors: (Newable<Interceptor> | Interceptor)[], pipes: (Newable<Pipe> | Pipe)[], mappedErrorFilters: [any | 'MANGO_ANY_ERROR', Newable<ErrorFilter> | ErrorFilter][], controller: Controller, event: EventMetadata): EventHandler;
30
+ private handleEvent;
31
+ }
32
+
33
+ declare class ControllerFlowHandler {
34
+ private readonly appEnv;
35
+ private readonly pipelineHandler;
36
+ createArgs(controller: Controller, executionContext: ExecutionContextBase, metadata: RPCMetadata | EventMetadata, pipes: (Newable<Pipe> | Pipe)[], player?: PlayerMp): Promise<unknown[]>;
37
+ }
38
+
39
+ declare class ControllerMetadataReader {
40
+ private readonly appEnv;
41
+ private readonly loggerService;
42
+ read(classRef: Newable): Promise<ControllerMetadata>;
43
+ private getEvents;
44
+ private getRPCs;
45
+ private getMethodParams;
46
+ private getPipeline;
47
+ private getTimers;
48
+ }
49
+
50
+ declare class ControllerRPCHandler {
51
+ private readonly appEnv;
52
+ private readonly rpcService;
53
+ private readonly pipelineHandler;
54
+ private readonly controllerFlowHandler;
55
+ private readonly loggerService;
56
+ private readonly createMangoRequest;
57
+ private readonly createMangoResponse;
58
+ private readonly createExecutionContext;
59
+ registerRPC(guards: (Newable<Guard> | Guard)[], interceptors: (Newable<Interceptor> | Interceptor)[], pipes: (Newable<Pipe> | Pipe)[], mappedErrorFilters: [any | 'MANGO_ANY_ERROR', Newable<ErrorFilter> | ErrorFilter][], controller: Controller, rpc: RPCMetadata): Promise<ScriptRPCHandler>;
60
+ private handleRPC;
61
+ }
62
+
63
+ declare class PipelineHandler {
64
+ private readonly loggerService;
65
+ goTroughGuards(executionContext: ExecutionContextBase, guards: (Newable<Guard> | Guard)[], container: ModuleContainer): Promise<void>;
66
+ goThroughInterceptors(executionContext: ExecutionContextBase, interceptors: (Newable<Interceptor> | Interceptor)[], container: ModuleContainer, callHandler: CallHandler): Promise<void>;
67
+ goTroughPipes(value: unknown, pipes: (Newable<Pipe> | Pipe)[], argumentMetadata: ArgumentMetadata, container: ModuleContainer): Promise<unknown>;
68
+ }
69
+
70
+ export { Controller, ControllerEventHandler, ControllerFlowHandler, ControllerMetadataReader, ControllerRPCHandler, PipelineHandler };
@@ -0,0 +1,24 @@
1
+ import {
2
+ Controller,
3
+ ControllerEventHandler,
4
+ ControllerFlowHandler,
5
+ ControllerMetadataReader,
6
+ ControllerRPCHandler,
7
+ PipelineHandler
8
+ } from "../../chunk-SKPH3K2M.js";
9
+ import "../../chunk-HK7QTFPA.js";
10
+ import "../../chunk-TBWHLT75.js";
11
+ import "../../chunk-DJZCOYB3.js";
12
+ import "../../chunk-6YEWPMZJ.js";
13
+ import "../../chunk-DXPVUDXD.js";
14
+ import "../../chunk-E6IQL4S6.js";
15
+ import "../../chunk-7QVYU63E.js";
16
+ export {
17
+ Controller,
18
+ ControllerEventHandler,
19
+ ControllerFlowHandler,
20
+ ControllerMetadataReader,
21
+ ControllerRPCHandler,
22
+ PipelineHandler
23
+ };
24
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,27 @@
1
+ export { E as EventDestination } from '../../event-destination.enum-DT8jJFwR.js';
2
+ export { E as ExecutionContextType } from '../../execution-context-type.enum-fwYPtPvp.js';
3
+ export { M as MethodParamType } from '../../method-param-type.enum-BfrJ8zqa.js';
4
+
5
+ declare enum AppEnviroment {
6
+ Client = 0,
7
+ Server = 1
8
+ }
9
+
10
+ declare enum CoreMetadataKey {
11
+ Injectable = "mango:injectable",
12
+ Inject = "mango:inject",
13
+ Module = "mango:module",
14
+ GlobalModule = "mango:global-module",
15
+ Controller = "mango:controller-options",
16
+ ControllerEvents = "mango:controller-events",
17
+ ControllerRPCs = "mango:controller-rpcs",
18
+ ControllerParams = "mango:controller-rpc-params",
19
+ Guards = "mango:guards",
20
+ Interceptors = "mango:interceptors",
21
+ Pipes = "mango:pipes",
22
+ Catch = "mango:catch",
23
+ ErrorFilters = "mango:error-filters",
24
+ Timers = "mango:timers"
25
+ }
26
+
27
+ export { AppEnviroment, CoreMetadataKey };
@@ -0,0 +1,16 @@
1
+ import {
2
+ AppEnviroment,
3
+ CoreMetadataKey,
4
+ EventDestination,
5
+ ExecutionContextType,
6
+ MethodParamType
7
+ } from "../../chunk-TBWHLT75.js";
8
+ import "../../chunk-7QVYU63E.js";
9
+ export {
10
+ AppEnviroment,
11
+ CoreMetadataKey,
12
+ EventDestination,
13
+ ExecutionContextType,
14
+ MethodParamType
15
+ };
16
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K
@@ -0,0 +1,138 @@
1
+ export { APP_ENVIROMENT, CONTAINER_OPTIONS, ENABLE_SHUTDOWN_HOOKS, EXECUTION_CONTEXT_FACTORY, GLOBAL_APP_CONTAINER, GLOBAL_ERROR_FILTERS, GLOBAL_GUARDS, GLOBAL_INTERCEPTORS, GLOBAL_PIPES, INTERNAL_APP_CONTAINER, LOG_ERROR_STACKTRACE, MANGO_LOG_PREFIX, MANGO_REQUEST_FACTORY, MANGO_RESPONSE_FACTORY, MULTIPLAYER_SERVICE, PLUGINS, RPC_RESULT_HANDLER_NOT_FOUND, RPC_RESULT_PLAYER_DISCONNECTED, RPC_RESULT_PLAYER_NOT_FOUND, RPC_RESULT_TIMEOUT, RPC_RESULT_UNKNOWN } from './constants/index.js';
2
+ export { ControllerEventHandler, ControllerFlowHandler, ControllerMetadataReader, ControllerRPCHandler, PipelineHandler } from './controller/index.js';
3
+ export { C as Controller, a as Module, M as ModuleContainer } from '../controller-Ss0TVrxQ.js';
4
+ import { AppEnviroment } from './enums/index.js';
5
+ export { CoreMetadataKey } from './enums/index.js';
6
+ export { E as EventDestination } from '../event-destination.enum-DT8jJFwR.js';
7
+ export { E as ExecutionContextType } from '../execution-context-type.enum-fwYPtPvp.js';
8
+ export { M as MethodParamType } from '../method-param-type.enum-BfrJ8zqa.js';
9
+ export { C as ControllerMetadata, a as CronTimerMetadata, E as EveryTickTimerMetadata, I as IntervalTimerMetadata, M as ModuleMetadata, b as TimeoutTimerMetadata, T as TimerMetadata } from '../module-metadata.interface-B3bn1vqq.js';
10
+ import { MultiplayerService, MangoPlugin } from './interfaces/index.js';
11
+ export { InjectableMetadata, InternalEventService, InternalRPCService, InternalWebViewService, RPCPayload } from './interfaces/index.js';
12
+ import { G as Guard, I as Interceptor, a as ErrorFilter } from '../event-metadata.interface-CREizDNq.js';
13
+ export { B as BodyParameter, C as CustomParameter, E as EventMetadata, M as MethodParameter, b as ParamParameter, P as PipelineMetadata, c as PlayerParameter, R as RequestParameter, d as ResponseParameter } from '../event-metadata.interface-CREizDNq.js';
14
+ import { E as EventEmmiter } from '../event-emmiter.interface-7Ne9W8SM.js';
15
+ import { S as ScriptEventHandler } from '../script-event-handler.interface-vUr_v6tV.js';
16
+ export { E as ExecutionContext, b as ExecutionContextBase, M as MangoRequest, c as MangoRequestBase, a as MangoResponse, d as MangoResponseBase } from '../execution-context.interface-DpRN4oVj.js';
17
+ export { R as RPCMetadata } from '../rpc-metadata.interface-DS-GqgqA.js';
18
+ import { M as MultiplayerTimers, a as MultiplayerTimer } from '../multiplayer-timers.interface-CFDTWwAT.js';
19
+ export { ModuleMetadataReader } from './module/index.js';
20
+ export { AppRuntime, ModuleDependencyBinder, ModuleTreeScanner } from './module-tree/index.js';
21
+ export { BaseEventService, BaseRPCService } from './services/index.js';
22
+ export { Tree, TreeNode } from './utils/index.js';
23
+ import { Container, interfaces } from 'inversify';
24
+ import { N as Newable } from '../newable.type-BdhG3MZC.js';
25
+ import { P as Pipe } from '../pipe-transform.interface-BlzOrUy3.js';
26
+ import '../rpc-result.interface-C758heM0.js';
27
+ import '../rpc-error.interface-CeaZLqzE.js';
28
+ import '../script-event-handler.interface-B-Th4Ssg.js';
29
+ import '../script-rpc-handler.interface-DBpD9-yk.js';
30
+ import '../call-handler.interface-DVdaknsB.js';
31
+ import '../injection-token.type-dQTkkP6p.js';
32
+ import '../injectable-scope.enum-CjyQMpW2.js';
33
+ import 'croner';
34
+ import '../rpc-call-options.interface-BJ5mHrvT.js';
35
+ import '../logger-service.interface-BGV-o_Fx.js';
36
+
37
+ declare class RageMPEventEmmiter implements EventEmmiter {
38
+ private mapEvents;
39
+ private mapEventsShared;
40
+ constructor(mapEvents?: Record<string, string>);
41
+ private getEventName;
42
+ emit(eventName: string, ...args: any[]): void;
43
+ on(eventName: string, listener: (...args: any[]) => void): ScriptEventHandler;
44
+ once(eventName: string, listener: (...args: any[]) => void): ScriptEventHandler;
45
+ off(eventName: string, listener: (...args: any[]) => void): void;
46
+ }
47
+
48
+ declare class RageMPMultiplayerService implements MultiplayerService {
49
+ readonly Timers: MultiplayerTimers;
50
+ readonly Events: EventEmmiter;
51
+ constructor();
52
+ parseInternalArgs<U = unknown, T = unknown>(...args: any): {
53
+ player?: U;
54
+ body?: T;
55
+ };
56
+ log(arg: any, ...args: any[]): void;
57
+ logError(arg: any, ...args: any[]): void;
58
+ logWarning(arg: any, ...args: any[]): void;
59
+ logDebug(arg: any, ...args: any[]): void;
60
+ }
61
+
62
+ declare class RageMPScriptEvent implements ScriptEventHandler {
63
+ private eventName;
64
+ private listener;
65
+ constructor(eventName: string, listener: (...args: any[]) => void);
66
+ destroy(): void;
67
+ }
68
+
69
+ declare class RageMPTimer implements MultiplayerTimer {
70
+ id: number;
71
+ interval: number;
72
+ once: boolean;
73
+ callback: Function;
74
+ private clearTimer;
75
+ lastTick: number;
76
+ constructor(id: number, interval: number | undefined, once: boolean, callback: Function, clearTimer: Function);
77
+ destroy(): void;
78
+ }
79
+
80
+ declare class RageMPTimers implements MultiplayerTimers {
81
+ private timerIncrementer;
82
+ private timers;
83
+ private everyTickHandlers;
84
+ private isEveryTickRunning;
85
+ private everyTickMainHandler;
86
+ get all(): MultiplayerTimer[];
87
+ get warningThreshold(): number;
88
+ set warningThreshold(_value: number);
89
+ get sourceLocationFrameSkipCount(): number;
90
+ set sourceLocationFrameSkipCount(_value: number);
91
+ getByID(id: number): MultiplayerTimer | null;
92
+ private createTimer;
93
+ setInterval(callback: Function, time: number, ...args: unknown[]): RageMPTimer;
94
+ setTimeout(callback: Function, time: number, ...args: unknown[]): RageMPTimer;
95
+ everyTick(callback: Function, ...args: unknown[]): RageMPTimer;
96
+ nextTick(callback: Function, ...args: unknown[]): RageMPTimer;
97
+ time(_name?: string): void;
98
+ timeEnd(_name?: string): void;
99
+ }
100
+
101
+ declare class App {
102
+ private readonly moduleTreeScanner;
103
+ private readonly moduleDependencyBinder;
104
+ private readonly appRuntime;
105
+ private readonly internalAppContainer;
106
+ private readonly plugins;
107
+ private readonly loggerService;
108
+ private moduleTree;
109
+ private loaded;
110
+ start<T>(rootModule: Newable<T>): Promise<void>;
111
+ stop(): Promise<void>;
112
+ private runPluginMethods;
113
+ }
114
+
115
+ declare class AppBuilder<G extends Guard = Guard, I extends Interceptor = Interceptor, EF extends ErrorFilter = ErrorFilter> {
116
+ protected readonly enviroment: string;
117
+ protected readonly internalAppContainer: Container;
118
+ protected readonly multiplayerService: MultiplayerService;
119
+ protected readonly plugins: Newable<MangoPlugin>[];
120
+ private globalContainerOptions;
121
+ useGlobalGuards(...guards: (Newable<G> | G)[]): this;
122
+ useGlobalInterceptors(...interceptors: (Newable<I> | I)[]): this;
123
+ useGlobalPipes(...pipes: (Newable<Pipe> | Pipe)[]): this;
124
+ useGlobalFilters(...filters: (Newable<EF> | EF)[]): this;
125
+ usePlugins(...plugins: Newable<MangoPlugin>[]): this;
126
+ enableShutdownHooks(): this;
127
+ setContainerOptions(options: interfaces.ContainerOptions, onlyGlobal?: boolean): this;
128
+ build(): Promise<App>;
129
+ }
130
+
131
+ declare function createAppBuilder<T extends AppBuilder>({ enviroment, plugins, appBuilderInherit, multiplayerService, }: {
132
+ enviroment: AppEnviroment;
133
+ plugins: Newable<MangoPlugin>[];
134
+ appBuilderInherit: Newable<T>;
135
+ multiplayerService?: MultiplayerService;
136
+ }): Promise<T>;
137
+
138
+ export { App, AppBuilder, AppEnviroment, ErrorFilter, EventEmmiter, Guard, Interceptor, MangoPlugin, MultiplayerService, MultiplayerTimer, MultiplayerTimers, RageMPEventEmmiter, RageMPMultiplayerService, RageMPScriptEvent, RageMPTimer, RageMPTimers, ScriptEventHandler, createAppBuilder };
@@ -0,0 +1,132 @@
1
+ import {
2
+ App,
3
+ AppBuilder,
4
+ AppRuntime,
5
+ ModuleDependencyBinder,
6
+ ModuleTreeScanner,
7
+ RageMPEventEmmiter,
8
+ RageMPMultiplayerService,
9
+ RageMPScriptEvent,
10
+ RageMPTimer,
11
+ RageMPTimers,
12
+ createAppBuilder
13
+ } from "../chunk-CW7WAA3P.js";
14
+ import {
15
+ Module,
16
+ ModuleContainer,
17
+ ModuleMetadataReader
18
+ } from "../chunk-73LIJA6X.js";
19
+ import {
20
+ ExecutionContextBase,
21
+ MangoRequestBase,
22
+ MangoResponseBase
23
+ } from "../chunk-AO6BXG54.js";
24
+ import {
25
+ BaseEventService,
26
+ BaseRPCService
27
+ } from "../chunk-2ADQZWQE.js";
28
+ import {
29
+ Tree,
30
+ TreeNode
31
+ } from "../chunk-RYOUF322.js";
32
+ import "../chunk-PGWRESZG.js";
33
+ import {
34
+ Controller,
35
+ ControllerEventHandler,
36
+ ControllerFlowHandler,
37
+ ControllerMetadataReader,
38
+ ControllerRPCHandler,
39
+ PipelineHandler
40
+ } from "../chunk-SKPH3K2M.js";
41
+ import {
42
+ APP_ENVIROMENT,
43
+ CONTAINER_OPTIONS,
44
+ ENABLE_SHUTDOWN_HOOKS,
45
+ EXECUTION_CONTEXT_FACTORY,
46
+ GLOBAL_APP_CONTAINER,
47
+ GLOBAL_ERROR_FILTERS,
48
+ GLOBAL_GUARDS,
49
+ GLOBAL_INTERCEPTORS,
50
+ GLOBAL_PIPES,
51
+ INTERNAL_APP_CONTAINER,
52
+ LOG_ERROR_STACKTRACE,
53
+ MANGO_LOG_PREFIX,
54
+ MANGO_REQUEST_FACTORY,
55
+ MANGO_RESPONSE_FACTORY,
56
+ MULTIPLAYER_SERVICE,
57
+ PLUGINS,
58
+ RPC_RESULT_HANDLER_NOT_FOUND,
59
+ RPC_RESULT_PLAYER_DISCONNECTED,
60
+ RPC_RESULT_PLAYER_NOT_FOUND,
61
+ RPC_RESULT_TIMEOUT,
62
+ RPC_RESULT_UNKNOWN
63
+ } from "../chunk-HK7QTFPA.js";
64
+ import {
65
+ AppEnviroment,
66
+ CoreMetadataKey,
67
+ EventDestination,
68
+ ExecutionContextType,
69
+ MethodParamType
70
+ } from "../chunk-TBWHLT75.js";
71
+ import "../chunk-M55YEQ7J.js";
72
+ import "../chunk-DJZCOYB3.js";
73
+ import "../chunk-6YEWPMZJ.js";
74
+ import "../chunk-DXPVUDXD.js";
75
+ import "../chunk-E6IQL4S6.js";
76
+ import "../chunk-7QVYU63E.js";
77
+ export {
78
+ APP_ENVIROMENT,
79
+ App,
80
+ AppBuilder,
81
+ AppEnviroment,
82
+ AppRuntime,
83
+ BaseEventService,
84
+ BaseRPCService,
85
+ CONTAINER_OPTIONS,
86
+ Controller,
87
+ ControllerEventHandler,
88
+ ControllerFlowHandler,
89
+ ControllerMetadataReader,
90
+ ControllerRPCHandler,
91
+ CoreMetadataKey,
92
+ ENABLE_SHUTDOWN_HOOKS,
93
+ EXECUTION_CONTEXT_FACTORY,
94
+ EventDestination,
95
+ ExecutionContextBase,
96
+ ExecutionContextType,
97
+ GLOBAL_APP_CONTAINER,
98
+ GLOBAL_ERROR_FILTERS,
99
+ GLOBAL_GUARDS,
100
+ GLOBAL_INTERCEPTORS,
101
+ GLOBAL_PIPES,
102
+ INTERNAL_APP_CONTAINER,
103
+ LOG_ERROR_STACKTRACE,
104
+ MANGO_LOG_PREFIX,
105
+ MANGO_REQUEST_FACTORY,
106
+ MANGO_RESPONSE_FACTORY,
107
+ MULTIPLAYER_SERVICE,
108
+ MangoRequestBase,
109
+ MangoResponseBase,
110
+ MethodParamType,
111
+ Module,
112
+ ModuleContainer,
113
+ ModuleDependencyBinder,
114
+ ModuleMetadataReader,
115
+ ModuleTreeScanner,
116
+ PLUGINS,
117
+ PipelineHandler,
118
+ RPC_RESULT_HANDLER_NOT_FOUND,
119
+ RPC_RESULT_PLAYER_DISCONNECTED,
120
+ RPC_RESULT_PLAYER_NOT_FOUND,
121
+ RPC_RESULT_TIMEOUT,
122
+ RPC_RESULT_UNKNOWN,
123
+ RageMPEventEmmiter,
124
+ RageMPMultiplayerService,
125
+ RageMPScriptEvent,
126
+ RageMPTimer,
127
+ RageMPTimers,
128
+ Tree,
129
+ TreeNode,
130
+ createAppBuilder
131
+ };
132
+ //# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFtdLAogICJzb3VyY2VzQ29udGVudCI6IFtdLAogICJtYXBwaW5ncyI6ICIiLAogICJuYW1lcyI6IFtdCn0K