diff --git a/cef/src/types/cef.ts b/cef/src/types/cef.ts new file mode 100644 index 0000000..153fdbd --- /dev/null +++ b/cef/src/types/cef.ts @@ -0,0 +1,32 @@ +import { RageFW_ICustomCefEvent } from 'rage-fw-shared-types' +export { RageFW_ICustomCefEvent } from 'rage-fw-shared-types' + +/** + * Union of all available cef event names + * These only include custom events + */ +export type RageFW_CefEvent = keyof RageFW_ICustomCefEvent + +/** + * Array of arguments of an event you pass as a generic + * These only include custom cef events + */ +export type RageFW_CefArguments = Parameters< + RageFW_ICustomCefEvent[K] +> + +/** + * Return type of event you pass as a generic + * These only include custom cef events + */ +export type RageFW_CefReturn = ReturnType< + RageFW_ICustomCefEvent[K] +> + +/** + * Callback (function) of event you pass as a generic + * These only include custom cef events + */ +export type RageFW_CefCallback = ( + args: RageFW_CefArguments, +) => RageFW_CefReturn diff --git a/cef/src/types/client.ts b/cef/src/types/client.ts new file mode 100644 index 0000000..ad17504 --- /dev/null +++ b/cef/src/types/client.ts @@ -0,0 +1,24 @@ +import type { RageFW_ICustomClientEvent } from 'rage-fw-shared-types' +export type { RageFW_ICustomClientEvent } from 'rage-fw-shared-types' + +/** + * Union of all available client event names + * These only include custom events + */ +export type RageFW_ClientEvent = keyof RageFW_ICustomClientEvent + +/** + * Array of arguments of event you pass as a generic + * These only include custom client events + */ +export type RageFW_ClientArguments = Parameters< + RageFW_ICustomClientEvent[K] +> + +/** + * Return type of event you pass as a generic + * These only include custom client events + */ +export type RageFW_ClientReturn = ReturnType< + RageFW_ICustomClientEvent[K] +> diff --git a/cef/src/types/index.ts b/cef/src/types/index.ts index e6bee6e..ef9b6be 100644 --- a/cef/src/types/index.ts +++ b/cef/src/types/index.ts @@ -1,87 +1,3 @@ -/// - -import type { - RageFW_ICustomCefEvent, - RageFW_ICustomClientEvent, - RageFW_ICustomServerEvent, -} from 'rage-fw-shared-types' - -export type { - RageFW_ICustomCefEvent, - RageFW_ICustomServerEvent, - RageFW_ICustomClientEvent, -} from 'rage-fw-shared-types' - -/** - * Union of all available cef event names - * These only include custom events - */ -export type RageFW_CefEvent = keyof RageFW_ICustomCefEvent - -/** - * Union of all available server event names - * These only include custom events - */ -export type RageFW_ServerEvent = keyof RageFW_ICustomServerEvent - -/** - * Union of all available client event names - * These only include custom events - */ -export type RageFW_ClientEvent = keyof RageFW_ICustomClientEvent - -/** - * Array of arguments of an event you pass as a generic - * These only include custom cef events - */ -export type RageFW_CefArguments = Parameters< - RageFW_ICustomCefEvent[K] -> - -/** - * Return type of event you pass as a generic - * These only include custom cef events - */ -export type RageFW_CefReturn = ReturnType< - RageFW_ICustomCefEvent[K] -> - -/** - * Callback (function) of event you pass as a generic - * These only include custom cef events - */ -export type RageFW_CefCallback = ( - args: RageFW_CefArguments, -) => RageFW_CefReturn - -/** - * Array of arguments of event you pass as a generic - * These only include custom server events - */ -export type RageFW_ServerArguments = Parameters< - RageFW_ICustomServerEvent[K] -> - -/** - * Return type of event you pass as a generic - * These only include custom server events - */ -export type RageFW_ServerReturn = ReturnType< - RageFW_ICustomServerEvent[K] -> - -/** - * Array of arguments of event you pass as a generic - * These only include custom client events - */ -export type RageFW_ClientArguments = Parameters< - RageFW_ICustomClientEvent[K] -> - -/** - * Return type of event you pass as a generic - * These only include custom client events - */ -export type RageFW_ClientReturn = ReturnType< - RageFW_ICustomClientEvent[K] -> +export * from './cef' +export * from './client' +export * from './server' diff --git a/cef/src/types/server.ts b/cef/src/types/server.ts new file mode 100644 index 0000000..aec1962 --- /dev/null +++ b/cef/src/types/server.ts @@ -0,0 +1,24 @@ +import type { RageFW_ICustomServerEvent } from 'rage-fw-shared-types' +export type { RageFW_ICustomServerEvent } from 'rage-fw-shared-types' + +/** + * Union of all available server event names + * These only include custom events + */ +export type RageFW_ServerEvent = keyof RageFW_ICustomServerEvent + +/** + * Array of arguments of event you pass as a generic + * These only include custom server events + */ +export type RageFW_ServerArguments = Parameters< + RageFW_ICustomServerEvent[K] +> + +/** + * Return type of event you pass as a generic + * These only include custom server events + */ +export type RageFW_ServerReturn = ReturnType< + RageFW_ICustomServerEvent[K] +>