@ragemp-mango/client 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.
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,15 @@
1
+ import { MangoRequest as MangoRequest$1, MangoResponse as MangoResponse$1, ExecutionContext as ExecutionContext$1, Guard as Guard$1 } from '@ragemp-mango/core/app';
2
+
3
+ interface MangoRequest<TData = unknown> extends MangoRequest$1<TData> {
4
+ }
5
+
6
+ interface MangoResponse extends MangoResponse$1 {
7
+ }
8
+
9
+ interface ExecutionContext<TRequest extends MangoRequest = MangoRequest, TResponse extends MangoResponse = MangoResponse> extends ExecutionContext$1<TRequest, TResponse> {
10
+ }
11
+
12
+ interface Guard extends Guard$1<MangoRequest, MangoResponse> {
13
+ }
14
+
15
+ export type { ExecutionContext as E, Guard as G, MangoRequest as M, MangoResponse as a };
@@ -0,0 +1,327 @@
1
+ import { ErrorFilter as ErrorFilter$1, Interceptor as Interceptor$1, ScriptEventHandler, EventEmmiter, MultiplayerService, AppBuilder } from '@ragemp-mango/core/app';
2
+ import { M as MangoRequest, a as MangoResponse, G as Guard } from './guard.interface-DzGLAoda.js';
3
+ export { E as ExecutionContext } from './guard.interface-DzGLAoda.js';
4
+ import { RPCCallOptions, RPCResult, ScriptRPCHandler, Newable } from '@ragemp-mango/core';
5
+ export { Body, Catch, Controller, Cron, EveryTick, Global, Index, Inject, Injectable, Interval, Module, Optional, Param, Req, Request, Res, Response, SetMetadata, Timeout, UsePipes, applyDecorators, createParamDecorator, forwardRef } from '@ragemp-mango/core/decorators';
6
+ export { ArgumentMetadata, BeforeAppShutdown, CallHandler, ClassProvider, ControllerOptions, CreateDecoratorOptions, CreateDecoratorWithTransformOptions, DynamicModule, ExistingProvider, FactoryProvider, InjectableOptions, LoggerService, ModuleOptions, OnAppBootstrap, OnAppShutdown, OnModuleDestroy, OnModuleInit, OptionalFactoryDependency, Pipe, Provider, RPCCallOptions, RPCError, RPCResult, ReflectableDecorator, ScriptRPCHandler, ValueProvider } from '@ragemp-mango/core/interfaces';
7
+ export { Abstract, CustomDecorator, InjectionToken, Newable } from '@ragemp-mango/core/types';
8
+ export { EVENT_SERVICE, LOGGER_SERVICE, MODULE_CONTAINER, REFLECTOR_SERVICE, RPC_SERVICE, TIMER_SERVICE } from '@ragemp-mango/core/constants';
9
+ export { InjectableScope, RPCResultStatus } from '@ragemp-mango/core/enums';
10
+ export { DefaultValuePipe } from '@ragemp-mango/core/pipes';
11
+ export { GuardCancelError, GuardInvalidReturnError, MangoError, TooManyRequests, UnknownError } from '@ragemp-mango/core/errors';
12
+ export { generateRandomId, isConstructor, isEmpty, isFunction, isNil, isNumber, isObject, isString, isSymbol, isUndefined } from '@ragemp-mango/core/utils';
13
+ export { ReflectorService, TimerService } from '@ragemp-mango/core/services';
14
+
15
+ interface ErrorFilter<T = unknown> extends ErrorFilter$1<T, MangoRequest, MangoResponse> {
16
+ }
17
+
18
+ interface Interceptor<THandlerResult = unknown> extends Interceptor$1<THandlerResult, MangoRequest, MangoResponse> {
19
+ }
20
+
21
+ interface EventService {
22
+ on<E extends keyof MangoEvents.CustomClientEvent>(eventName: E, callback: (body: Parameters<MangoEvents.CustomClientEvent[E]>[0]) => void | Promise<void>): ScriptEventHandler;
23
+ on<E extends string>(eventName: Exclude<E, keyof MangoEvents.CustomClientEvent>, callback: (body: unknown) => void | Promise<void>): ScriptEventHandler;
24
+ once<E extends keyof MangoEvents.CustomClientEvent>(eventName: E, callback: (body: Parameters<MangoEvents.CustomClientEvent[E]>[0]) => void | Promise<void>): ScriptEventHandler;
25
+ once<E extends string>(eventName: Exclude<E, keyof MangoEvents.CustomClientEvent>, callback: (body: unknown) => void | Promise<void>): ScriptEventHandler;
26
+ emit<E extends keyof MangoEvents.CustomClientEvent>(eventName: E, body?: Parameters<MangoEvents.CustomClientEvent[E]>[0]): void;
27
+ emit<E extends string>(eventName: Exclude<E, keyof MangoEvents.CustomClientEvent>, body?: unknown): void;
28
+ onServer<E extends keyof MangoEvents.CustomServerToPlayerEvent>(eventName: E, callback: (body: Parameters<MangoEvents.CustomServerToPlayerEvent[E]>[0]) => void | Promise<void>): ScriptEventHandler;
29
+ onServer<E extends string>(eventName: Exclude<E, keyof MangoEvents.CustomServerToPlayerEvent>, callback: (body: unknown) => void | Promise<void>): ScriptEventHandler;
30
+ onceServer<E extends keyof MangoEvents.CustomServerToPlayerEvent>(eventName: E, callback: (body: Parameters<MangoEvents.CustomServerToPlayerEvent[E]>[0]) => void | Promise<void>): ScriptEventHandler;
31
+ onceServer<E extends string>(eventName: Exclude<E, keyof MangoEvents.CustomServerToPlayerEvent>, callback: (body: unknown) => void | Promise<void>): ScriptEventHandler;
32
+ emitServer<E extends keyof MangoEvents.CustomPlayerToServerEvent>(eventName: E, body?: Parameters<MangoEvents.CustomPlayerToServerEvent[E]>[0]): void;
33
+ emitServer<E extends string>(eventName: Exclude<E, keyof MangoEvents.CustomPlayerToServerEvent>, body?: unknown): void;
34
+ onWebView<E extends keyof MangoEvents.CustomWebViewToClientEvent>(id: string | number, eventName: E, callback: (body: Parameters<MangoEvents.CustomWebViewToClientEvent[E]>[0]) => void | Promise<void>): ScriptEventHandler;
35
+ onWebView<E extends string>(id: string | number, eventName: Exclude<E, keyof MangoEvents.CustomWebViewToClientEvent>, callback: (body: unknown) => void | Promise<void>): ScriptEventHandler;
36
+ onceWebView<E extends keyof MangoEvents.CustomWebViewToClientEvent>(id: string | number, eventName: E, callback: (body: Parameters<MangoEvents.CustomWebViewToClientEvent[E]>[0]) => void | Promise<void>): ScriptEventHandler;
37
+ onceWebView<E extends string>(id: string | number, eventName: Exclude<E, keyof MangoEvents.CustomWebViewToClientEvent>, callback: (body: unknown) => void | Promise<void>): ScriptEventHandler;
38
+ emitWebView<E extends keyof MangoEvents.CustomClientToWebViewEvent>(id: string | number, eventName: E, body?: Parameters<MangoEvents.CustomClientToWebViewEvent[E]>[0]): void;
39
+ emitWebView<E extends string>(id: string | number, eventName: Exclude<E, keyof MangoEvents.CustomClientToWebViewEvent>, body?: unknown): void;
40
+ onRender(callback: () => void): ScriptEventHandler;
41
+ onBrowserDomReady(callback: (browser: BrowserMp) => void): ScriptEventHandler;
42
+ onBrowserLoadingFailed(callback: (browser: BrowserMp) => void): ScriptEventHandler;
43
+ onPlayerChat(callback: (text: string) => void): ScriptEventHandler;
44
+ onPlayerCommand(callback: (command: string) => void): ScriptEventHandler;
45
+ onPlayerDeath(callback: (killer?: PlayerMp, reason?: number) => void): ScriptEventHandler;
46
+ onPlayerSpawn(callback: () => void): ScriptEventHandler;
47
+ onPlayerEnterVehicle(callback: (vehicle: VehicleMp, seat: number) => void): ScriptEventHandler;
48
+ onPlayerExitVehicle(callback: (vehicle: VehicleMp) => void): ScriptEventHandler;
49
+ onPlayerEnterColshape(callback: (colshape: ColshapeMp) => void): ScriptEventHandler;
50
+ onPlayerExitColshape(callback: (colshape: ColshapeMp) => void): ScriptEventHandler;
51
+ onPlayerEnterCheckpoint(callback: (checkpoint: CheckpointMp) => void): ScriptEventHandler;
52
+ onPlayerExitCheckpoint(callback: (checkpoint: CheckpointMp) => void): ScriptEventHandler;
53
+ }
54
+
55
+ interface RPCService {
56
+ call<E extends keyof MangoRPC.CustomClientRPC>(rpcName: E, body?: Parameters<MangoRPC.CustomClientRPC[E]>[0], options?: RPCCallOptions): Promise<RPCResult<ReturnType<MangoRPC.CustomClientRPC[E]>>>;
57
+ call<E extends string>(rpcName: Exclude<E, keyof MangoRPC.CustomClientRPC>, body?: unknown, options?: RPCCallOptions): Promise<RPCResult<unknown>>;
58
+ onRequest<E extends keyof MangoRPC.CustomClientRPC>(rpcName: E, handler: (body: Parameters<MangoRPC.CustomClientRPC[E]>[0]) => ReturnType<MangoRPC.CustomClientRPC[E]>): ScriptRPCHandler;
59
+ onRequest<E extends string>(rpcName: Exclude<E, keyof MangoRPC.CustomClientRPC>, handler: (body: unknown) => unknown | Promise<unknown>): ScriptRPCHandler;
60
+ callServer<E extends keyof MangoRPC.CustomClientToServerRPC>(rpcName: E, body?: Parameters<MangoRPC.CustomClientToServerRPC[E]>[0], options?: RPCCallOptions): Promise<RPCResult<ReturnType<MangoRPC.CustomClientToServerRPC[E]>>>;
61
+ callServer<E extends string>(rpcName: Exclude<E, keyof MangoRPC.CustomClientToServerRPC>, body?: unknown, options?: RPCCallOptions): Promise<RPCResult>;
62
+ onServerRequest<E extends keyof MangoRPC.CustomServerToClientRPC>(rpcName: E, handler: (body: Parameters<MangoRPC.CustomServerToClientRPC[E]>[0]) => ReturnType<MangoRPC.CustomServerToClientRPC[E]>): ScriptRPCHandler;
63
+ onServerRequest<E extends string>(rpcName: Exclude<E, keyof MangoRPC.CustomServerToClientRPC>, handler: (body: unknown) => unknown | Promise<unknown>): ScriptRPCHandler;
64
+ callWebView<E extends keyof MangoRPC.CustomClientToWebviewRPC>(id: string | number, rpcName: E, body?: Parameters<MangoRPC.CustomClientToWebviewRPC[E]>[0], options?: RPCCallOptions): Promise<RPCResult<ReturnType<MangoRPC.CustomClientToWebviewRPC[E]>>>;
65
+ callWebView<E extends string>(id: string | number, rpcName: Exclude<E, keyof MangoRPC.CustomClientToWebviewRPC>, body?: unknown, options?: RPCCallOptions): Promise<RPCResult>;
66
+ onWebViewRequest<E extends keyof MangoRPC.CustomWebViewToClientRPC>(id: string | number, rpcName: E, handler: (body: Parameters<MangoRPC.CustomWebViewToClientRPC[E]>[0]) => ReturnType<MangoRPC.CustomWebViewToClientRPC[E]>): ScriptRPCHandler;
67
+ onWebViewRequest<E extends string>(id: string | number, rpcName: Exclude<E, keyof MangoRPC.CustomWebViewToClientRPC>, handler: (body: unknown) => unknown | Promise<unknown>): ScriptRPCHandler;
68
+ }
69
+
70
+ interface ClientEventEmmiter extends EventEmmiter {
71
+ emitServer(eventName: string, ...args: any[]): void;
72
+ onServer(eventName: string, listener: (...args: any[]) => void): ScriptEventHandler;
73
+ onceServer(eventName: string, listener: (...args: any[]) => void): ScriptEventHandler;
74
+ offServer(eventName: string, listener: (...args: any[]) => void): void;
75
+ }
76
+
77
+ interface MultiplayerWebViewCreateOptionsOverlay {
78
+ url: string;
79
+ visible?: boolean;
80
+ overlay?: boolean;
81
+ }
82
+ interface MultiplayerWebViewCreateOptionsDrawable {
83
+ url: string;
84
+ drawable: number | string;
85
+ targetTexture: string;
86
+ }
87
+ interface MultiplayerWebView {
88
+ readonly valid: boolean;
89
+ url: string;
90
+ destroy(): void;
91
+ reload(ignoreCache: boolean): void;
92
+ emit(eventName: string, ...args: unknown[]): void;
93
+ on(eventName: string, listener: (...args: unknown[]) => void): void;
94
+ once(eventName: string, listener: (...args: unknown[]) => void): void;
95
+ off(eventName: string, listener: (...args: unknown[]) => void): void;
96
+ }
97
+ interface MultiplayerWebViewManager {
98
+ create(options: MultiplayerWebViewCreateOptionsDrawable): MultiplayerWebView;
99
+ create(options: MultiplayerWebViewCreateOptionsOverlay): MultiplayerWebView;
100
+ getByID(id: number): MultiplayerWebView | null;
101
+ }
102
+
103
+ interface ClientMultiplayerService extends MultiplayerService {
104
+ Events: ClientEventEmmiter;
105
+ WebView: MultiplayerWebViewManager;
106
+ setAudioFactory(factory: unknown): void;
107
+ setAudioFilterFactory(factory: unknown): void;
108
+ setAudioOutputAttachedFactory(factory: unknown): void;
109
+ setAudioOutputFrontendFactory(factory: unknown): void;
110
+ setAudioOutputWorldFactory(factory: unknown): void;
111
+ setBlipFactory(factory: unknown): void;
112
+ setMarkerFactory(factory: unknown): void;
113
+ setColshapeFactory(factory: unknown): void;
114
+ setCheckpointFactory(factory: unknown): void;
115
+ setObjectFactory(factory: unknown): void;
116
+ setLocalObjectFactory(factory: unknown): void;
117
+ setPedFactory(factory: unknown): void;
118
+ setLocalPedFactory(factory: unknown): void;
119
+ setLocalPlayerFactory(factory: unknown): void;
120
+ setLocalVehicleFactory(factory: unknown): void;
121
+ setPlayerFactory(factory: unknown): void;
122
+ setRmlDocumentFactory(factory: unknown): void;
123
+ setTextLabelFactory(factory: unknown): void;
124
+ setVehicleFactory(factory: unknown): void;
125
+ setVirtualEntityGroupFactory(factory: unknown): void;
126
+ setVirtualEntityFactory(factory: unknown): void;
127
+ setWebSocketClientFactory(factory: unknown): void;
128
+ setWebViewFactory(factory: unknown): void;
129
+ }
130
+
131
+ interface WebViewService {
132
+ create(id: string | number, options: MultiplayerWebViewCreateOptionsOverlay): MultiplayerWebView;
133
+ create(id: string | number, options: MultiplayerWebViewCreateOptionsDrawable): MultiplayerWebView;
134
+ get(id: string | number): MultiplayerWebView | undefined;
135
+ tryGet(id: string | number): MultiplayerWebView;
136
+ destroy(id: string | number): void;
137
+ }
138
+
139
+ declare function UseFilters(...filters: (Newable<ErrorFilter> | ErrorFilter)[]): ClassDecorator & MethodDecorator;
140
+
141
+ declare function OnScriptRPC(): MethodDecorator;
142
+ declare function OnceScriptRPC(): MethodDecorator;
143
+ declare function OnScriptRPCAnswer(): MethodDecorator;
144
+ declare function OnceScriptRPCAnswer(): MethodDecorator;
145
+ declare function OnKeyBoardEvent(): MethodDecorator;
146
+ declare function OnceKeyBoardEvent(): MethodDecorator;
147
+ declare function OnKeyUp(): MethodDecorator;
148
+ declare function OnceKeyUp(): MethodDecorator;
149
+ declare function OnKeyDown(): MethodDecorator;
150
+ declare function OnceKeyDown(): MethodDecorator;
151
+ declare function OnWebViewEvent(): MethodDecorator;
152
+ declare function OnceWebViewEvent(): MethodDecorator;
153
+ declare function OnWebSocketEvent(): MethodDecorator;
154
+ declare function OnceWebSocketEvent(): MethodDecorator;
155
+ declare function OnAudioEvent(): MethodDecorator;
156
+ declare function OnceAudioEvent(): MethodDecorator;
157
+ declare function OnRmluiEvent(): MethodDecorator;
158
+ declare function OnceRmluiEvent(): MethodDecorator;
159
+ declare function OnWindowFocusChange(): MethodDecorator;
160
+ declare function OnceWindowFocusChange(): MethodDecorator;
161
+ declare function OnWindowResolutionChange(): MethodDecorator;
162
+ declare function OnceWindowResolutionChange(): MethodDecorator;
163
+ declare function OnConnectionComplete(): MethodDecorator;
164
+ declare function OnceConnectionComplete(): MethodDecorator;
165
+ declare function OnDisconnect(): MethodDecorator;
166
+ declare function OnceDisconnect(): MethodDecorator;
167
+ declare function OnSpawned(): MethodDecorator;
168
+ declare function OnceSpawned(): MethodDecorator;
169
+ declare function OnGameEntityCreate(): MethodDecorator;
170
+ declare function OnceGameEntityCreate(): MethodDecorator;
171
+ declare function OnGameEntityDestroy(): MethodDecorator;
172
+ declare function OnceGameEntityDestroy(): MethodDecorator;
173
+ declare function OnEntityHitEntity(): MethodDecorator;
174
+ declare function OnceEntityHitEntity(): MethodDecorator;
175
+ declare function OnTaskChange(): MethodDecorator;
176
+ declare function OnceTaskChange(): MethodDecorator;
177
+ declare function OnPlayerWeaponShoot(): MethodDecorator;
178
+ declare function OncePlayerWeaponShoot(): MethodDecorator;
179
+ declare function OnPlayerBulletHit(): MethodDecorator;
180
+ declare function OncePlayerBulletHit(): MethodDecorator;
181
+ declare function OnPlayerWeaponChange(): MethodDecorator;
182
+ declare function OncePlayerWeaponChange(): MethodDecorator;
183
+ declare function OnPlayerStartVehicleEnter(): MethodDecorator;
184
+ declare function OncePlayerStartVehicleEnter(): MethodDecorator;
185
+ declare function OnPlayerStartVehicleLeave(): MethodDecorator;
186
+ declare function OncePlayerStartVehicleLeave(): MethodDecorator;
187
+ declare function OnPlayerVehicleEntered(): MethodDecorator;
188
+ declare function OncePlayerVehicleEntered(): MethodDecorator;
189
+ declare function OnPlayerVehicleLeft(): MethodDecorator;
190
+ declare function OncePlayerVehicleLeft(): MethodDecorator;
191
+ declare function OnPlayerVehicleSeatChange(): MethodDecorator;
192
+ declare function OncePlayerVehicleSeatChange(): MethodDecorator;
193
+ declare function OnVoiceConnection(): MethodDecorator;
194
+ declare function OnceVoiceConnection(): MethodDecorator;
195
+ declare function OnPlayerStartTalking(): MethodDecorator;
196
+ declare function OncePlayerStartTalking(): MethodDecorator;
197
+ declare function OnPlayerStopTalking(): MethodDecorator;
198
+ declare function OncePlayerStopTalking(): MethodDecorator;
199
+ declare function OnWorldObjectPositionChange(): MethodDecorator;
200
+ declare function OnceWorldObjectPositionChange(): MethodDecorator;
201
+ declare function OnWorldObjectStreamIn(): MethodDecorator;
202
+ declare function OnceWorldObjectStreamIn(): MethodDecorator;
203
+ declare function OnWorldObjectStreamOut(): MethodDecorator;
204
+ declare function OnceWorldObjectStreamOut(): MethodDecorator;
205
+ declare function OnEvent(): MethodDecorator;
206
+ declare function OnceEvent(): MethodDecorator;
207
+ declare function OnBaseObjectCreate(): MethodDecorator;
208
+ declare function OnceBaseObjectCreate(): MethodDecorator;
209
+ declare function OnBaseObjectRemove(): MethodDecorator;
210
+ declare function OnceBaseObjectRemove(): MethodDecorator;
211
+ declare function OnNetOwnerChange(): MethodDecorator;
212
+ declare function OnceNetOwnerChange(): MethodDecorator;
213
+ declare function OnWeaponDamage(): MethodDecorator;
214
+ declare function OnceWeaponDamage(): MethodDecorator;
215
+ declare function OnMetaChange(): MethodDecorator;
216
+ declare function OnceMetaChange(): MethodDecorator;
217
+ declare function OnLocalMetaChange(): MethodDecorator;
218
+ declare function OnceLocalMetaChange(): MethodDecorator;
219
+ declare function OnSyncedMetaChange(): MethodDecorator;
220
+ declare function OnceSyncedMetaChange(): MethodDecorator;
221
+ declare function OnStreamSyncedMetaChange(): MethodDecorator;
222
+ declare function OnceStreamSyncedMetaChange(): MethodDecorator;
223
+ declare function OnGlobalMetaChange(): MethodDecorator;
224
+ declare function OnceGlobalMetaChange(): MethodDecorator;
225
+ declare function OnGlobalSyncedMetaChange(): MethodDecorator;
226
+ declare function OnceGlobalSyncedMetaChange(): MethodDecorator;
227
+ declare function OnEntityColShapeEnter(): MethodDecorator;
228
+ declare function OnceEntityColShapeEnter(): MethodDecorator;
229
+ declare function OnEntityColShapeLeave(): MethodDecorator;
230
+ declare function OnceEntityColShapeLeave(): MethodDecorator;
231
+ declare function OnEntityCheckpointEnter(): MethodDecorator;
232
+ declare function OnceEntityCheckpointEnter(): MethodDecorator;
233
+ declare function OnEntityCheckpointLeave(): MethodDecorator;
234
+ declare function OnceEntityCheckpointLeave(): MethodDecorator;
235
+ declare function OnColShapeEvent(): MethodDecorator;
236
+ declare function OnceColShapeEvent(): MethodDecorator;
237
+ declare function OnConsoleCommand(): MethodDecorator;
238
+ declare function OnceConsoleCommand(): MethodDecorator;
239
+ declare function OnError(): MethodDecorator;
240
+ declare function OnceError(): MethodDecorator;
241
+ declare function OnLocalScriptEvent(): MethodDecorator;
242
+ declare function OnceLocalScriptEvent(): MethodDecorator;
243
+ declare function OnRemoteScriptEvent(): MethodDecorator;
244
+ declare function OnceRemoteScriptEvent(): MethodDecorator;
245
+ declare function OnResourceStart(): MethodDecorator;
246
+ declare function OnceResourceStart(): MethodDecorator;
247
+ declare function OnResourceStop(): MethodDecorator;
248
+ declare function OnceResourceStop(): MethodDecorator;
249
+ declare function OnResourceError(): MethodDecorator;
250
+ declare function OnceResourceError(): MethodDecorator;
251
+
252
+ declare function OnServer<E extends keyof MangoEvents.CustomServerToPlayerEvent>(eventName?: E): MethodDecorator;
253
+ declare function OnServer<E extends string>(eventName?: Exclude<E, keyof MangoEvents.CustomServerToPlayerEvent>): MethodDecorator;
254
+
255
+ declare function OnWebView<E extends keyof MangoEvents.CustomWebViewToClientEvent>(id: string | number, eventName?: E): MethodDecorator;
256
+ declare function OnWebView<E extends string>(id: string | number, eventName?: Exclude<E, keyof MangoEvents.CustomWebViewToClientEvent>): MethodDecorator;
257
+
258
+ declare function On<E extends keyof MangoEvents.CustomClientEvent>(eventName?: E): MethodDecorator;
259
+ declare function On<E extends string>(eventName?: Exclude<E, keyof MangoEvents.CustomClientEvent>): MethodDecorator;
260
+
261
+ declare function OnceServer<E extends keyof MangoEvents.CustomServerToPlayerEvent>(eventName?: E): MethodDecorator;
262
+ declare function OnceServer<E extends string>(eventName?: Exclude<E, keyof MangoEvents.CustomServerToPlayerEvent>): MethodDecorator;
263
+
264
+ declare function OnceWebView<E extends keyof MangoEvents.CustomWebViewToClientEvent>(id: string | number, eventName?: E): MethodDecorator;
265
+ declare function OnceWebView<E extends string>(id: string | number, eventName?: Exclude<E, keyof MangoEvents.CustomWebViewToClientEvent>): MethodDecorator;
266
+
267
+ declare function Once<E extends keyof MangoEvents.CustomClientEvent>(eventName?: E): MethodDecorator;
268
+ declare function Once<E extends string>(eventName?: Exclude<E, keyof MangoEvents.CustomClientEvent>): MethodDecorator;
269
+
270
+ declare function UseGuards(...guards: (Newable<Guard> | Guard)[]): ClassDecorator & MethodDecorator;
271
+
272
+ declare function UseInterceptors(...interceptors: (Newable<Interceptor> | Interceptor)[]): ClassDecorator & MethodDecorator;
273
+
274
+ declare function OnRequest<E extends keyof MangoRPC.CustomClientRPC>(rpcName?: E): MethodDecorator;
275
+ declare function OnRequest<E extends string>(rpcName?: Exclude<E, keyof MangoRPC.CustomClientRPC>): MethodDecorator;
276
+
277
+ declare function OnServerRequest<E extends keyof MangoRPC.CustomServerToClientRPC>(rpcName?: E): MethodDecorator;
278
+ declare function OnServerRequest<E extends string>(rpcName?: Exclude<E, keyof MangoRPC.CustomServerToClientRPC>): MethodDecorator;
279
+
280
+ declare function OnWebViewRequest<E extends keyof MangoRPC.CustomWebViewToClientRPC>(id: string | number, rpcName?: E): MethodDecorator;
281
+ declare function OnWebViewRequest<E extends string>(id: string | number, rpcName?: Exclude<E, keyof MangoRPC.CustomWebViewToClientRPC>): MethodDecorator;
282
+
283
+ declare const WEBVIEW_SERVICE = "WEBVIEW_SERVICE";
284
+
285
+ // RageMP Client type extensions
286
+ // These are empty placeholders - extend MangoEvents and MangoRPC namespaces in your project
287
+
288
+ declare global {
289
+ namespace MangoEvents {
290
+ // Extend these in your project
291
+ }
292
+
293
+ namespace MangoRPC {
294
+ // Extend these in your project
295
+ }
296
+ }
297
+
298
+ declare class ClientAppBuilder extends AppBuilder<Guard, Interceptor, ErrorFilter> {
299
+ addWebView(id: string | number, options: MultiplayerWebViewCreateOptionsDrawable): ClientAppBuilder;
300
+ addWebView(id: string | number, options: MultiplayerWebViewCreateOptionsOverlay): ClientAppBuilder;
301
+ setAudioFactory(factory: unknown): void;
302
+ setAudioFilterFactory(factory: unknown): void;
303
+ setAudioOutputAttachedFactory(factory: unknown): void;
304
+ setAudioOutputFrontendFactory(factory: unknown): void;
305
+ setAudioOutputWorldFactory(factory: unknown): void;
306
+ setBlipFactory(factory: unknown): void;
307
+ setMarkerFactory(factory: unknown): void;
308
+ setColShapeFactory(factory: unknown): void;
309
+ setCheckpointFactory(factory: unknown): void;
310
+ setObjectFactory(factory: unknown): void;
311
+ setLocalObjectFactory(factory: unknown): void;
312
+ setPedFactory(factory: unknown): void;
313
+ setLocalPedFactory(factory: unknown): void;
314
+ setLocalPlayerFactory(factory: unknown): void;
315
+ setLocalVehicleFactory(factory: unknown): void;
316
+ setPlayerFactory(factory: unknown): void;
317
+ setRmlDocumentFactory(factory: unknown): void;
318
+ setTextLabelFactory(factory: unknown): void;
319
+ setVehicleFactory(factory: unknown): void;
320
+ setVirtualEntityGroupFactory(factory: unknown): void;
321
+ setVirtualEntityFactory(factory: unknown): void;
322
+ setWebSocketClientFactory(factory: unknown): void;
323
+ setWebViewFactory(factory: unknown): void;
324
+ }
325
+ declare function createAppBuilder(): Promise<ClientAppBuilder>;
326
+
327
+ export { type ClientEventEmmiter, type ClientMultiplayerService, type ErrorFilter, type EventService, Guard, type Interceptor, MangoRequest, MangoResponse, type MultiplayerWebView, type MultiplayerWebViewCreateOptionsDrawable, type MultiplayerWebViewCreateOptionsOverlay, type MultiplayerWebViewManager, On, OnAudioEvent, OnBaseObjectCreate, OnBaseObjectRemove, OnColShapeEvent, OnConnectionComplete, OnConsoleCommand, OnDisconnect, OnEntityCheckpointEnter, OnEntityCheckpointLeave, OnEntityColShapeEnter, OnEntityColShapeLeave, OnEntityHitEntity, OnError, OnEvent, OnGameEntityCreate, OnGameEntityDestroy, OnGlobalMetaChange, OnGlobalSyncedMetaChange, OnKeyBoardEvent, OnKeyDown, OnKeyUp, OnLocalMetaChange, OnLocalScriptEvent, OnMetaChange, OnNetOwnerChange, OnPlayerBulletHit, OnPlayerStartTalking, OnPlayerStartVehicleEnter, OnPlayerStartVehicleLeave, OnPlayerStopTalking, OnPlayerVehicleEntered, OnPlayerVehicleLeft, OnPlayerVehicleSeatChange, OnPlayerWeaponChange, OnPlayerWeaponShoot, OnRemoteScriptEvent, OnRequest, OnResourceError, OnResourceStart, OnResourceStop, OnRmluiEvent, OnScriptRPC, OnScriptRPCAnswer, OnServer, OnServerRequest, OnSpawned, OnStreamSyncedMetaChange, OnSyncedMetaChange, OnTaskChange, OnVoiceConnection, OnWeaponDamage, OnWebSocketEvent, OnWebView, OnWebViewEvent, OnWebViewRequest, OnWindowFocusChange, OnWindowResolutionChange, OnWorldObjectPositionChange, OnWorldObjectStreamIn, OnWorldObjectStreamOut, Once, OnceAudioEvent, OnceBaseObjectCreate, OnceBaseObjectRemove, OnceColShapeEvent, OnceConnectionComplete, OnceConsoleCommand, OnceDisconnect, OnceEntityCheckpointEnter, OnceEntityCheckpointLeave, OnceEntityColShapeEnter, OnceEntityColShapeLeave, OnceEntityHitEntity, OnceError, OnceEvent, OnceGameEntityCreate, OnceGameEntityDestroy, OnceGlobalMetaChange, OnceGlobalSyncedMetaChange, OnceKeyBoardEvent, OnceKeyDown, OnceKeyUp, OnceLocalMetaChange, OnceLocalScriptEvent, OnceMetaChange, OnceNetOwnerChange, OncePlayerBulletHit, OncePlayerStartTalking, OncePlayerStartVehicleEnter, OncePlayerStartVehicleLeave, OncePlayerStopTalking, OncePlayerVehicleEntered, OncePlayerVehicleLeft, OncePlayerVehicleSeatChange, OncePlayerWeaponChange, OncePlayerWeaponShoot, OnceRemoteScriptEvent, OnceResourceError, OnceResourceStart, OnceResourceStop, OnceRmluiEvent, OnceScriptRPC, OnceScriptRPCAnswer, OnceServer, OnceSpawned, OnceStreamSyncedMetaChange, OnceSyncedMetaChange, OnceTaskChange, OnceVoiceConnection, OnceWeaponDamage, OnceWebSocketEvent, OnceWebView, OnceWebViewEvent, OnceWindowFocusChange, OnceWindowResolutionChange, OnceWorldObjectPositionChange, OnceWorldObjectStreamIn, OnceWorldObjectStreamOut, type RPCService, UseFilters, UseGuards, UseInterceptors, WEBVIEW_SERVICE, type WebViewService, createAppBuilder };