Prefer import type when importing types

This commit is contained in:
Evan Hahn 2021-10-26 14:15:33 -05:00 committed by GitHub
parent 0f635af8a9
commit 74fde10ff5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
721 changed files with 2037 additions and 1947 deletions

View file

@ -3,7 +3,8 @@
import { strictAssert } from '../util/assert';
import { UUID, UUIDStringType } from './UUID';
import type { UUIDStringType } from './UUID';
import { UUID } from './UUID';
export type AddressStringType = `${UUIDStringType}.${number}`;

View file

@ -13,7 +13,7 @@ import {
} from 'lodash';
import { blobToArrayBuffer } from 'blob-util';
import { LoggerType } from './Logging';
import type { LoggerType } from './Logging';
import * as MIME from './MIME';
import { toLogFormat } from './errors';
import { SignalService } from '../protobuf';
@ -21,7 +21,8 @@ import {
isImageTypeSupported,
isVideoTypeSupported,
} from '../util/GoogleChrome';
import { LocalizerType, ThemeType } from './Util';
import type { LocalizerType } from './Util';
import { ThemeType } from './Util';
import * as GoogleChrome from '../util/GoogleChrome';
import { scaleImageToLevel } from '../util/scaleImageToLevel';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import LRU from 'lru-cache';
import type LRU from 'lru-cache';
export type WaveformCache = LRU<
string,

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { AvatarColorType } from './Colors';
import type { AvatarColorType } from './Colors';
import { strictAssert } from '../util/assert';
export const PersonalAvatarIcons = [

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
import { computeHash } from '../Crypto';
import { ConversationAttributesType } from '../model-types.d';
import type { ConversationAttributesType } from '../model-types.d';
export type BuildAvatarUpdaterOptions = Readonly<{
deleteAttachmentData: (path: string) => Promise<void>;

View file

@ -4,16 +4,16 @@
import { omit } from 'lodash';
import { SignalService as Proto } from '../protobuf';
import { MessageAttributesType } from '../model-types.d';
import type { MessageAttributesType } from '../model-types.d';
import { isNotNil } from '../util/isNotNil';
import {
format as formatPhoneNumber,
parse as parsePhoneNumber,
} from './PhoneNumber';
import { AttachmentType, migrateDataToFileSystem } from './Attachment';
import type { AttachmentType, migrateDataToFileSystem } from './Attachment';
import { toLogFormat } from './errors';
import { LoggerType } from './Logging';
import type { LoggerType } from './Logging';
export type EmbeddedContactType = {
name?: Name;

View file

@ -1,7 +1,7 @@
// Copyright 2020 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { LocalizerType } from './Util';
import type { LocalizerType } from './Util';
export type LocaleMessagesType = {
[key: string]: {

View file

@ -8,7 +8,7 @@ import LinkifyIt from 'linkify-it';
import { maybeParseUrl } from '../util/url';
import { replaceEmojiWithSpaces } from '../util/emoji';
import { AttachmentType } from './Attachment';
import type { AttachmentType } from './Attachment';
export type LinkPreviewImage = AttachmentType & {
data: Uint8Array;

View file

@ -1,8 +1,8 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { AttachmentType } from './Attachment';
import { MIMEType } from './MIME';
import type { AttachmentType } from './Attachment';
import type { MIMEType } from './MIME';
export type MessageAttributesType = {
attachments: Array<AttachmentType>;

View file

@ -3,9 +3,9 @@
/* eslint-disable camelcase */
import { AttachmentType } from './Attachment';
import { EmbeddedContactType } from './EmbeddedContact';
import { IndexableBoolean, IndexablePresence } from './IndexedDB';
import type { AttachmentType } from './Attachment';
import type { EmbeddedContactType } from './EmbeddedContact';
import type { IndexableBoolean, IndexablePresence } from './IndexedDB';
export type Message = (
| UserMessage

View file

@ -3,8 +3,10 @@
import { strictAssert } from '../util/assert';
import { UUID, UUIDStringType } from './UUID';
import { Address, AddressStringType } from './Address';
import type { UUIDStringType } from './UUID';
import { UUID } from './UUID';
import type { AddressStringType } from './Address';
import { Address } from './Address';
const QUALIFIED_ADDRESS_REGEXP = /^([0-9a-f-]+):([0-9a-f-]+).(\d+)$/i;

View file

@ -11,7 +11,8 @@ import { makeLookup } from '../util/makeLookup';
import { maybeParseUrl } from '../util/url';
import * as Bytes from '../Bytes';
import { deriveStickerPackKey, decryptAttachment } from '../Crypto';
import { IMAGE_WEBP, MIMEType } from './MIME';
import type { MIMEType } from './MIME';
import { IMAGE_WEBP } from './MIME';
import { sniffImageMimeType } from '../util/sniffImageMimeType';
import type { AttachmentType } from './Attachment';
import type {

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { StorageAccessType } from './Storage.d';
import type { StorageAccessType } from './Storage.d';
// Configuration keys that only affect UI
export const STORAGE_UI_KEYS: ReadonlyArray<keyof StorageAccessType> = [

View file

@ -4,8 +4,9 @@
import loadImage from 'blueimp-load-image';
import { blobToArrayBuffer } from 'blob-util';
import { toLogFormat } from './errors';
import { MIMEType, IMAGE_PNG } from './MIME';
import { LoggerType } from './Logging';
import type { MIMEType } from './MIME';
import { IMAGE_PNG } from './MIME';
import type { LoggerType } from './Logging';
import { arrayBufferToObjectURL } from '../util/arrayBufferToObjectURL';
import { strictAssert } from '../util/assert';
import { canvasToBlob } from '../util/canvasToBlob';

View file

@ -1,7 +1,7 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { AttachmentType } from '../Attachment';
import type { AttachmentType } from '../Attachment';
export type LinkPreviewType = {
title: string;

View file

@ -3,7 +3,7 @@
import * as Attachment from '../Attachment';
import * as IndexedDB from '../IndexedDB';
import { Message, UserMessage } from '../Message';
import type { Message, UserMessage } from '../Message';
const hasAttachment = (
predicate: (value: Attachment.AttachmentType) => boolean