Skip to content

Commit

Permalink
Remove ts/util/index.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiebuilds-signal committed Apr 10, 2023
1 parent 5312694 commit c956c0e
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 88 deletions.
2 changes: 1 addition & 1 deletion ts/components/conversation/MessageDetail.tsx
Expand Up @@ -26,7 +26,7 @@ import * as log from '../../logging/log';
import { formatDateTimeLong } from '../../util/timestamp';
import { DurationInSeconds } from '../../util/durations';
import { format as formatRelativeTime } from '../../util/expirationTimer';
import { missingCaseError } from '../../util';
import { missingCaseError } from '../../util/missingCaseError';

export type Contact = Pick<
ConversationType,
Expand Down
45 changes: 43 additions & 2 deletions ts/signal.ts
Expand Up @@ -10,7 +10,9 @@ import Data from './sql/Client';
import * as Groups from './groups';
import * as OS from './OS';
import * as RemoteConfig from './RemoteConfig';
import * as Util from './util';
import * as GoogleChrome from './util/GoogleChrome';
import * as Registration from './util/registration';
import * as zkgroup from './util/zkgroup';

// Components
import { ConfirmationDialog } from './components/ConfirmationDialog';
Expand Down Expand Up @@ -47,6 +49,25 @@ import type { EmbeddedContactType } from './types/EmbeddedContact';
import type { ContactWithHydratedAvatar } from './textsecure/SendMessage';
import type { LinkPreviewType } from './types/message/LinkPreviews';
import type { StickerType, StickerWithHydratedData } from './types/Stickers';
import { MessageController } from './util/MessageController';
import {
flushMessageCounter,
incrementMessageCounter,
initializeMessageCounter,
} from './util/incrementMessageCounter';
import { sleep } from './util/sleep';
import {
queueUpdateMessage,
saveNewMessageBatcher,
setBatchingStrategy,
} from './util/messageBatcher';
import { sendContentMessageToGroup, sendToGroup } from './util/sendToGroup';
import { makeLookup } from './util/makeLookup';
import { getStringForProfileChange } from './util/getStringForProfileChange';
import { deleteForEveryone } from './util/deleteForEveryone';
import { RetryPlaceholders } from './util/retryPlaceholders';
import { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration';
import { createBatcher } from './util/batcher';

type MigrationsModuleType = {
attachmentsPath: string;
Expand Down Expand Up @@ -401,6 +422,26 @@ export const setup = (options: {
Services,
State,
Types,
Util,
Util: {
createBatcher,
deleteForEveryone,
flushMessageCounter,
getStringForProfileChange,
GoogleChrome,
incrementMessageCounter,
initializeMessageCounter,
makeLookup,
MessageController,
parseRemoteClientExpiration,
queueUpdateMessage,
Registration,
RetryPlaceholders,
saveNewMessageBatcher,
sendContentMessageToGroup,
sendToGroup,
setBatchingStrategy,
sleep,
zkgroup,
},
};
};
2 changes: 1 addition & 1 deletion ts/state/selectors/search.ts
Expand Up @@ -32,7 +32,7 @@ import type { HydratedBodyRangeType } from '../../types/BodyRange';
import { BodyRange } from '../../types/BodyRange';
import * as log from '../../logging/log';
import { getOwn } from '../../util/getOwn';
import { missingCaseError } from '../../util';
import { missingCaseError } from '../../util/missingCaseError';

export const getSearch = (state: StateType): SearchStateType => state.search;

Expand Down
2 changes: 1 addition & 1 deletion ts/test-electron/services/profiles_test.ts
Expand Up @@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only

import { assert } from 'chai';
import { sleep } from '../../util';
import { sleep } from '../../util/sleep';
import { MINUTE } from '../../util/durations';
import { drop } from '../../util/drop';

Expand Down
78 changes: 0 additions & 78 deletions ts/util/index.ts

This file was deleted.

52 changes: 47 additions & 5 deletions ts/window.d.ts
Expand Up @@ -8,9 +8,10 @@ import type { Store } from 'redux';
import type * as Backbone from 'backbone';
import type PQueue from 'p-queue/dist';
import type { assert } from 'chai';

import type { PhoneNumber, PhoneNumberFormat } from 'google-libphonenumber';
import type * as Util from './util';
import type * as Registration from './util/registration';
import type * as zkgroup from './util/zkgroup';

import type {
ConversationModelCollectionType,
MessageModelCollectionType,
Expand Down Expand Up @@ -40,7 +41,7 @@ import type { createApp } from './state/roots/createApp';
import type Data from './sql/Client';
import type { MessageModel } from './models/messages';
import type { ConversationModel } from './models/conversations';
import type { BatcherType } from './util/batcher';
import type { BatcherType, createBatcher } from './util/batcher';
import type { ConfirmationDialog } from './components/ConfirmationDialog';
import type { SignalProtocolStore } from './SignalProtocolStore';
import type { SocketStatus } from './types/SocketStatus';
Expand All @@ -56,6 +57,27 @@ import type { IPCEventsType } from './util/createIPCEvents';
import type { SignalContextType } from './windows/context';
import type * as Message2 from './types/Message2';
import type { initializeMigrations } from './signal';
import type {
flushMessageCounter,
incrementMessageCounter,
initializeMessageCounter,
} from './util/incrementMessageCounter';
import type { RetryPlaceholders } from './util/retryPlaceholders';
import type { sleep } from './util/sleep';
import type {
queueUpdateMessage,
saveNewMessageBatcher,
setBatchingStrategy,
} from './util/messageBatcher';
import type {
sendContentMessageToGroup,
sendToGroup,
} from './util/sendToGroup';
import type * as GoogleChrome from './util/GoogleChrome';
import type { makeLookup } from './util/makeLookup';
import type { getStringForProfileChange } from './util/getStringForProfileChange';
import type { deleteForEveryone } from './util/deleteForEveryone';
import type { parseRemoteClientExpiration } from './util/parseRemoteClientExpiration';

export { Long } from 'long';

Expand Down Expand Up @@ -122,7 +144,7 @@ export type SignalCoreType = {
initializeGroupCredentialFetcher: () => Promise<void>;
initializeNetworkObserver: (network: ReduxActions['network']) => void;
initializeUpdateListener: (updates: ReduxActions['updates']) => void;
retryPlaceholders?: Util.RetryPlaceholders;
retryPlaceholders?: RetryPlaceholders;
lightSessionResetQueue?: PQueue;
storage: typeof StorageService;
};
Expand All @@ -133,7 +155,27 @@ export type SignalCoreType = {
Address: typeof Address;
QualifiedAddress: typeof QualifiedAddress;
};
Util: typeof Util;
Util: {
createBatcher: typeof createBatcher;
deleteForEveryone: typeof deleteForEveryone;
flushMessageCounter: typeof flushMessageCounter;
getStringForProfileChange: typeof getStringForProfileChange;
GoogleChrome: typeof GoogleChrome;
incrementMessageCounter: typeof incrementMessageCounter;
initializeMessageCounter: typeof initializeMessageCounter;
makeLookup: typeof makeLookup;
MessageController: typeof MessageController;
parseRemoteClientExpiration: typeof parseRemoteClientExpiration;
queueUpdateMessage: typeof queueUpdateMessage;
Registration: typeof Registration;
RetryPlaceholders: typeof RetryPlaceholders;
saveNewMessageBatcher: typeof saveNewMessageBatcher;
sendContentMessageToGroup: typeof sendContentMessageToGroup;
sendToGroup: typeof sendToGroup;
setBatchingStrategy: typeof setBatchingStrategy;
sleep: typeof sleep;
zkgroup: typeof zkgroup;
};
Components: {
ConfirmationDialog: typeof ConfirmationDialog;
};
Expand Down

0 comments on commit c956c0e

Please sign in to comment.