Rename ContactType to EmbeddedContactType

This commit is contained in:
Fedor Indutny 2021-08-19 18:56:39 -07:00 committed by GitHub
parent 017a0fa807
commit fe040a2873
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 46 additions and 42 deletions

View file

@ -4,7 +4,7 @@
import { format as formatPhoneNumber } from './PhoneNumber';
import { AttachmentType } from './Attachment';
export type ContactType = {
export type EmbeddedContactType = {
name?: Name;
number?: Array<Phone>;
email?: Array<Email>;
@ -68,15 +68,15 @@ type Avatar = {
isProfile: boolean;
};
export function contactSelector(
contact: ContactType,
export function embeddedContactSelector(
contact: EmbeddedContactType,
options: {
regionCode: string;
firstNumber?: string;
isNumberOnSignal?: boolean;
getAbsoluteAttachmentPath: (path: string) => string;
}
): ContactType {
): EmbeddedContactType {
const {
getAbsoluteAttachmentPath,
firstNumber,
@ -117,7 +117,7 @@ export function contactSelector(
};
}
export function getName(contact: ContactType): string | undefined {
export function getName(contact: EmbeddedContactType): string | undefined {
const { name, organization } = contact;
const displayName = (name && name.displayName) || undefined;
const givenName = (name && name.givenName) || undefined;

View file

@ -4,7 +4,7 @@
/* eslint-disable camelcase */
import { AttachmentType } from './Attachment';
import { ContactType } from './Contact';
import { EmbeddedContactType } from './EmbeddedContact';
import { IndexableBoolean, IndexablePresence } from './IndexedDB';
export type Message = (
@ -110,7 +110,7 @@ type MessageSchemaVersion5 = Partial<
type MessageSchemaVersion6 = Partial<
Readonly<{
contact: Array<ContactType>;
contact: Array<EmbeddedContactType>;
}>
>;