diff --git a/typings/index.ts b/typings/index.ts index 77e49f49d..16f179cf8 100644 --- a/typings/index.ts +++ b/typings/index.ts @@ -428,6 +428,7 @@ client.login('absolutely-valid-token'); // Test type transformation: declare const assertType: (value: T) => asserts value is T; declare const serialize: (value: T) => Serialized; +declare const notPropertyOf: (value: T, property: P & Exclude) => void; assertType(serialize(undefined)); assertType(serialize(null)); @@ -483,7 +484,8 @@ assertType(dmChannel.lastMessage); assertType(threadChannel.lastMessage); assertType(newsChannel.lastMessage); assertType(textChannel.lastMessage); -// @ts-expect-error -assertType(user.lastMessage); -// @ts-expect-error -assertType(guildMember.lastMessage); + +notPropertyOf(user, 'lastMessage'); +notPropertyOf(user, 'lastMessageId'); +notPropertyOf(guildMember, 'lastMessage'); +notPropertyOf(guildMember, 'lastMessageId');