@@ -366,7 +366,7 @@ export class ClientUser extends User {
366
366
export class Options extends null {
367
367
private constructor ( ) ;
368
368
public static createDefaultOptions ( ) : ClientOptions ;
369
- public static cacheWithLimits ( limits ?: Record < string , number > ) : CacheFactory ;
369
+ public static cacheWithLimits ( limits ?: CacheWithLimitOptions ) : CacheFactory ;
370
370
public static cacheEverything ( ) : CacheFactory ;
371
371
}
372
372
@@ -2739,7 +2739,36 @@ export type BitFieldResolvable<T extends string, N extends number | bigint> =
2739
2739
2740
2740
export type BufferResolvable = Buffer | string ;
2741
2741
2742
- export type CacheFactory = < T > ( manager : { name : string } , holds : { name : string } ) => Collection < Snowflake , T > ;
2742
+ export type CachedManagerTypes = keyof CacheFactoryArgs ;
2743
+
2744
+ export type CacheFactory = < T extends CachedManagerTypes > (
2745
+ ...args : CacheFactoryArgs [ T ]
2746
+ ) => Collection < Snowflake , CacheFactoryArgs [ T ] [ 1 ] > ;
2747
+
2748
+ export interface CacheFactoryArgs {
2749
+ ApplicationCommandManager : [ manager : typeof ApplicationCommandManager , holds : typeof ApplicationCommand ] ;
2750
+ BaseGuildEmojiManager : [ manager : typeof BaseGuildEmojiManager , holds : typeof GuildEmoji ] ;
2751
+ ChannelManager : [ manager : typeof ChannelManager , holds : typeof Channel ] ;
2752
+ GuildChannelManager : [ manager : typeof GuildChannelManager , holds : typeof GuildChannel ] ;
2753
+ GuildManager : [ manager : typeof GuildManager , holds : typeof Guild ] ;
2754
+ GuildMemberManager : [ manager : typeof GuildMemberManager , holds : typeof GuildMember ] ;
2755
+ GuildBanManager : [ manager : typeof GuildBanManager , holds : typeof GuildBan ] ;
2756
+ MessageManager : [ manager : typeof MessageManager , holds : typeof Message ] ;
2757
+ PermissionOverwriteManager : [ manager : typeof PermissionOverwriteManager , holds : typeof PermissionOverwrites ] ;
2758
+ PresenceManager : [ manager : typeof PresenceManager , holds : typeof Presence ] ;
2759
+ ReactionManager : [ manager : typeof ReactionManager , holds : typeof MessageReaction ] ;
2760
+ ReactionUserManager : [ manager : typeof ReactionUserManager , holds : typeof User ] ;
2761
+ RoleManager : [ manager : typeof RoleManager , holds : typeof Role ] ;
2762
+ StageInstanceManager : [ manager : typeof StageInstanceManager , holds : typeof StageInstance ] ;
2763
+ ThreadManager : [ manager : typeof ThreadManager , holds : typeof ThreadChannel ] ;
2764
+ ThreadMemberManager : [ manager : typeof ThreadMemberManager , holds : typeof ThreadMember ] ;
2765
+ UserManager : [ manager : typeof UserManager , holds : typeof User ] ;
2766
+ VoiceStateManager : [ manager : typeof VoiceStateManager , holds : typeof VoiceState ] ;
2767
+ }
2768
+
2769
+ export type CacheWithLimitOptions = {
2770
+ [ K in CachedManagerTypes ] ?: number ;
2771
+ } ;
2743
2772
2744
2773
export interface ChannelCreationOverwrites {
2745
2774
allow ?: PermissionResolvable ;
0 commit comments