import type { Connection } from '@wireapp/api-client/src/connection/' ; import type { ClientActionType } from '../' ; import type { AssetContent , ClearedContent , ClientActionContent , ConfirmationContent , ConversationContent , DeletedContent , EditedTextContent , FileAssetAbortContent , FileAssetContent , FileAssetMetaDataContent , HiddenContent , ImageAssetContent , ImageContent , LocationContent , ReactionContent , TextContent , } from '../content/' ; export function isAbortedAssetContent ( content ) { return ! ! ( content as AssetContent ) . abortReason ; } export function isAssetContent ( content ) { return ! ! ( ( content as AssetContent ) . uploaded || ( content as AssetContent ) . preview ) ; } export function isClearedContent ( content ) { return ! ! ( content as ClearedContent ) . clearedTimestamp ; } export function isClientActionContent ( content ) { return ! ! ( content as ClientActionContent ) . clientAction ; } export function isClientActionType ( content ) { return typeof content === 'number' ; } export function isConfirmationContent ( content ) { return ! ! ( content as ConfirmationContent ) . firstMessageId ; } export function isConnection ( content ) { return ! ! ( content as Connection ) . from && ! ! ( content as Connection ) . to ; } export function isDeletedContent ( content ) { return ! ! ( content as DeletedContent ) . messageId && ! ( content as any ) . text ; } export function isEditedTextContent ( content ) { return ! ! ( content as EditedTextContent ) . text && ! ! ( content as EditedTextContent ) . originalMessageId ; } export function isFileAssetAbortContent ( content ) { return ! ! ( content as FileAssetAbortContent ) . reason ; } export function isFileAssetContent ( content ) { return ! ! ( content as FileAssetContent ) . asset && ! ! ( content as FileAssetContent ) . file ; } export function isFileAssetMetaDataContent ( content ) { return ! ! ( content as FileAssetMetaDataContent ) . metaData ; } export function isHiddenContent ( content ) { return ! ! ( content as HiddenContent ) . conversationId ; } export function isImageAssetContent ( content ) { return ! ! ( content as ImageAssetContent ) . asset && ! ! ( content as ImageAssetContent ) . image ; } export function isImageContent ( content ) { return ! ! ( content as ImageContent ) . data && ! ! ( content as ImageContent ) . type ; } export function isLocationContent ( content ) { return ! ! ( content as LocationContent ) . latitude && ! ! ( content as LocationContent ) . longitude ; } export function isReactionContent ( content ) { return ! ! ( content as ReactionContent ) . type && ! ! ( content as ReactionContent ) . originalMessageId ; } export function isTextContent ( content ) { return ! ! ( content as TextContent ) . text ; }