Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
77d667ce67 | ||
|
|
5064fb6347 | ||
|
|
bea9d570ad | ||
|
|
3b20276486 | ||
|
|
39dfe4c71d | ||
|
|
318c6b2387 | ||
|
|
e408a599a5 | ||
|
|
3ce49e85a9 | ||
|
|
b3e152c4f0 |
+11
-4
@@ -1,9 +1,16 @@
|
|||||||
import { build } from 'esbuild'
|
import { build } from 'esbuild'
|
||||||
|
import { umdWrapper } from 'esbuild-plugin-umd-wrapper'
|
||||||
build({
|
build({
|
||||||
entryPoints: ['./src/index.ts'],
|
entryPoints: ['./src/index.ts'],
|
||||||
format: 'esm',
|
bundle: true,
|
||||||
|
format: 'umd',
|
||||||
platform: 'node',
|
platform: 'node',
|
||||||
target: 'node10.4',
|
|
||||||
outdir: './dist',
|
outdir: './dist',
|
||||||
}).then(r => console.log('Successfully build.'))
|
plugins: [
|
||||||
|
umdWrapper({
|
||||||
|
libraryName: 'fw',
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}).then(() => {
|
||||||
|
console.log('Successfully build. Executing types build...')
|
||||||
|
})
|
||||||
|
|||||||
+7
-5
@@ -1,21 +1,23 @@
|
|||||||
{
|
{
|
||||||
"name": "rage-fw-client",
|
"name": "rage-fw-client",
|
||||||
"version": "0.0.2-alpha.0",
|
"version": "0.0.6-alpha.0",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"files": [
|
"files": [
|
||||||
"dist/**/*"
|
"dist/**/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node --es-module-specifier-resolution=node build.js",
|
"build": "node --es-module-specifier-resolution=node build.js && pnpm types",
|
||||||
"types": "dts-bundle-generator --config dts.config.json"
|
"types": "dts-bundle-generator --config dts.config.json"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"dependencies": {
|
||||||
"@ragempcommunity/types-client": "^2.1.8",
|
"@ragempcommunity/types-client": "^2.1.8",
|
||||||
"rage-fw-shared-types": "workspace:^"
|
"rage-fw-shared-types": "workspace:^",
|
||||||
|
"rage-rpc": "^0.4.0"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "SashaGoncharov19",
|
"author": "SashaGoncharov19",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Client side of rage-fw"
|
"description": "Client side of rage-fw",
|
||||||
|
"gitHead": "053e4fd12aa120d53e11e0d2009c0df78c1a2ad0"
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-2
@@ -1,10 +1,21 @@
|
|||||||
import rpc from 'rage-rpc'
|
import rpc from 'rage-rpc'
|
||||||
import type {
|
import {
|
||||||
RageFW_ClientEventReturn,
|
RageFW_ClientEventReturn,
|
||||||
RageFW_ClientEvent,
|
RageFW_ClientEvent,
|
||||||
RageFW_ClientEventArguments,
|
RageFW_ClientEventArguments,
|
||||||
|
RageFW_ClientServerCallback,
|
||||||
|
RageFW_ClientServerEvent,
|
||||||
} from './types'
|
} from './types'
|
||||||
|
|
||||||
|
class Client {
|
||||||
|
public register<EventName extends RageFW_ClientServerEvent>(
|
||||||
|
eventName: EventName,
|
||||||
|
callback: RageFW_ClientServerCallback<EventName>,
|
||||||
|
): void {
|
||||||
|
rpc.register(eventName, callback as rpc.ProcedureListener)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class Player {
|
class Player {
|
||||||
public triggerServer<EventName extends RageFW_ClientEvent>(
|
public triggerServer<EventName extends RageFW_ClientEvent>(
|
||||||
eventName: EventName,
|
eventName: EventName,
|
||||||
@@ -14,6 +25,9 @@ class Player {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const rage = {
|
const fw = {
|
||||||
|
event: new Client(),
|
||||||
player: new Player(),
|
player: new Player(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default fw
|
||||||
|
|||||||
+10
-1
@@ -1,6 +1,9 @@
|
|||||||
/// <reference types="@ragempcommunity/types-client" />
|
/// <reference types="@ragempcommunity/types-client" />
|
||||||
|
|
||||||
import type { RageFW_ICustomClientEvent } from 'rage-fw-shared-types'
|
import type {
|
||||||
|
RageFW_ICustomClientEvent,
|
||||||
|
RageFW_ICustomServerEvent,
|
||||||
|
} from 'rage-fw-shared-types'
|
||||||
|
|
||||||
export type RageFW_ClientEvent =
|
export type RageFW_ClientEvent =
|
||||||
| keyof RageFW_ICustomClientEvent
|
| keyof RageFW_ICustomClientEvent
|
||||||
@@ -15,3 +18,9 @@ export type RageFW_ClientEventReturn<K extends RageFW_ClientEvent> =
|
|||||||
K extends keyof RageFW_ICustomClientEvent
|
K extends keyof RageFW_ICustomClientEvent
|
||||||
? ReturnType<RageFW_ICustomClientEvent[K]>
|
? ReturnType<RageFW_ICustomClientEvent[K]>
|
||||||
: never
|
: never
|
||||||
|
|
||||||
|
export type RageFW_ClientServerEvent = keyof RageFW_ICustomServerEvent
|
||||||
|
|
||||||
|
export type RageFW_ClientServerCallback<K extends RageFW_ClientServerEvent> = (
|
||||||
|
args: Parameters<RageFW_ICustomServerEvent[K]>,
|
||||||
|
) => ReturnType<RageFW_ICustomServerEvent[K]>
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
|
||||||
"version": "0.0.2-alpha.0",
|
"version": "0.0.6-alpha.0",
|
||||||
"npmClient": "pnpm"
|
"npmClient": "pnpm"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -6,10 +6,11 @@
|
|||||||
"@ragempcommunity/types-server": "^2.1.8",
|
"@ragempcommunity/types-server": "^2.1.8",
|
||||||
"dts-bundle-generator": "^9.5.1",
|
"dts-bundle-generator": "^9.5.1",
|
||||||
"esbuild": "^0.21.5",
|
"esbuild": "^0.21.5",
|
||||||
|
"esbuild-plugin-umd-wrapper": "^2.0.0",
|
||||||
|
"lerna": "^8.1.3",
|
||||||
"prettier": "^3.3.1",
|
"prettier": "^3.3.1",
|
||||||
"rage-rpc": "^0.4.0",
|
"rage-rpc": "^0.4.0",
|
||||||
"typescript": "^5.4.5",
|
"typescript": "^5.4.5"
|
||||||
"lerna": "^8.1.3"
|
|
||||||
},
|
},
|
||||||
"type": "module"
|
"type": "module"
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+35
-25
@@ -22,6 +22,9 @@ importers:
|
|||||||
esbuild:
|
esbuild:
|
||||||
specifier: ^0.21.5
|
specifier: ^0.21.5
|
||||||
version: 0.21.5
|
version: 0.21.5
|
||||||
|
esbuild-plugin-umd-wrapper:
|
||||||
|
specifier: ^2.0.0
|
||||||
|
version: 2.0.0
|
||||||
lerna:
|
lerna:
|
||||||
specifier: ^8.1.3
|
specifier: ^8.1.3
|
||||||
version: 8.1.3([email protected])
|
version: 8.1.3([email protected])
|
||||||
@@ -43,12 +46,21 @@ importers:
|
|||||||
rage-fw-shared-types:
|
rage-fw-shared-types:
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../shared-types
|
version: link:../shared-types
|
||||||
|
rage-rpc:
|
||||||
|
specifier: ^0.4.0
|
||||||
|
version: 0.4.0
|
||||||
|
|
||||||
server:
|
server:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@ragempcommunity/types-server':
|
||||||
|
specifier: ^2.1.8
|
||||||
|
version: 2.1.8
|
||||||
rage-fw-shared-types:
|
rage-fw-shared-types:
|
||||||
specifier: workspace:^
|
specifier: workspace:^
|
||||||
version: link:../shared-types
|
version: link:../shared-types
|
||||||
|
rage-rpc:
|
||||||
|
specifier: ^0.4.0
|
||||||
|
version: 0.4.0
|
||||||
|
|
||||||
shared: {}
|
shared: {}
|
||||||
|
|
||||||
@@ -1533,6 +1545,12 @@ packages:
|
|||||||
integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==,
|
integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-pcu2/lcm29S85VCnSJuValrQ8FqeFJs5VWEwfp7vBRsOHjxZypcxgwXjxDIxDRo17uOcENZIbgz2szjln029eQ==,
|
||||||
|
}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -1751,13 +1769,6 @@ packages:
|
|||||||
}
|
}
|
||||||
engines: { node: '>=10' }
|
engines: { node: '>=10' }
|
||||||
|
|
||||||
[email protected]:
|
|
||||||
resolution:
|
|
||||||
{
|
|
||||||
integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=10' }
|
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -2184,13 +2195,6 @@ packages:
|
|||||||
}
|
}
|
||||||
engines: { node: '>=8' }
|
engines: { node: '>=8' }
|
||||||
|
|
||||||
[email protected]:
|
|
||||||
resolution:
|
|
||||||
{
|
|
||||||
integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==,
|
|
||||||
}
|
|
||||||
engines: { node: '>=8' }
|
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -2709,6 +2713,12 @@ packages:
|
|||||||
integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==,
|
integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution:
|
||||||
|
{
|
||||||
|
integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==,
|
||||||
|
}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
@@ -3917,10 +3927,10 @@ packages:
|
|||||||
engines: { node: '>=14.17' }
|
engines: { node: '>=14.17' }
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
[email protected]7.4:
|
[email protected]8.0:
|
||||||
resolution:
|
resolution:
|
||||||
{
|
{
|
||||||
integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==,
|
integrity: sha512-SyVVbcNBCk0dzr9XL/R/ySrmYf0s372K6/hFklzgcp2lBFyXtw4I7BOdDjlLhE1aVqaI/SHWXWmYdlZxuyF38A==,
|
||||||
}
|
}
|
||||||
engines: { node: '>=0.8.0' }
|
engines: { node: '>=0.8.0' }
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -5029,6 +5039,8 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-arrayish: 0.2.1
|
is-arrayish: 0.2.1
|
||||||
|
|
||||||
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@esbuild/aix-ppc64': 0.21.5
|
'@esbuild/aix-ppc64': 0.21.5
|
||||||
@@ -5066,9 +5078,9 @@ snapshots:
|
|||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
cross-spawn: 7.0.3
|
cross-spawn: 7.0.3
|
||||||
get-stream: 6.0.1
|
get-stream: 6.0.0
|
||||||
human-signals: 2.1.0
|
human-signals: 2.1.0
|
||||||
is-stream: 2.0.1
|
is-stream: 2.0.0
|
||||||
merge-stream: 2.0.0
|
merge-stream: 2.0.0
|
||||||
npm-run-path: 4.0.1
|
npm-run-path: 4.0.1
|
||||||
onetime: 5.1.2
|
onetime: 5.1.2
|
||||||
@@ -5179,8 +5191,6 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]: {}
|
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
dargs: 7.0.0
|
dargs: 7.0.0
|
||||||
@@ -5255,7 +5265,7 @@ snapshots:
|
|||||||
source-map: 0.6.1
|
source-map: 0.6.1
|
||||||
wordwrap: 1.0.0
|
wordwrap: 1.0.0
|
||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
uglify-js: 3.17.4
|
uglify-js: 3.18.0
|
||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
@@ -5322,7 +5332,7 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
ms: 2.1.2
|
ms: 2.1.3
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -5443,8 +5453,6 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]: {}
|
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
text-extensions: 1.9.0
|
text-extensions: 1.9.0
|
||||||
@@ -5837,6 +5845,8 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/minimatch': 3.0.5
|
'@types/minimatch': 3.0.5
|
||||||
@@ -6611,7 +6621,7 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]7.4:
|
[email protected]8.0:
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
|
|||||||
+2
-1
@@ -2,7 +2,8 @@ import { build } from 'esbuild'
|
|||||||
|
|
||||||
build({
|
build({
|
||||||
entryPoints: ['./src/index.ts'],
|
entryPoints: ['./src/index.ts'],
|
||||||
format: 'esm',
|
bundle: true,
|
||||||
|
format: 'cjs',
|
||||||
platform: 'node',
|
platform: 'node',
|
||||||
target: 'node10.4',
|
target: 'node10.4',
|
||||||
outdir: './dist',
|
outdir: './dist',
|
||||||
|
|||||||
@@ -6,10 +6,7 @@
|
|||||||
"entries": [
|
"entries": [
|
||||||
{
|
{
|
||||||
"filePath": "./src/index.ts",
|
"filePath": "./src/index.ts",
|
||||||
"outFile": "./dist/index.d.ts",
|
"outFile": "./dist/index.d.ts"
|
||||||
"libraries": {
|
|
||||||
"inlinedLibraries": ["@ragempcommunity/types-server"]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
+8
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rage-fw-server",
|
"name": "rage-fw-server",
|
||||||
"version": "0.0.2-alpha.0",
|
"version": "0.0.6-alpha.0",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -8,14 +8,17 @@
|
|||||||
"dist/**/*"
|
"dist/**/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node --es-module-specifier-resolution=node build.js",
|
"build": "node --es-module-specifier-resolution=node build.js && pnpm types",
|
||||||
"types": "dts-bundle-generator --config dts.config.json"
|
"types": "dts-bundle-generator --config dts.config.json"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"dependencies": {
|
||||||
"rage-fw-shared-types": "workspace:^"
|
"@ragempcommunity/types-server": "^2.1.8",
|
||||||
|
"rage-fw-shared-types": "workspace:^",
|
||||||
|
"rage-rpc": "^0.4.0"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "SashaGoncharov19",
|
"author": "SashaGoncharov19",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Server side for rage-fw"
|
"description": "Server side for rage-fw",
|
||||||
|
"gitHead": "053e4fd12aa120d53e11e0d2009c0df78c1a2ad0"
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-10
@@ -1,27 +1,56 @@
|
|||||||
import rpc from 'rage-rpc'
|
import rpc from 'rage-rpc'
|
||||||
import type { RageFW_ServerEvent, RageFW_ServerEventCallback } from './types.js'
|
import {
|
||||||
|
RageFW_ClientEvent,
|
||||||
|
RageFW_ClientEventArguments,
|
||||||
|
RageFW_ClientEventReturn,
|
||||||
|
RageFW_ServerEvent,
|
||||||
|
RageFW_ServerEventCallback,
|
||||||
|
} from './types.js'
|
||||||
|
import { nativeEvents } from './native.events'
|
||||||
|
|
||||||
class Server {
|
class Server {
|
||||||
public register<EventName extends RageFW_ServerEvent>(
|
public register<EventName extends RageFW_ServerEvent>(
|
||||||
eventName: EventName,
|
eventName: EventName,
|
||||||
callback: RageFW_ServerEventCallback<EventName>,
|
callback: RageFW_ServerEventCallback<EventName>,
|
||||||
): void {
|
): void {
|
||||||
rpc.register(eventName, callback as rpc.ProcedureListener)
|
if (nativeEvents.includes(eventName)) {
|
||||||
|
mp.events.add(eventName, callback)
|
||||||
|
} else {
|
||||||
|
rpc.register(eventName, callback as rpc.ProcedureListener)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public registerMany<EventName extends RageFW_ServerEvent>(events: {
|
public registerMany<EventName extends RageFW_ServerEvent>(events: {
|
||||||
[event in EventName]: RageFW_ServerEventCallback<event>
|
[event in EventName]: RageFW_ServerEventCallback<event>
|
||||||
}): void {
|
}): void {
|
||||||
Object.entries(events).map(([eventName, callback]) =>
|
Object.entries(events).map(([eventName, callback]) => {
|
||||||
rpc.register(eventName, (args: unknown[]) => {
|
if (nativeEvents.includes(eventName)) {
|
||||||
return Array.isArray(args)
|
mp.events.add(
|
||||||
? (callback as (...arg: typeof args) => void)(...args)
|
eventName as keyof IServerEvents,
|
||||||
: (callback as (arg: typeof args) => void)(args)
|
callback as (...arg: unknown[]) => void,
|
||||||
}),
|
)
|
||||||
)
|
} else {
|
||||||
|
rpc.register(eventName, (args: unknown[]) => {
|
||||||
|
return Array.isArray(args)
|
||||||
|
? (callback as (...arg: typeof args) => void)(...args)
|
||||||
|
: (callback as (arg: typeof args) => void)(args)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const rage = {
|
class Player {
|
||||||
|
public triggerClient<EventName extends RageFW_ClientEvent>(
|
||||||
|
player: PlayerMp,
|
||||||
|
eventName: EventName,
|
||||||
|
...args: RageFW_ClientEventArguments<EventName>
|
||||||
|
): Promise<RageFW_ClientEventReturn<EventName>> {
|
||||||
|
return rpc.callClient(player, eventName, args)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const fw = {
|
||||||
event: new Server(),
|
event: new Server(),
|
||||||
|
player: new Player(),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
export const nativeEvents = [
|
||||||
|
'entityCreated',
|
||||||
|
'entityDestroyed',
|
||||||
|
'entityModelChange',
|
||||||
|
'incomingConnection',
|
||||||
|
'packagesLoaded',
|
||||||
|
'playerChat',
|
||||||
|
'playerCommand',
|
||||||
|
'playerDamage',
|
||||||
|
'playerDeath',
|
||||||
|
'playerEnterCheckpoint',
|
||||||
|
'playerEnterColshape',
|
||||||
|
'playerEnterVehicle',
|
||||||
|
'playerExitCheckpoint',
|
||||||
|
'playerExitColshape',
|
||||||
|
'playerExitVehicle',
|
||||||
|
'playerJoin',
|
||||||
|
'playerQuit',
|
||||||
|
'playerReachWaypoint',
|
||||||
|
'playerReady',
|
||||||
|
'playerSpawn',
|
||||||
|
'playerStartEnterVehicle',
|
||||||
|
'playerStartExitVehicle',
|
||||||
|
'playerStreamIn',
|
||||||
|
'playerStreamOut',
|
||||||
|
'playerWeaponChange',
|
||||||
|
'serverShutdown',
|
||||||
|
'trailerAttached',
|
||||||
|
'vehicleDamage',
|
||||||
|
'vehicleDeath',
|
||||||
|
'vehicleHornToggle',
|
||||||
|
'vehicleSirenToggle',
|
||||||
|
]
|
||||||
+16
-1
@@ -1,6 +1,9 @@
|
|||||||
/// <reference types="@ragempcommunity/types-server" />
|
/// <reference types="@ragempcommunity/types-server" />
|
||||||
|
|
||||||
import type { RageFW_ICustomServerEvent } from 'rage-fw-shared-types'
|
import type {
|
||||||
|
RageFW_ICustomServerEvent,
|
||||||
|
RageFW_ICustomClientEvent,
|
||||||
|
} from 'rage-fw-shared-types'
|
||||||
|
|
||||||
export type RageFW_ServerEvent =
|
export type RageFW_ServerEvent =
|
||||||
| keyof RageFW_ICustomServerEvent
|
| keyof RageFW_ICustomServerEvent
|
||||||
@@ -16,3 +19,15 @@ export type RageFW_ServerEventCallback<
|
|||||||
: K extends keyof IServerEvents
|
: K extends keyof IServerEvents
|
||||||
? ThisifyServerEvents[K]
|
? ThisifyServerEvents[K]
|
||||||
: never
|
: never
|
||||||
|
|
||||||
|
export type RageFW_ClientEvent = keyof RageFW_ICustomClientEvent
|
||||||
|
|
||||||
|
export type RageFW_ClientEventArguments<K extends RageFW_ClientEvent> =
|
||||||
|
K extends RageFW_ClientEvent
|
||||||
|
? Parameters<RageFW_ICustomClientEvent[K]>
|
||||||
|
: never
|
||||||
|
|
||||||
|
export type RageFW_ClientEventReturn<K extends RageFW_ClientEvent> =
|
||||||
|
K extends RageFW_ClientEvent
|
||||||
|
? ReturnType<RageFW_ICustomClientEvent[K]>
|
||||||
|
: never
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "rage-fw-shared-types",
|
"name": "rage-fw-shared-types",
|
||||||
"version": "0.0.2-alpha.0",
|
"version": "0.0.5-alpha.0",
|
||||||
"types": "types/types/index.d.ts",
|
"types": "types/types/index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
"types/**/*"
|
"types/**/*"
|
||||||
],
|
],
|
||||||
"author": "SashaGoncharov19",
|
"author": "SashaGoncharov19",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module"
|
"type": "module",
|
||||||
|
"gitHead": "053e4fd12aa120d53e11e0d2009c0df78c1a2ad0"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "rage-fw-shared",
|
"name": "rage-fw-shared",
|
||||||
"version": "0.0.2-alpha.0",
|
"version": "0.0.5-alpha.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "index.d.ts",
|
"main": "index.d.ts",
|
||||||
"files": [
|
"files": [
|
||||||
@@ -12,5 +12,6 @@
|
|||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "SashaGoncharov19",
|
"author": "SashaGoncharov19",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"description": "Shared client types for rage-fw"
|
"description": "Shared client types for rage-fw",
|
||||||
|
"gitHead": "053e4fd12aa120d53e11e0d2009c0df78c1a2ad0"
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-5
@@ -1,16 +1,14 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ESNext",
|
"target": "ESNext",
|
||||||
|
"lib": ["ESNext","ES2019"],
|
||||||
|
"moduleResolution": "node",
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"strict": true,
|
|
||||||
"allowSyntheticDefaultImports": true,
|
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
|
"strict": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"emitDecoratorMetadata": true,
|
"emitDecoratorMetadata": true,
|
||||||
"moduleResolution": "node",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"declaration": true,
|
|
||||||
"useUnknownInCatchVariables": false,
|
"useUnknownInCatchVariables": false,
|
||||||
"exactOptionalPropertyTypes": true,
|
"exactOptionalPropertyTypes": true,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
|
|||||||
Reference in New Issue
Block a user