@@ -4720,17 +4720,19 @@ export interface Caches {
47204720 AutoModerationRuleManager : [ manager : typeof AutoModerationRuleManager , holds : typeof AutoModerationRule ] ;
47214721 ApplicationCommandManager : [ manager : typeof ApplicationCommandManager , holds : typeof ApplicationCommand ] ;
47224722 BaseGuildEmojiManager : [ manager : typeof BaseGuildEmojiManager , holds : typeof GuildEmoji ] ;
4723+ DMMessageManager : [ manager : typeof MessageManager , holds : typeof Message < false > ] ;
47234724 GuildEmojiManager : [ manager : typeof GuildEmojiManager , holds : typeof GuildEmoji ] ;
47244725 // TODO: ChannelManager: [manager: typeof ChannelManager, holds: typeof Channel];
47254726 // TODO: GuildChannelManager: [manager: typeof GuildChannelManager, holds: typeof GuildChannel];
47264727 // TODO: GuildManager: [manager: typeof GuildManager, holds: typeof Guild];
47274728 GuildMemberManager : [ manager : typeof GuildMemberManager , holds : typeof GuildMember ] ;
47284729 GuildBanManager : [ manager : typeof GuildBanManager , holds : typeof GuildBan ] ;
4729- GuildForumThreadManager : [ manager : typeof GuildForumThreadManager , holds : typeof ThreadChannel ] ;
4730+ GuildForumThreadManager : [ manager : typeof GuildForumThreadManager , holds : typeof ThreadChannel < true > ] ;
47304731 GuildInviteManager : [ manager : typeof GuildInviteManager , holds : typeof Invite ] ;
4732+ GuildMessageManager : [ manager : typeof GuildMessageManager , holds : typeof Message < true > ] ;
47314733 GuildScheduledEventManager : [ manager : typeof GuildScheduledEventManager , holds : typeof GuildScheduledEvent ] ;
47324734 GuildStickerManager : [ manager : typeof GuildStickerManager , holds : typeof Sticker ] ;
4733- GuildTextThreadManager : [ manager : typeof GuildTextThreadManager , holds : typeof ThreadChannel ] ;
4735+ GuildTextThreadManager : [ manager : typeof GuildTextThreadManager , holds : typeof ThreadChannel < false > ] ;
47344736 MessageManager : [ manager : typeof MessageManager , holds : typeof Message ] ;
47354737 // TODO: PermissionOverwriteManager: [manager: typeof PermissionOverwriteManager, holds: typeof PermissionOverwrites];
47364738 PresenceManager : [ manager : typeof PresenceManager , holds : typeof Presence ] ;
@@ -4748,11 +4750,18 @@ export type CacheConstructors = {
47484750 [ K in keyof Caches ] : Caches [ K ] [ 0 ] & { name : K } ;
47494751} ;
47504752
4753+ type OverriddenCaches =
4754+ | 'DMMessageManager'
4755+ | 'GuildForumThreadManager'
4756+ | 'GuildMessageManager'
4757+ | 'GuildTextThreadManager' ;
4758+
47514759// This doesn't actually work the way it looks 😢.
47524760// Narrowing the type of `manager.name` doesn't propagate type information to `holds` and the return type.
47534761export type CacheFactory = (
4754- manager : CacheConstructors [ keyof Caches ] ,
4762+ managerType : CacheConstructors [ Exclude < keyof Caches , OverriddenCaches > ] ,
47554763 holds : Caches [ ( typeof manager ) [ 'name' ] ] [ 1 ] ,
4764+ manager : CacheConstructors [ keyof Caches ] ,
47564765) => ( typeof manager ) [ 'prototype' ] extends DataManager < infer K , infer V , any > ? Collection < K , V > : never ;
47574766
47584767export type CacheWithLimitsOptions = {
0 commit comments