refactor client types
This commit is contained in:
parent
77d667ce67
commit
47ce0a6b16
@ -5,22 +5,20 @@ import type {
|
|||||||
RageFW_ICustomServerEvent,
|
RageFW_ICustomServerEvent,
|
||||||
} from 'rage-fw-shared-types'
|
} from 'rage-fw-shared-types'
|
||||||
|
|
||||||
export type RageFW_ClientEvent =
|
export type RageFW_ClientEvent = keyof RageFW_ICustomServerEvent
|
||||||
| keyof RageFW_ICustomClientEvent
|
|
||||||
| keyof IClientEvents
|
|
||||||
|
|
||||||
export type RageFW_ClientEventArguments<K extends RageFW_ClientEvent> =
|
export type RageFW_ClientEventArguments<K extends RageFW_ClientEvent> =
|
||||||
K extends keyof RageFW_ICustomClientEvent
|
K extends keyof RageFW_ICustomServerEvent
|
||||||
? Parameters<RageFW_ICustomClientEvent[K]>
|
? Parameters<RageFW_ICustomServerEvent[K]>
|
||||||
: (K extends keyof IClientEvents ? IClientEvents[K] : never)[]
|
: never
|
||||||
|
|
||||||
export type RageFW_ClientEventReturn<K extends RageFW_ClientEvent> =
|
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_ClientServerEvent = keyof RageFW_ICustomClientEvent
|
||||||
|
|
||||||
export type RageFW_ClientServerCallback<K extends RageFW_ClientServerEvent> = (
|
export type RageFW_ClientServerCallback<K extends RageFW_ClientServerEvent> = (
|
||||||
args: Parameters<RageFW_ICustomServerEvent[K]>,
|
args: Parameters<RageFW_ICustomClientEvent[K]>,
|
||||||
) => ReturnType<RageFW_ICustomServerEvent[K]>
|
) => ReturnType<RageFW_ICustomClientEvent[K]>
|
||||||
|
Loading…
Reference in New Issue
Block a user