links bump + more setters

rilaxik 2024-10-30 15:37:56 +00:00
parent c4ef099b61
commit d8d33bacfa

@ -36,7 +36,7 @@ Package used on a server-side of your Rage:MP Server
```ts ```ts
import { fw } from '@entityseven/rage-fw-server' import { fw } from '@entityseven/rage-fw-server'
``` ```
Only usable in server environment. For usage in [Client](#client) and [Browser](#browser) refer to their sections Only usable in server environment. For usage in [Client](#client) and [Browser](#browser-1) refer to their sections
## Declaration ## Declaration
```ts ```ts
@ -147,7 +147,7 @@ Package used on a client-side of your Rage:MP Server
```ts ```ts
import { fw } from '@entityseven/rage-fw-client' import { fw } from '@entityseven/rage-fw-client'
``` ```
Only usable in client environment. For usage in [Server](#server) and [Browser](#browser) refer to their docs Only usable in client environment. For usage in [Server](#server) and [Browser](#browser-1) refer to their docs
## Declaration ## Declaration
```ts ```ts
@ -281,6 +281,20 @@ Further documentation will describe the fields included in ``fw``
## Browser ## Browser
Browser-side interactions Browser-side interactions
### debugLogs
Setter. Enables console debug logs for events
```ts
fw.event.debugLogs = true
```
### customLogger
Setter. Enables console debug logs for events
```ts
fw.event.customLogger = () => (method: string, eventName: string, ...args: unknown[]) => {
// log with desired formatting
}
```
### register ### register
Registers a browser event with an associated callback Registers a browser event with an associated callback
```ts ```ts
@ -289,7 +303,6 @@ fw.event.register("showNotification", (message, color) => {
}) })
``` ```
### unregister ### unregister
Unregisters a browser event, removing the associated callback Unregisters a browser event, removing the associated callback
```ts ```ts
@ -326,6 +339,9 @@ fw.event.triggerClient("clientEventName", ["message to client"])
## Rpc ## Rpc
``rage-fw-rpc`` instance used under the hood. It is highly recommended to use this one if you need it instead of creating a new instance ``rage-fw-rpc`` instance used under the hood. It is highly recommended to use this one if you need it instead of creating a new instance
### ``forceBrowserDevMode``?
``rage-fw-rpc`` has a setting which enables it to be ran in browser dev mode without MP context ([see Wiki -> Rpc -> Rpc Config](https://git.entityseven.com/entityseven/rage-framework/wiki)). As ``rage-fw-browser`` does not expose Rpc constructor, you can use ``.env`` with ``RageFW_forceBrowserDevMode=true`` to enable it
# Features # Features
## Event Middlewares ## Event Middlewares
Rage FW offers you to add middlewares when registering events in Client and Server environments, to check if callback should be executed or should not. Core class functionality is not exposed to user, but some types are for easier code managing. Here are some key points (in context of Server environment, but also applicable to Client) Rage FW offers you to add middlewares when registering events in Client and Server environments, to check if callback should be executed or should not. Core class functionality is not exposed to user, but some types are for easier code managing. Here are some key points (in context of Server environment, but also applicable to Client)