diff --git a/Docs %40 0.0.30-alpha.0.-.md b/Docs %40 0.0.30-alpha.0.-.md new file mode 100644 index 0000000..6f2bbd1 --- /dev/null +++ b/Docs %40 0.0.30-alpha.0.-.md @@ -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 diff --git a/Docs.md b/Docs.md deleted file mode 100644 index aa054a3..0000000 --- a/Docs.md +++ /dev/null @@ -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 \ No newline at end of file