🎨 Autoformat code

This commit is contained in:
Daniel Gasienica
2018-04-13 16:25:52 -04:00
parent 2fae89f0e8
commit 424965f876
15 changed files with 158 additions and 140 deletions

View File

@@ -1,52 +1,63 @@
/**
* @prettier
*/
import { Attachment } from './Attachment';
export type Message = IncomingMessage | OutgoingMessage | VerifiedChangeMessage;
export type Message
= IncomingMessage
| OutgoingMessage
| VerifiedChangeMessage;
export type IncomingMessage = Readonly<
{
type: 'incoming';
// Required
attachments: Array<Attachment>;
id: string;
received_at: number;
export type IncomingMessage = Readonly<{
type: 'incoming';
// Required
attachments: Array<Attachment>;
id: string;
received_at: number;
// Optional
body?: string;
decrypted_at?: number;
errors?: Array<any>;
flags?: number;
source?: string;
sourceDevice?: number;
} & SharedMessageProperties &
Message4 &
ExpirationTimerUpdate
>;
// Optional
body?: string;
decrypted_at?: number;
errors?: Array<any>;
flags?: number;
source?: string;
sourceDevice?: number;
} & SharedMessageProperties & Message4 & ExpirationTimerUpdate>;
export type OutgoingMessage = Readonly<
{
type: 'outgoing';
export type OutgoingMessage = Readonly<{
type: 'outgoing';
// Required
attachments: Array<Attachment>;
delivered: number;
delivered_to: Array<string>;
destination: string; // PhoneNumber
expirationStartTimestamp: number;
id: string;
received_at: number;
sent: boolean;
sent_to: Array<string>; // Array<PhoneNumber>
// Required
attachments: Array<Attachment>;
delivered: number;
delivered_to: Array<string>;
destination: string; // PhoneNumber
expirationStartTimestamp: number;
id: string;
received_at: number;
sent: boolean;
sent_to: Array<string>; // Array<PhoneNumber>
// Optional
body?: string;
expires_at?: number;
expireTimer?: number;
recipients?: Array<string>; // Array<PhoneNumber>
synced: boolean;
} & SharedMessageProperties &
Message4 &
ExpirationTimerUpdate
>;
// Optional
body?: string;
expires_at?: number;
expireTimer?: number;
recipients?: Array<string>; // Array<PhoneNumber>
synced: boolean;
} & SharedMessageProperties & Message4 & ExpirationTimerUpdate>;
export type VerifiedChangeMessage = Readonly<{
type: 'verified-change';
} & SharedMessageProperties & Message4 & ExpirationTimerUpdate>;
export type VerifiedChangeMessage = Readonly<
{
type: 'verified-change';
} & SharedMessageProperties &
Message4 &
ExpirationTimerUpdate
>;
type SharedMessageProperties = Readonly<{
conversationId: string;
@@ -59,7 +70,7 @@ type ExpirationTimerUpdate = Readonly<{
expireTimer: number;
fromSync: boolean;
source: string; // PhoneNumber
}>,
}>;
}>;
type Message4 = Readonly<{