structure

rilaxik 2024-06-14 18:04:28 +00:00
parent 945f3ed130
commit 6f0ed1b70b
2 changed files with 148 additions and 34 deletions

@ -0,0 +1,148 @@
> RageFW and it's documentation is still in early development and may contain come unclear explanations. It you find any of those please open an issue and describe you problem or any improvemenets you want to see
RageFW distibutes under a list of packages:
- ``rage-fw-server``
- ``rage-fw-client``
- ``rage-fw-cef``
- ``rage-fw-shared-types``
These are setup as-should if you are using our CLI, if you still want to setup yourself, please refer to [example](https://git.entityseven.com/entityseven/rage-framework-example)
## Shared types
Core element of type-safety in our framework system. It allows you to manually type any **custom** events you have in your server system.
There are three interfaces, which share between the system to apply types:
- ``RageFW_ICustomClientEvent``
- ``RageFW_ICustomServerEvent``
- ``RageFW_ICustomCefEvent``
To apply types for events we use the following system and below is a sample how it applies them your code
```ts
customEventName(arg1: string, arg2: number): boolean
```
```ts
register('customEventName', (arg1 /*string*/, arg2 /*number*/) => {
// your logic
return true /*boolean*/
})
```
## Server
Package used on a server-side of your Rage:MP Server.
### Usage
```ts
import { fw } from 'rage-fw-server'
```
Only usable in server environment. For usage in Client and CEF refer to their docs
### Declaration
```ts
fw = {
event: Server,
player: Player,
system: {
log: Logger
}
}
```
Further documentation will describe the functions included in ``fw``
### Server
#### register
#### registerMany
#### unregister
#### trigger
### Player
#### triggerClient
#### triggerBrowser
### System
#### Logger
##### info
##### warn
##### error
## Client
```ts
import { fw } from 'rage-fw-client'
```
Only usable in client environment. For usage in Server and CEF refer to their docs
### Declaration
```ts
fw = {
event: Client,
player: Player,
browser: Browser,
system: {
log: Logger
}
}
```
Further documentation will describe the functions included in ``fw``
### Client
#### register
#### unregister
### Player
#### trigger
#### triggerServer
#### triggerBrowser
### Browser
#### registerBrowser
### System
#### Log
##### info
##### warn
##### error
## CEF
### Usage
```ts
import { fw } from 'rage-fw-cef'
```
Only usable in CEF environment. For usage in Server and Client refer to their docs
### Declaration
```ts
fw = {
event: Cef,
}
```
Further documentation will describe the functions included in ``fw``
### Cef
#### register
#### trigger
#### triggerServer
#### triggerClient

34
Docs.md

@ -1,34 +0,0 @@
> RageFW and it's documentation is still in early development and may contain come unclear explanations. It you find any of those please open an issue and describe you problem or any improvemenets you want to see
RageFW distibutes under a list of packages:
- ``rage-fw-server``
- ``rage-fw-client``
- ``rage-fw-cef``
- ``rage-fw-shared-types``
These are setup as-should if you are using our CLI, if you still want to setup yourself, please refer to [example](https://git.entityseven.com/entityseven/rage-framework-example)
## Shared types
Core element of type-safety in our framework system. It allows you to manually type any **custom** events you have in your server system.
There are three interfaces, which share between the system to apply types:
- ``RageFW_ICustomClientEvent``
- ``RageFW_ICustomServerEvent``
- ``RageFW_ICustomCefEvent``
To apply types for events we use the following system and below is a sample how it applies them your code
```ts
customEventName(arg1: string, arg2: number): boolean
```
```ts
register('customEventName', (arg1 /*string*/, arg2 /*number*/) => {
// your logic
return true /*boolean*/
})
```
## Server
## Client
## CEF