diff --git a/lib/types/avatar-types.js b/lib/types/avatar-types.js --- a/lib/types/avatar-types.js +++ b/lib/types/avatar-types.js @@ -24,6 +24,11 @@ +uploadID: string, }; +export type EncryptedImageAvatarDBContent = { + +type: 'encrypted_image', + +uploadID: string, +}; + export type ENSAvatarDBContent = { +type: 'ens', }; @@ -33,6 +38,7 @@ export type AvatarDBContent = | EmojiAvatarDBContent | ImageAvatarDBContent + | EncryptedImageAvatarDBContent | ENSAvatarDBContent; export type UpdateUserAvatarRemoveRequest = { +type: 'remove' }; @@ -53,12 +59,20 @@ uri: t.String, }); +export type ClientEncryptedImageAvatar = { + +type: 'encrypted_image', + +blobURI: string, + +encryptionKey: string, + +thumbHash: ?string, +}; + export type ClientENSAvatar = ENSAvatarDBContent; const clientENSAvatarValidator = ensAvatarDBContentValidator; export type ClientAvatar = | ClientEmojiAvatar | ClientImageAvatar + | ClientEncryptedImageAvatar | ClientENSAvatar; export const clientAvatarValidator: TUnion = t.union([ clientEmojiAvatarValidator, @@ -66,7 +80,10 @@ clientENSAvatarValidator, ]); -export type ResolvedClientAvatar = ClientEmojiAvatar | ClientImageAvatar; +export type ResolvedClientAvatar = + | ClientEmojiAvatar + | ClientImageAvatar + | ClientEncryptedImageAvatar; export type UpdateUserAvatarResponse = { +updates: CreateUpdatesResult,