Remove ts/util/index.ts

This commit is contained in:
Jamie Kyle 2023-04-10 14:30:33 -07:00 committed by GitHub
parent 531269430f
commit c956c0e025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 93 additions and 88 deletions

View file

@ -26,7 +26,7 @@ import * as log from '../../logging/log';
import { formatDateTimeLong } from '../../util/timestamp'; import { formatDateTimeLong } from '../../util/timestamp';
import { DurationInSeconds } from '../../util/durations'; import { DurationInSeconds } from '../../util/durations';
import { format as formatRelativeTime } from '../../util/expirationTimer'; import { format as formatRelativeTime } from '../../util/expirationTimer';
import { missingCaseError } from '../../util'; import { missingCaseError } from '../../util/missingCaseError';
export type Contact = Pick< export type Contact = Pick<
ConversationType, ConversationType,

View file

@ -10,7 +10,9 @@ import Data from './sql/Client';
import * as Groups from './groups'; import * as Groups from './groups';
import * as OS from './OS'; import * as OS from './OS';
import * as RemoteConfig from './RemoteConfig'; 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 // Components
import { ConfirmationDialog } from './components/ConfirmationDialog'; import { ConfirmationDialog } from './components/ConfirmationDialog';
@ -47,6 +49,25 @@ import type { EmbeddedContactType } from './types/EmbeddedContact';
import type { ContactWithHydratedAvatar } from './textsecure/SendMessage'; import type { ContactWithHydratedAvatar } from './textsecure/SendMessage';
import type { LinkPreviewType } from './types/message/LinkPreviews'; import type { LinkPreviewType } from './types/message/LinkPreviews';
import type { StickerType, StickerWithHydratedData } from './types/Stickers'; 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 = { type MigrationsModuleType = {
attachmentsPath: string; attachmentsPath: string;
@ -401,6 +422,26 @@ export const setup = (options: {
Services, Services,
State, State,
Types, Types,
Util, Util: {
createBatcher,
deleteForEveryone,
flushMessageCounter,
getStringForProfileChange,
GoogleChrome,
incrementMessageCounter,
initializeMessageCounter,
makeLookup,
MessageController,
parseRemoteClientExpiration,
queueUpdateMessage,
Registration,
RetryPlaceholders,
saveNewMessageBatcher,
sendContentMessageToGroup,
sendToGroup,
setBatchingStrategy,
sleep,
zkgroup,
},
}; };
}; };

View file

@ -32,7 +32,7 @@ import type { HydratedBodyRangeType } from '../../types/BodyRange';
import { BodyRange } from '../../types/BodyRange'; import { BodyRange } from '../../types/BodyRange';
import * as log from '../../logging/log'; import * as log from '../../logging/log';
import { getOwn } from '../../util/getOwn'; import { getOwn } from '../../util/getOwn';
import { missingCaseError } from '../../util'; import { missingCaseError } from '../../util/missingCaseError';
export const getSearch = (state: StateType): SearchStateType => state.search; export const getSearch = (state: StateType): SearchStateType => state.search;

View file

@ -2,7 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only // SPDX-License-Identifier: AGPL-3.0-only
import { assert } from 'chai'; import { assert } from 'chai';
import { sleep } from '../../util'; import { sleep } from '../../util/sleep';
import { MINUTE } from '../../util/durations'; import { MINUTE } from '../../util/durations';
import { drop } from '../../util/drop'; import { drop } from '../../util/drop';

View file

@ -1,78 +0,0 @@
// Copyright 2018 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import * as GoogleChrome from './GoogleChrome';
import * as Registration from './registration';
import { arrayBufferToObjectURL } from './arrayBufferToObjectURL';
import { combineNames } from './combineNames';
import { createBatcher } from './batcher';
import { createWaitBatcher } from './waitBatcher';
import { deleteForEveryone } from './deleteForEveryone';
import { downloadAttachment } from './downloadAttachment';
import { getStringForProfileChange } from './getStringForProfileChange';
import { getUuidsForE164s } from './getUuidsForE164s';
import { getUserAgent } from './getUserAgent';
import {
initializeMessageCounter,
incrementMessageCounter,
flushMessageCounter,
} from './incrementMessageCounter';
import { isFileDangerous } from './isFileDangerous';
import { makeLookup } from './makeLookup';
import {
queueUpdateMessage,
saveNewMessageBatcher,
setBatchingStrategy,
} from './messageBatcher';
import { missingCaseError } from './missingCaseError';
import { parseRemoteClientExpiration } from './parseRemoteClientExpiration';
import { sleep } from './sleep';
import { longRunningTaskWrapper } from './longRunningTaskWrapper';
import { toWebSafeBase64, fromWebSafeBase64 } from './webSafeBase64';
import { mapToSupportLocale } from './mapToSupportLocale';
import {
sessionRecordToProtobuf,
sessionStructureToBytes,
} from './sessionTranslation';
import * as zkgroup from './zkgroup';
import { sendToGroup, sendContentMessageToGroup } from './sendToGroup';
import { RetryPlaceholders } from './retryPlaceholders';
import * as expirationTimer from './expirationTimer';
import { MessageController } from './MessageController';
export {
GoogleChrome,
Registration,
arrayBufferToObjectURL,
combineNames,
createBatcher,
createWaitBatcher,
deleteForEveryone,
downloadAttachment,
flushMessageCounter,
fromWebSafeBase64,
getStringForProfileChange,
getUserAgent,
incrementMessageCounter,
initializeMessageCounter,
isFileDangerous,
longRunningTaskWrapper,
makeLookup,
mapToSupportLocale,
MessageController,
missingCaseError,
parseRemoteClientExpiration,
queueUpdateMessage,
RetryPlaceholders,
saveNewMessageBatcher,
sendContentMessageToGroup,
sendToGroup,
setBatchingStrategy,
sessionRecordToProtobuf,
sessionStructureToBytes,
sleep,
toWebSafeBase64,
zkgroup,
expirationTimer,
getUuidsForE164s,
};

52
ts/window.d.ts vendored
View file

@ -8,9 +8,10 @@ import type { Store } from 'redux';
import type * as Backbone from 'backbone'; import type * as Backbone from 'backbone';
import type PQueue from 'p-queue/dist'; import type PQueue from 'p-queue/dist';
import type { assert } from 'chai'; import type { assert } from 'chai';
import type { PhoneNumber, PhoneNumberFormat } from 'google-libphonenumber'; 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 { import type {
ConversationModelCollectionType, ConversationModelCollectionType,
MessageModelCollectionType, MessageModelCollectionType,
@ -40,7 +41,7 @@ import type { createApp } from './state/roots/createApp';
import type Data from './sql/Client'; import type Data from './sql/Client';
import type { MessageModel } from './models/messages'; import type { MessageModel } from './models/messages';
import type { ConversationModel } from './models/conversations'; 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 { ConfirmationDialog } from './components/ConfirmationDialog';
import type { SignalProtocolStore } from './SignalProtocolStore'; import type { SignalProtocolStore } from './SignalProtocolStore';
import type { SocketStatus } from './types/SocketStatus'; import type { SocketStatus } from './types/SocketStatus';
@ -56,6 +57,27 @@ import type { IPCEventsType } from './util/createIPCEvents';
import type { SignalContextType } from './windows/context'; import type { SignalContextType } from './windows/context';
import type * as Message2 from './types/Message2'; import type * as Message2 from './types/Message2';
import type { initializeMigrations } from './signal'; 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'; export { Long } from 'long';
@ -122,7 +144,7 @@ export type SignalCoreType = {
initializeGroupCredentialFetcher: () => Promise<void>; initializeGroupCredentialFetcher: () => Promise<void>;
initializeNetworkObserver: (network: ReduxActions['network']) => void; initializeNetworkObserver: (network: ReduxActions['network']) => void;
initializeUpdateListener: (updates: ReduxActions['updates']) => void; initializeUpdateListener: (updates: ReduxActions['updates']) => void;
retryPlaceholders?: Util.RetryPlaceholders; retryPlaceholders?: RetryPlaceholders;
lightSessionResetQueue?: PQueue; lightSessionResetQueue?: PQueue;
storage: typeof StorageService; storage: typeof StorageService;
}; };
@ -133,7 +155,27 @@ export type SignalCoreType = {
Address: typeof Address; Address: typeof Address;
QualifiedAddress: typeof QualifiedAddress; 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: { Components: {
ConfirmationDialog: typeof ConfirmationDialog; ConfirmationDialog: typeof ConfirmationDialog;
}; };