@@ -15,15 +15,13 @@ type PreReadyEventKeys =
1515
1616type ClientReadyFor < K extends EventKeys > = K extends PreReadyEventKeys ? boolean : true ;
1717
18- export type EventExecute < K extends EventKeys , ExtraArgs extends unknown [ ] = [ ] > = (
19- client : StelliaClient < ClientReadyFor < K > > ,
20- ...args : [ ...ExtraArgs , ...ClientEvents [ K ] ]
21- ) => Awaitable < unknown > ;
18+ export type EventExecute < K extends EventKeys , ExtraArgs extends unknown [ ] = [ ] > = ( client : StelliaClient < ClientReadyFor < K > > , ...args : [ ...ExtraArgs , ...ClientEvents [ K ] ] ) => Awaitable < unknown > ;
2219
2320export interface EventDataStructure < K extends EventKeys > {
2421 name : K ;
2522 once ?: boolean ;
2623}
24+
2725export interface EventStructureWithoutGuildConfiguration < K extends EventKeys > {
2826 data : EventDataStructure < K > ;
2927 execute : EventExecute < K > ;
@@ -39,18 +37,18 @@ export interface EventStructureWithAllGuildsConfiguration<K extends EventKeys, T
3937 execute : EventExecute < K , [ TGuildsConfig ] > ;
4038}
4139
42- export function defineEvent < K extends EventKeys > ( event : EventStructureWithoutGuildConfiguration < K > ) {
40+ export function defineEvent < K extends EventKeys > ( event : EventStructureWithoutGuildConfiguration < K > ) : EventStructureWithoutGuildConfiguration < K > {
4341 return event ;
4442}
4543
4644export function createGuildEventFactory < TConfig extends GuildConfigurationType = GuildConfigurationType > ( ) {
47- return function < K extends EventKeys > ( event : EventStructureWithGuildConfiguration < K , TConfig > ) {
45+ return function < K extends EventKeys > ( event : EventStructureWithGuildConfiguration < K , TConfig > ) : EventStructureWithGuildConfiguration < K , TConfig > {
4846 return event ;
4947 } ;
5048}
5149
5250export function createAllGuildsEventFactory < TGuildsConfig extends GuildsConfiguration = GuildsConfiguration > ( ) {
53- return function < K extends EventKeys > ( event : EventStructureWithAllGuildsConfiguration < K , TGuildsConfig > ) {
51+ return function < K extends EventKeys > ( event : EventStructureWithAllGuildsConfiguration < K , TGuildsConfig > ) : EventStructureWithAllGuildsConfiguration < K , TGuildsConfig > {
5452 return event ;
5553 } ;
5654}
0 commit comments