diff --git a/ts/components/conversation/media-gallery/groupMessagesByDate.ts b/ts/components/conversation/media-gallery/groupMessagesByDate.ts index fac79dcb3d..8f280d22f3 100644 --- a/ts/components/conversation/media-gallery/groupMessagesByDate.ts +++ b/ts/components/conversation/media-gallery/groupMessagesByDate.ts @@ -76,7 +76,7 @@ const toSection = ( case 'thisMonth': return { type: firstMessageWithSection.type, - messages: messages, + messages, }; case 'yearMonth': return { @@ -94,11 +94,11 @@ const toSection = ( } }; -type GenericMessageWithSection = { +interface GenericMessageWithSection { order: number; type: T; message: Message; -}; +} type MessageWithStaticSection = GenericMessageWithSection; type MessageWithYearMonthSection = GenericMessageWithSection< YearMonthSectionType diff --git a/ts/test/html/index_test.ts b/ts/test/html/index_test.ts index f2c4602a5c..87ffc84a94 100644 --- a/ts/test/html/index_test.ts +++ b/ts/test/html/index_test.ts @@ -57,7 +57,7 @@ describe('HTML', () => { }, ]; - TESTS.forEach((test) => { + TESTS.forEach(test => { (test.skipped ? it.skip : it)(`should handle ${test.name}`, () => { const preText = test.preText || 'Hello '; const postText = test.postText || ' World!'; diff --git a/ts/types/Message.ts b/ts/types/Message.ts index bb01ef089b..0be2060251 100644 --- a/ts/types/Message.ts +++ b/ts/types/Message.ts @@ -66,16 +66,20 @@ type SharedMessageProperties = Readonly<{ timestamp: number; }>; -type ExpirationTimerUpdate = Readonly<{ - expirationTimerUpdate?: Readonly<{ - expireTimer: number; - fromSync: boolean; - source: string; // PhoneNumber - }>; -}>; +type ExpirationTimerUpdate = Partial< + Readonly<{ + expirationTimerUpdate: Readonly<{ + expireTimer: number; + fromSync: boolean; + source: string; // PhoneNumber + }>; + }> +>; -type Message4 = Partial>; +type Message4 = Partial< + Readonly<{ + hasAttachments: IndexableBoolean; + hasVisualMediaAttachments: IndexableBoolean; + hasFileAttachments: IndexableBoolean; + }> +>; diff --git a/ts/types/backbone/Collection.ts b/ts/types/backbone/Collection.ts index e3ffe8139a..c67b2051f6 100644 --- a/ts/types/backbone/Collection.ts +++ b/ts/types/backbone/Collection.ts @@ -6,6 +6,6 @@ import { Model } from './Model'; export interface Collection { models: Array>; // tslint:disable-next-line no-misused-new - new(): Collection; + new (): Collection; fetch(options: object): JQuery.Deferred; } diff --git a/ts/types/message/initializeAttachmentMetadata.ts b/ts/types/message/initializeAttachmentMetadata.ts index 697390f3b3..251529695c 100644 --- a/ts/types/message/initializeAttachmentMetadata.ts +++ b/ts/types/message/initializeAttachmentMetadata.ts @@ -8,18 +8,20 @@ import * as IndexedDB from '../IndexedDB'; import { Message } from '../Message'; export const initializeAttachmentMetadata = async ( - message: Message, + message: Message ): Promise => { if (message.type === 'verified-change') { return message; } - const hasAttachments = IndexedDB.toIndexableBoolean(message.attachments.length > 0); + const hasAttachments = IndexedDB.toIndexableBoolean( + message.attachments.length > 0 + ); const [hasVisualMediaAttachments, hasFileAttachments] = partition( message.attachments, - Attachment.isVisualMedia, + Attachment.isVisualMedia ) - .map((attachments) => attachments.length > 0) + .map(attachments => attachments.length > 0) .map(IndexedDB.toIndexableBoolean); return {