diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -91,7 +91,6 @@ import type { LegacyRawThreadInfo, LegacyRoleInfo, - MemberInfo, ServerThreadInfo, ServerMemberInfo, ClientNewThreadRequest, @@ -219,17 +218,18 @@ } function threadActualMembers( - memberInfos: $ReadOnlyArray, + memberInfos: $ReadOnlyArray< + LegacyMemberInfo | MinimallyEncodedMemberInfo | RelativeMemberInfo, + >, ): $ReadOnlyArray { return memberInfos .filter(memberInfo => memberInfo.role) .map(memberInfo => memberInfo.id); } -function threadOtherMembers( - memberInfos: $ReadOnlyArray, - viewerID: ?string, -): $ReadOnlyArray { +function threadOtherMembers< + T: LegacyMemberInfo | MinimallyEncodedMemberInfo | RelativeMemberInfo, +>(memberInfos: $ReadOnlyArray, viewerID: ?string): $ReadOnlyArray { return memberInfos.filter( memberInfo => memberInfo.role && memberInfo.id !== viewerID, ); @@ -1030,7 +1030,11 @@ // Since we don't have access to all of the ancestor ThreadInfos, we approximate // "parent admin" as anybody with CHANGE_ROLE permissions. function memberHasAdminPowers( - memberInfo: RelativeMemberInfo | MemberInfo | ServerMemberInfo, + memberInfo: + | RelativeMemberInfo + | LegacyMemberInfo + | MinimallyEncodedMemberInfo + | ServerMemberInfo, ): boolean { if (memberInfo.minimallyEncoded) { return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE); diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js --- a/lib/types/thread-types.js +++ b/lib/types/thread-types.js @@ -15,7 +15,6 @@ RawMessageInfo, } from './message-types.js'; import type { - MinimallyEncodedMemberInfo, RawThreadInfo, ResolvedThreadInfo, ThreadInfo, @@ -51,8 +50,6 @@ isSender: t.Boolean, }); -export type MemberInfo = LegacyMemberInfo | MinimallyEncodedMemberInfo; - export type LegacyRoleInfo = { +id: string, +name: string,