2021-01-04 19:46:24 +00:00
|
|
|
// Copyright 2020-2021 Signal Messenger, LLC
|
2020-10-30 20:34:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-03-31 20:03:38 +00:00
|
|
|
// Captures the globals put in place by preload.js, background.js and others
|
|
|
|
|
2020-07-10 18:28:49 +00:00
|
|
|
import * as Backbone from 'backbone';
|
|
|
|
import * as Underscore from 'underscore';
|
2021-01-20 01:19:00 +00:00
|
|
|
import moment from 'moment';
|
|
|
|
import PQueue from 'p-queue/dist';
|
2020-06-04 18:16:19 +00:00
|
|
|
import { Ref } from 'react';
|
2020-10-30 17:52:21 +00:00
|
|
|
import { bindActionCreators } from 'redux';
|
2021-01-20 01:19:00 +00:00
|
|
|
import { imageToBlurHash } from './util/imageToBlurHash';
|
2020-10-26 21:20:08 +00:00
|
|
|
import * as LinkPreviews from '../js/modules/link_previews.d';
|
2020-10-16 18:31:57 +00:00
|
|
|
import * as Util from './util';
|
2020-07-10 18:28:49 +00:00
|
|
|
import {
|
|
|
|
ConversationModelCollectionType,
|
|
|
|
MessageModelCollectionType,
|
2020-09-24 20:57:54 +00:00
|
|
|
MessageAttributesType,
|
2021-05-13 19:10:20 +00:00
|
|
|
ReactionAttributesType,
|
|
|
|
ReactionModelType,
|
2020-07-10 18:28:49 +00:00
|
|
|
} from './model-types.d';
|
2020-07-07 00:56:56 +00:00
|
|
|
import { ContactRecordIdentityState, TextSecureType } from './textsecure.d';
|
2021-05-06 00:09:29 +00:00
|
|
|
import {
|
|
|
|
ChallengeHandler,
|
|
|
|
IPCRequest as IPCChallengeRequest,
|
|
|
|
} from './challenge';
|
2020-04-13 17:37:29 +00:00
|
|
|
import { WebAPIConnectType } from './textsecure/WebAPI';
|
2021-01-27 21:13:33 +00:00
|
|
|
import { uploadDebugLogs } from './logging/debuglogs';
|
2020-09-04 18:27:12 +00:00
|
|
|
import { CallingClass } from './services/calling';
|
2020-10-06 17:06:34 +00:00
|
|
|
import * as Groups from './groups';
|
2020-04-13 17:37:29 +00:00
|
|
|
import * as Crypto from './Crypto';
|
2021-04-16 23:13:13 +00:00
|
|
|
import * as Curve from './Curve';
|
2020-09-09 23:07:58 +00:00
|
|
|
import * as RemoteConfig from './RemoteConfig';
|
2021-01-20 01:19:00 +00:00
|
|
|
import * as OS from './OS';
|
2021-02-04 19:54:03 +00:00
|
|
|
import { getEnvironment } from './environment';
|
2020-10-06 17:06:34 +00:00
|
|
|
import * as zkgroup from './util/zkgroup';
|
2020-11-03 01:19:52 +00:00
|
|
|
import { LocalizerType, BodyRangesType, BodyRangeType } from './types/Util';
|
2021-01-20 01:19:00 +00:00
|
|
|
import * as Attachment from './types/Attachment';
|
2020-08-13 20:53:45 +00:00
|
|
|
import { ColorType } from './types/Colors';
|
2021-01-20 01:19:00 +00:00
|
|
|
import * as MIME from './types/MIME';
|
|
|
|
import * as Contact from './types/Contact';
|
|
|
|
import * as Errors from '../js/modules/types/errors';
|
2020-07-10 18:28:49 +00:00
|
|
|
import { ConversationController } from './ConversationController';
|
2020-09-09 22:50:44 +00:00
|
|
|
import { ReduxActions } from './state/types';
|
2020-10-30 17:52:21 +00:00
|
|
|
import { createStore } from './state/createStore';
|
|
|
|
import { createCallManager } from './state/roots/createCallManager';
|
|
|
|
import { createCompositionArea } from './state/roots/createCompositionArea';
|
2020-11-11 17:36:05 +00:00
|
|
|
import { createContactModal } from './state/roots/createContactModal';
|
2021-01-29 21:19:24 +00:00
|
|
|
import { createConversationDetails } from './state/roots/createConversationDetails';
|
2020-10-30 17:52:21 +00:00
|
|
|
import { createConversationHeader } from './state/roots/createConversationHeader';
|
2021-04-27 22:35:35 +00:00
|
|
|
import { createForwardMessageModal } from './state/roots/createForwardMessageModal';
|
2021-01-29 21:19:24 +00:00
|
|
|
import { createGroupLinkManagement } from './state/roots/createGroupLinkManagement';
|
2020-12-01 16:42:35 +00:00
|
|
|
import { createGroupV1MigrationModal } from './state/roots/createGroupV1MigrationModal';
|
2021-01-29 22:16:48 +00:00
|
|
|
import { createGroupV2JoinModal } from './state/roots/createGroupV2JoinModal';
|
2021-01-29 21:19:24 +00:00
|
|
|
import { createGroupV2Permissions } from './state/roots/createGroupV2Permissions';
|
2020-10-30 17:52:21 +00:00
|
|
|
import { createLeftPane } from './state/roots/createLeftPane';
|
2021-03-24 22:06:12 +00:00
|
|
|
import { createMessageDetail } from './state/roots/createMessageDetail';
|
2021-01-29 21:19:24 +00:00
|
|
|
import { createPendingInvites } from './state/roots/createPendingInvites';
|
2020-10-30 17:52:21 +00:00
|
|
|
import { createSafetyNumberViewer } from './state/roots/createSafetyNumberViewer';
|
|
|
|
import { createShortcutGuideModal } from './state/roots/createShortcutGuideModal';
|
|
|
|
import { createStickerManager } from './state/roots/createStickerManager';
|
|
|
|
import { createStickerPreviewModal } from './state/roots/createStickerPreviewModal';
|
|
|
|
import { createTimeline } from './state/roots/createTimeline';
|
|
|
|
import * as callingDuck from './state/ducks/calling';
|
|
|
|
import * as conversationsDuck from './state/ducks/conversations';
|
|
|
|
import * as emojisDuck from './state/ducks/emojis';
|
|
|
|
import * as expirationDuck from './state/ducks/expiration';
|
|
|
|
import * as itemsDuck from './state/ducks/items';
|
2021-04-27 22:35:35 +00:00
|
|
|
import * as linkPreviewsDuck from './state/ducks/linkPreviews';
|
2020-10-30 17:52:21 +00:00
|
|
|
import * as networkDuck from './state/ducks/network';
|
|
|
|
import * as updatesDuck from './state/ducks/updates';
|
|
|
|
import * as userDuck from './state/ducks/user';
|
|
|
|
import * as searchDuck from './state/ducks/search';
|
|
|
|
import * as stickersDuck from './state/ducks/stickers';
|
|
|
|
import * as conversationsSelectors from './state/selectors/conversations';
|
|
|
|
import * as searchSelectors from './state/selectors/search';
|
2020-09-09 02:25:05 +00:00
|
|
|
import AccountManager from './textsecure/AccountManager';
|
2021-04-08 16:24:21 +00:00
|
|
|
import { SendOptionsType } from './textsecure/SendMessage';
|
2020-07-07 00:56:56 +00:00
|
|
|
import Data from './sql/Client';
|
2020-09-24 20:57:54 +00:00
|
|
|
import { UserMessage } from './types/Message';
|
|
|
|
import { PhoneNumberFormat } from 'google-libphonenumber';
|
|
|
|
import { MessageModel } from './models/messages';
|
|
|
|
import { ConversationModel } from './models/conversations';
|
|
|
|
import { combineNames } from './util';
|
|
|
|
import { BatcherType } from './util/batcher';
|
2021-01-20 01:19:00 +00:00
|
|
|
import { AttachmentList } from './components/conversation/AttachmentList';
|
|
|
|
import { CaptionEditor } from './components/CaptionEditor';
|
2021-04-27 19:29:59 +00:00
|
|
|
import { ConfirmationDialog } from './components/ConfirmationDialog';
|
2021-01-20 01:19:00 +00:00
|
|
|
import { ContactDetail } from './components/conversation/ContactDetail';
|
|
|
|
import { ContactModal } from './components/conversation/ContactModal';
|
2020-10-06 17:06:34 +00:00
|
|
|
import { ErrorModal } from './components/ErrorModal';
|
2021-01-20 01:19:00 +00:00
|
|
|
import { Lightbox } from './components/Lightbox';
|
|
|
|
import { LightboxGallery } from './components/LightboxGallery';
|
|
|
|
import { MediaGallery } from './components/conversation/media-gallery/MediaGallery';
|
|
|
|
import { MessageDetail } from './components/conversation/MessageDetail';
|
2020-10-06 17:06:34 +00:00
|
|
|
import { ProgressModal } from './components/ProgressModal';
|
2021-01-20 01:19:00 +00:00
|
|
|
import { Quote } from './components/conversation/Quote';
|
|
|
|
import { StagedLinkPreview } from './components/conversation/StagedLinkPreview';
|
2021-01-29 21:19:24 +00:00
|
|
|
import { MIMEType } from './types/MIME';
|
2021-02-18 16:40:26 +00:00
|
|
|
import { ElectronLocaleType } from './util/mapToSupportLocale';
|
2021-04-16 23:13:13 +00:00
|
|
|
import { SignalProtocolStore } from './SignalProtocolStore';
|
2021-03-13 01:22:36 +00:00
|
|
|
import { StartupQueue } from './util/StartupQueue';
|
2021-03-24 00:50:02 +00:00
|
|
|
import * as synchronousCrypto from './util/synchronousCrypto';
|
2021-04-08 16:24:21 +00:00
|
|
|
import SyncRequest from './textsecure/SyncRequest';
|
2020-04-13 17:37:29 +00:00
|
|
|
|
2020-09-04 01:25:19 +00:00
|
|
|
export { Long } from 'long';
|
|
|
|
|
2020-06-26 00:08:58 +00:00
|
|
|
type TaskResultType = any;
|
|
|
|
|
2020-11-20 17:30:45 +00:00
|
|
|
export type WhatIsThis = any;
|
2020-09-24 20:57:54 +00:00
|
|
|
|
2021-01-04 18:47:14 +00:00
|
|
|
// Synced with the type in ts/shims/showConfirmationDialog
|
|
|
|
// we are duplicating it here because that file cannot import/export.
|
|
|
|
type ConfirmationDialogViewProps = {
|
|
|
|
cancelText?: string;
|
|
|
|
confirmStyle?: 'affirmative' | 'negative';
|
|
|
|
message: string;
|
|
|
|
okText: string;
|
2021-02-26 21:06:37 +00:00
|
|
|
reject?: (error: Error) => void;
|
2021-01-04 18:47:14 +00:00
|
|
|
resolve: () => void;
|
|
|
|
};
|
|
|
|
|
2020-03-31 20:03:38 +00:00
|
|
|
declare global {
|
2021-01-14 18:07:05 +00:00
|
|
|
// We want to extend `window`'s properties, so we need an interface.
|
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
2020-03-31 20:03:38 +00:00
|
|
|
interface Window {
|
2021-02-26 21:06:37 +00:00
|
|
|
startApp: () => void;
|
|
|
|
|
2020-09-24 20:57:54 +00:00
|
|
|
_: typeof Underscore;
|
|
|
|
$: typeof jQuery;
|
|
|
|
|
2021-01-20 01:19:00 +00:00
|
|
|
moment: typeof moment;
|
|
|
|
imageToBlurHash: typeof imageToBlurHash;
|
2020-09-24 20:57:54 +00:00
|
|
|
autoOrientImage: any;
|
|
|
|
dataURLToBlobSync: any;
|
|
|
|
loadImage: any;
|
2021-01-20 01:19:00 +00:00
|
|
|
isBehindProxy: () => boolean;
|
2021-05-11 20:59:21 +00:00
|
|
|
getAutoLaunch: () => boolean;
|
|
|
|
setAutoLaunch: (value: boolean) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
|
|
|
|
PQueue: typeof PQueue;
|
|
|
|
PQueueType: PQueue;
|
2021-02-26 21:06:37 +00:00
|
|
|
Mustache: {
|
|
|
|
render: (template: string, data: any, partials?: any) => string;
|
|
|
|
parse: (template: string) => void;
|
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
|
|
|
|
WhatIsThis: WhatIsThis;
|
|
|
|
|
2021-03-05 17:57:09 +00:00
|
|
|
attachmentDownloadQueue: Array<MessageModel> | undefined;
|
2021-03-13 01:22:36 +00:00
|
|
|
startupProcessingQueue: StartupQueue | undefined;
|
2020-09-24 20:57:54 +00:00
|
|
|
baseAttachmentsPath: string;
|
|
|
|
baseStickersPath: string;
|
|
|
|
baseTempPath: string;
|
2020-03-31 20:03:38 +00:00
|
|
|
dcodeIO: DCodeIOType;
|
2021-03-04 21:44:57 +00:00
|
|
|
receivedAtCounter: number;
|
2020-09-24 20:57:54 +00:00
|
|
|
enterKeyboardMode: () => void;
|
|
|
|
enterMouseMode: () => void;
|
2020-09-09 02:25:05 +00:00
|
|
|
getAccountManager: () => AccountManager | undefined;
|
2020-06-04 18:16:19 +00:00
|
|
|
getAlwaysRelayCalls: () => Promise<boolean>;
|
2021-05-03 16:38:20 +00:00
|
|
|
getBuiltInImages: () => Promise<Array<string>>;
|
2020-06-04 18:16:19 +00:00
|
|
|
getCallRingtoneNotification: () => Promise<boolean>;
|
|
|
|
getCallSystemNotification: () => Promise<boolean>;
|
2020-07-10 18:28:49 +00:00
|
|
|
getConversations: () => ConversationModelCollectionType;
|
2020-09-14 22:16:57 +00:00
|
|
|
getCountMutedConversations: () => Promise<boolean>;
|
2021-02-04 19:54:03 +00:00
|
|
|
getEnvironment: typeof getEnvironment;
|
2020-07-10 18:28:49 +00:00
|
|
|
getExpiration: () => string;
|
|
|
|
getGuid: () => string;
|
|
|
|
getInboxCollection: () => ConversationModelCollectionType;
|
|
|
|
getIncomingCallNotification: () => Promise<boolean>;
|
2020-10-30 17:52:21 +00:00
|
|
|
getInteractionMode: () => 'mouse' | 'keyboard';
|
2021-02-18 16:40:26 +00:00
|
|
|
getLocale: () => ElectronLocaleType;
|
2020-06-04 18:16:19 +00:00
|
|
|
getMediaCameraPermissions: () => Promise<boolean>;
|
2020-07-10 18:28:49 +00:00
|
|
|
getMediaPermissions: () => Promise<boolean>;
|
2021-01-27 21:13:33 +00:00
|
|
|
getNodeVersion: () => string;
|
2020-09-09 02:25:05 +00:00
|
|
|
getServerPublicParams: () => string;
|
2020-12-07 19:40:11 +00:00
|
|
|
getSfuUrl: () => string;
|
2020-07-10 18:28:49 +00:00
|
|
|
getSocketStatus: () => number;
|
2021-04-08 17:09:54 +00:00
|
|
|
getSyncRequest: (timeoutMillis?: number) => SyncRequest;
|
2020-07-10 18:28:49 +00:00
|
|
|
getTitle: () => string;
|
2020-09-09 02:25:05 +00:00
|
|
|
waitForEmptyEventQueue: () => Promise<void>;
|
2020-09-09 22:50:44 +00:00
|
|
|
getVersion: () => string;
|
2020-06-04 18:16:19 +00:00
|
|
|
showCallingPermissionsPopup: (forCamera: boolean) => Promise<void>;
|
|
|
|
i18n: LocalizerType;
|
2020-09-24 20:57:54 +00:00
|
|
|
isActive: () => boolean;
|
2021-05-03 16:38:20 +00:00
|
|
|
isAfterVersion: (version: string, anotherVersion: string) => boolean;
|
|
|
|
isBeforeVersion: (version: string, anotherVersion: string) => boolean;
|
2021-02-01 20:01:25 +00:00
|
|
|
isFullScreen: () => boolean;
|
2020-09-24 20:57:54 +00:00
|
|
|
isValidGuid: (maybeGuid: string | null) => boolean;
|
|
|
|
isValidE164: (maybeE164: unknown) => boolean;
|
2020-04-13 17:37:29 +00:00
|
|
|
libphonenumber: {
|
|
|
|
util: {
|
|
|
|
getRegionCodeForNumber: (number: string) => string;
|
2020-09-24 20:57:54 +00:00
|
|
|
parseNumber: (
|
|
|
|
e164: string,
|
|
|
|
regionCode: string
|
|
|
|
) => typeof window.Signal.Types.PhoneNumber;
|
2020-04-13 17:37:29 +00:00
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
parse: (number: string) => string;
|
|
|
|
getRegionCodeForNumber: (number: string) => string;
|
|
|
|
format: (number: string, format: PhoneNumberFormat) => string;
|
2020-04-13 17:37:29 +00:00
|
|
|
};
|
2020-03-31 20:03:38 +00:00
|
|
|
log: {
|
2021-01-27 21:13:33 +00:00
|
|
|
fatal: LoggerType;
|
2020-03-31 20:03:38 +00:00
|
|
|
info: LoggerType;
|
|
|
|
warn: LoggerType;
|
|
|
|
error: LoggerType;
|
2021-01-27 21:13:33 +00:00
|
|
|
debug: LoggerType;
|
|
|
|
trace: LoggerType;
|
|
|
|
fetch: () => Promise<string>;
|
|
|
|
publish: typeof uploadDebugLogs;
|
2020-03-31 20:03:38 +00:00
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
nodeSetImmediate: typeof setImmediate;
|
2021-01-20 01:19:00 +00:00
|
|
|
normalizeUuids: (obj: any, paths: Array<string>, context: string) => void;
|
2021-02-01 20:01:25 +00:00
|
|
|
onFullScreenChange: (fullScreen: boolean) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
owsDesktopApp: WhatIsThis;
|
2020-06-04 18:16:19 +00:00
|
|
|
platform: string;
|
2020-09-24 20:57:54 +00:00
|
|
|
preloadedImages: Array<WhatIsThis>;
|
2020-09-09 22:50:44 +00:00
|
|
|
reduxActions: ReduxActions;
|
2020-09-24 20:57:54 +00:00
|
|
|
reduxStore: WhatIsThis;
|
2020-12-17 23:12:15 +00:00
|
|
|
registerForActive: (handler: () => void) => void;
|
2020-04-01 18:59:11 +00:00
|
|
|
restart: () => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
setImmediate: typeof setImmediate;
|
2020-06-04 18:16:19 +00:00
|
|
|
showWindow: () => void;
|
2020-09-16 19:31:05 +00:00
|
|
|
showSettings: () => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
shutdown: () => void;
|
2021-05-06 00:09:29 +00:00
|
|
|
sendChallengeRequest: (request: IPCChallengeRequest) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
setAutoHideMenuBar: (value: WhatIsThis) => void;
|
2020-07-10 18:28:49 +00:00
|
|
|
setBadgeCount: (count: number) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
setMenuBarVisibility: (value: WhatIsThis) => void;
|
2021-05-06 19:06:20 +00:00
|
|
|
setSecureInput: (enabled: boolean) => void;
|
2021-01-04 18:47:14 +00:00
|
|
|
showConfirmationDialog: (options: ConfirmationDialogViewProps) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
showKeyboardShortcuts: () => void;
|
2020-03-31 20:03:38 +00:00
|
|
|
storage: {
|
2020-09-24 20:57:54 +00:00
|
|
|
addBlockedGroup: (group: string) => void;
|
2020-07-07 00:56:56 +00:00
|
|
|
addBlockedNumber: (number: string) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
addBlockedUuid: (uuid: string) => void;
|
|
|
|
fetch: () => void;
|
2020-10-02 18:30:43 +00:00
|
|
|
get: {
|
|
|
|
<T = any>(key: string): T | undefined;
|
|
|
|
<T>(key: string, defaultValue: T): T;
|
|
|
|
};
|
2020-12-01 17:04:14 +00:00
|
|
|
getBlockedGroups: () => Array<string>;
|
|
|
|
getBlockedNumbers: () => Array<string>;
|
|
|
|
getBlockedUuids: () => Array<string>;
|
2020-09-24 20:57:54 +00:00
|
|
|
getItemsState: () => WhatIsThis;
|
2020-07-07 00:56:56 +00:00
|
|
|
isBlocked: (number: string) => boolean;
|
2020-09-24 20:57:54 +00:00
|
|
|
isGroupBlocked: (group: unknown) => boolean;
|
|
|
|
isUuidBlocked: (uuid: string) => boolean;
|
2020-10-13 22:20:21 +00:00
|
|
|
onready: (callback: () => unknown) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
put: (key: string, value: any) => Promise<void>;
|
|
|
|
remove: (key: string) => Promise<void>;
|
|
|
|
removeBlockedGroup: (group: string) => void;
|
2020-07-07 00:56:56 +00:00
|
|
|
removeBlockedNumber: (number: string) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
removeBlockedUuid: (uuid: string) => void;
|
2021-02-26 23:42:45 +00:00
|
|
|
reset: () => void;
|
2020-03-31 20:03:38 +00:00
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
systemTheme: WhatIsThis;
|
2020-03-31 20:03:38 +00:00
|
|
|
textsecure: TextSecureType;
|
2021-03-24 00:50:02 +00:00
|
|
|
synchronousCrypto: typeof synchronousCrypto;
|
2021-02-01 20:01:25 +00:00
|
|
|
titleBarDoubleClick: () => void;
|
2020-12-17 23:12:15 +00:00
|
|
|
unregisterForActive: (handler: () => void) => void;
|
2020-07-10 18:28:49 +00:00
|
|
|
updateTrayIcon: (count: number) => void;
|
2021-03-04 21:44:57 +00:00
|
|
|
sqlInitializer: {
|
|
|
|
initialize: () => Promise<void>;
|
2021-03-10 22:25:57 +00:00
|
|
|
goBackToMainProcess: () => void;
|
2021-03-04 21:44:57 +00:00
|
|
|
};
|
2020-03-31 20:03:38 +00:00
|
|
|
|
2020-07-10 18:28:49 +00:00
|
|
|
Backbone: typeof Backbone;
|
2021-03-26 02:02:53 +00:00
|
|
|
CI:
|
|
|
|
| {
|
|
|
|
setProvisioningURL: (url: string) => void;
|
|
|
|
deviceName: string;
|
|
|
|
}
|
|
|
|
| undefined;
|
2021-04-27 22:11:59 +00:00
|
|
|
Accessibility: {
|
|
|
|
reducedMotionSetting: boolean;
|
|
|
|
};
|
2020-04-13 17:37:29 +00:00
|
|
|
Signal: {
|
2020-09-24 20:57:54 +00:00
|
|
|
Backbone: any;
|
|
|
|
AttachmentDownloads: {
|
|
|
|
addJob: <T = unknown>(
|
|
|
|
attachment: unknown,
|
|
|
|
options: unknown
|
|
|
|
) => Promise<T>;
|
|
|
|
start: (options: WhatIsThis) => void;
|
|
|
|
stop: () => void;
|
|
|
|
};
|
2020-04-13 17:37:29 +00:00
|
|
|
Crypto: typeof Crypto;
|
2021-04-16 23:13:13 +00:00
|
|
|
Curve: typeof Curve;
|
2020-07-07 00:56:56 +00:00
|
|
|
Data: typeof Data;
|
2020-10-06 17:06:34 +00:00
|
|
|
Groups: typeof Groups;
|
2020-09-09 23:07:58 +00:00
|
|
|
RemoteConfig: typeof RemoteConfig;
|
2020-06-04 18:16:19 +00:00
|
|
|
Services: {
|
|
|
|
calling: CallingClass;
|
2020-09-29 23:29:11 +00:00
|
|
|
enableStorageService: () => boolean;
|
2020-09-24 20:57:54 +00:00
|
|
|
eraseAllStorageServiceState: () => Promise<void>;
|
|
|
|
initializeGroupCredentialFetcher: () => void;
|
|
|
|
initializeNetworkObserver: (network: WhatIsThis) => void;
|
|
|
|
initializeUpdateListener: (
|
|
|
|
updates: WhatIsThis,
|
|
|
|
events: WhatIsThis
|
|
|
|
) => void;
|
2020-10-01 00:43:24 +00:00
|
|
|
onTimeout: (timestamp: number, cb: () => void, id?: string) => string;
|
|
|
|
removeTimeout: (uuid: string) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
runStorageServiceSyncJob: () => Promise<void>;
|
|
|
|
storageServiceUploadJob: () => void;
|
2020-06-04 18:16:19 +00:00
|
|
|
};
|
2020-09-09 02:25:05 +00:00
|
|
|
Migrations: {
|
2020-09-24 20:57:54 +00:00
|
|
|
readTempData: any;
|
2020-09-09 02:25:05 +00:00
|
|
|
deleteAttachmentData: (path: string) => Promise<void>;
|
2020-09-24 20:57:54 +00:00
|
|
|
doesAttachmentExist: () => unknown;
|
2020-09-09 02:25:05 +00:00
|
|
|
writeNewAttachmentData: (data: ArrayBuffer) => Promise<string>;
|
2020-09-24 20:57:54 +00:00
|
|
|
deleteExternalMessageFiles: (attributes: unknown) => Promise<void>;
|
|
|
|
getAbsoluteAttachmentPath: (path: string) => string;
|
|
|
|
loadAttachmentData: (attachment: WhatIsThis) => WhatIsThis;
|
|
|
|
loadQuoteData: (quote: unknown) => WhatIsThis;
|
|
|
|
loadPreviewData: (preview: unknown) => WhatIsThis;
|
|
|
|
loadStickerData: (sticker: unknown) => WhatIsThis;
|
|
|
|
readStickerData: (path: string) => Promise<ArrayBuffer>;
|
|
|
|
upgradeMessageSchema: (attributes: unknown) => WhatIsThis;
|
|
|
|
|
|
|
|
copyIntoTempDirectory: any;
|
|
|
|
deleteDraftFile: any;
|
|
|
|
deleteTempFile: any;
|
|
|
|
getAbsoluteDraftPath: any;
|
|
|
|
getAbsoluteTempPath: any;
|
|
|
|
openFileInFolder: any;
|
|
|
|
readAttachmentData: any;
|
|
|
|
readDraftData: any;
|
|
|
|
saveAttachmentToDisk: any;
|
|
|
|
writeNewDraftData: any;
|
|
|
|
};
|
|
|
|
Stickers: {
|
|
|
|
getDataFromLink: any;
|
|
|
|
copyStickerToAttachments: (
|
|
|
|
packId: string,
|
|
|
|
stickerId: number
|
|
|
|
) => Promise<typeof window.Signal.Types.Sticker>;
|
|
|
|
deletePackReference: (id: string, packId: string) => Promise<void>;
|
2021-05-03 16:38:20 +00:00
|
|
|
downloadEphemeralPack: (packId: string, key: string) => Promise<void>;
|
2020-09-24 20:57:54 +00:00
|
|
|
downloadQueuedPacks: () => void;
|
|
|
|
downloadStickerPack: (
|
|
|
|
id: string,
|
|
|
|
key: string,
|
|
|
|
options: WhatIsThis
|
|
|
|
) => void;
|
|
|
|
getInitialState: () => WhatIsThis;
|
|
|
|
load: () => void;
|
|
|
|
removeEphemeralPack: (packId: string) => Promise<void>;
|
|
|
|
savePackMetadata: (
|
|
|
|
packId: string,
|
|
|
|
packKey: string,
|
|
|
|
metadata: unknown
|
|
|
|
) => void;
|
|
|
|
getStickerPackStatus: (packId: string) => 'downloaded' | 'installed';
|
|
|
|
getSticker: (
|
|
|
|
packId: string,
|
|
|
|
stickerId: number
|
|
|
|
) => typeof window.Signal.Types.Sticker;
|
|
|
|
getStickerPack: (packId: string) => WhatIsThis;
|
|
|
|
getInstalledStickerPacks: () => WhatIsThis;
|
2020-09-09 02:25:05 +00:00
|
|
|
};
|
|
|
|
Types: {
|
2020-09-24 20:57:54 +00:00
|
|
|
Attachment: {
|
|
|
|
save: any;
|
|
|
|
path: string;
|
|
|
|
pending: boolean;
|
|
|
|
flags: number;
|
|
|
|
size: number;
|
|
|
|
screenshot: {
|
|
|
|
path: string;
|
|
|
|
};
|
|
|
|
thumbnail: {
|
|
|
|
path: string;
|
|
|
|
objectUrl: string;
|
|
|
|
};
|
2021-01-29 21:19:24 +00:00
|
|
|
contentType: MIMEType;
|
2020-09-24 20:57:54 +00:00
|
|
|
error: unknown;
|
2021-01-29 21:19:24 +00:00
|
|
|
caption: string;
|
2020-09-24 20:57:54 +00:00
|
|
|
|
|
|
|
migrateDataToFileSystem: (
|
|
|
|
attachment: WhatIsThis,
|
|
|
|
options: unknown
|
|
|
|
) => WhatIsThis;
|
|
|
|
|
|
|
|
isVoiceMessage: (attachments: unknown) => boolean;
|
2021-01-20 01:19:00 +00:00
|
|
|
isImage: typeof Attachment.isImage;
|
2021-04-27 22:11:59 +00:00
|
|
|
isGIF: typeof Attachment.isGIF;
|
2021-01-20 01:19:00 +00:00
|
|
|
isVideo: typeof Attachment.isVideo;
|
|
|
|
isAudio: typeof Attachment.isAudio;
|
2021-02-09 20:11:07 +00:00
|
|
|
|
|
|
|
getUploadSizeLimitKb: typeof Attachment.getUploadSizeLimitKb;
|
2020-09-24 20:57:54 +00:00
|
|
|
};
|
2021-01-20 01:19:00 +00:00
|
|
|
MIME: typeof MIME;
|
|
|
|
Contact: typeof Contact;
|
2020-09-24 20:57:54 +00:00
|
|
|
Conversation: {
|
|
|
|
computeHash: (data: string) => Promise<string>;
|
|
|
|
deleteExternalFiles: (
|
|
|
|
attributes: unknown,
|
|
|
|
options: unknown
|
|
|
|
) => Promise<void>;
|
|
|
|
maybeUpdateProfileAvatar: (
|
|
|
|
attributes: unknown,
|
|
|
|
decrypted: unknown,
|
|
|
|
options: unknown
|
|
|
|
) => Promise<Record<string, unknown>>;
|
|
|
|
maybeUpdateAvatar: (
|
|
|
|
attributes: unknown,
|
|
|
|
data: unknown,
|
|
|
|
options: unknown
|
|
|
|
) => Promise<WhatIsThis>;
|
|
|
|
};
|
|
|
|
PhoneNumber: {
|
|
|
|
format: (
|
|
|
|
identifier: string,
|
|
|
|
options: Record<string, unknown>
|
|
|
|
) => string;
|
|
|
|
isValidNumber(
|
|
|
|
phoneNumber: string,
|
|
|
|
options?: {
|
|
|
|
regionCode?: string;
|
|
|
|
}
|
|
|
|
): boolean;
|
|
|
|
e164: string;
|
|
|
|
error: string;
|
|
|
|
};
|
2021-01-20 01:19:00 +00:00
|
|
|
Errors: typeof Errors;
|
2020-09-09 02:25:05 +00:00
|
|
|
Message: {
|
|
|
|
CURRENT_SCHEMA_VERSION: number;
|
2020-09-24 20:57:54 +00:00
|
|
|
VERSION_NEEDED_FOR_DISPLAY: number;
|
|
|
|
GROUP: 'group';
|
|
|
|
PRIVATE: 'private';
|
|
|
|
|
|
|
|
initializeSchemaVersion: (version: {
|
|
|
|
message: unknown;
|
|
|
|
logger: unknown;
|
|
|
|
}) => unknown & {
|
|
|
|
schemaVersion: number;
|
|
|
|
};
|
|
|
|
hasExpiration: (json: string) => boolean;
|
|
|
|
};
|
|
|
|
Sticker: {
|
|
|
|
emoji: string;
|
|
|
|
packId: string;
|
|
|
|
packKey: string;
|
|
|
|
stickerId: number;
|
|
|
|
data: {
|
|
|
|
pending: boolean;
|
|
|
|
path: string;
|
|
|
|
};
|
|
|
|
width: number;
|
|
|
|
height: number;
|
|
|
|
path: string;
|
2020-09-09 02:25:05 +00:00
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
VisualAttachment: any;
|
|
|
|
};
|
2020-10-16 18:31:57 +00:00
|
|
|
Util: typeof Util;
|
2020-10-26 21:20:08 +00:00
|
|
|
LinkPreviews: typeof LinkPreviews;
|
2020-09-24 20:57:54 +00:00
|
|
|
GroupChange: {
|
|
|
|
renderChange: (change: unknown, things: unknown) => Array<string>;
|
|
|
|
};
|
|
|
|
Components: {
|
2021-01-20 01:19:00 +00:00
|
|
|
AttachmentList: typeof AttachmentList;
|
|
|
|
CaptionEditor: typeof CaptionEditor;
|
2021-04-27 19:29:59 +00:00
|
|
|
ConfirmationDialog: typeof ConfirmationDialog;
|
2021-01-20 01:19:00 +00:00
|
|
|
ContactDetail: typeof ContactDetail;
|
2020-11-11 17:36:05 +00:00
|
|
|
ContactModal: typeof ContactModal;
|
2021-01-20 01:19:00 +00:00
|
|
|
ErrorModal: typeof ErrorModal;
|
|
|
|
Lightbox: typeof Lightbox;
|
|
|
|
LightboxGallery: typeof LightboxGallery;
|
|
|
|
MediaGallery: typeof MediaGallery;
|
|
|
|
MessageDetail: typeof MessageDetail;
|
2020-10-06 17:06:34 +00:00
|
|
|
ProgressModal: typeof ProgressModal;
|
2021-01-20 01:19:00 +00:00
|
|
|
Quote: typeof Quote;
|
|
|
|
StagedLinkPreview: typeof StagedLinkPreview;
|
2020-09-24 20:57:54 +00:00
|
|
|
};
|
2021-01-20 01:19:00 +00:00
|
|
|
OS: typeof OS;
|
2020-09-24 20:57:54 +00:00
|
|
|
Workflow: {
|
|
|
|
IdleDetector: WhatIsThis;
|
|
|
|
MessageDataMigrator: WhatIsThis;
|
|
|
|
};
|
|
|
|
IndexedDB: {
|
|
|
|
removeDatabase: WhatIsThis;
|
|
|
|
doesDatabaseExist: WhatIsThis;
|
|
|
|
};
|
|
|
|
Views: WhatIsThis;
|
2020-10-30 17:52:21 +00:00
|
|
|
State: {
|
|
|
|
bindActionCreators: typeof bindActionCreators;
|
|
|
|
createStore: typeof createStore;
|
|
|
|
Roots: {
|
|
|
|
createCallManager: typeof createCallManager;
|
|
|
|
createCompositionArea: typeof createCompositionArea;
|
2020-11-11 17:36:05 +00:00
|
|
|
createContactModal: typeof createContactModal;
|
2021-01-29 21:19:24 +00:00
|
|
|
createConversationDetails: typeof createConversationDetails;
|
2020-10-30 17:52:21 +00:00
|
|
|
createConversationHeader: typeof createConversationHeader;
|
2021-04-27 22:35:35 +00:00
|
|
|
createForwardMessageModal: typeof createForwardMessageModal;
|
2021-01-29 21:19:24 +00:00
|
|
|
createGroupLinkManagement: typeof createGroupLinkManagement;
|
2020-12-01 16:42:35 +00:00
|
|
|
createGroupV1MigrationModal: typeof createGroupV1MigrationModal;
|
2021-01-29 22:16:48 +00:00
|
|
|
createGroupV2JoinModal: typeof createGroupV2JoinModal;
|
2021-01-29 21:19:24 +00:00
|
|
|
createGroupV2Permissions: typeof createGroupV2Permissions;
|
2020-10-30 17:52:21 +00:00
|
|
|
createLeftPane: typeof createLeftPane;
|
2021-03-24 22:06:12 +00:00
|
|
|
createMessageDetail: typeof createMessageDetail;
|
2021-01-29 21:19:24 +00:00
|
|
|
createPendingInvites: typeof createPendingInvites;
|
2020-10-30 17:52:21 +00:00
|
|
|
createSafetyNumberViewer: typeof createSafetyNumberViewer;
|
|
|
|
createShortcutGuideModal: typeof createShortcutGuideModal;
|
|
|
|
createStickerManager: typeof createStickerManager;
|
|
|
|
createStickerPreviewModal: typeof createStickerPreviewModal;
|
|
|
|
createTimeline: typeof createTimeline;
|
|
|
|
};
|
|
|
|
Ducks: {
|
|
|
|
calling: typeof callingDuck;
|
|
|
|
conversations: typeof conversationsDuck;
|
|
|
|
emojis: typeof emojisDuck;
|
|
|
|
expiration: typeof expirationDuck;
|
|
|
|
items: typeof itemsDuck;
|
2021-04-27 22:35:35 +00:00
|
|
|
linkPreviews: typeof linkPreviewsDuck;
|
2020-10-30 17:52:21 +00:00
|
|
|
network: typeof networkDuck;
|
|
|
|
updates: typeof updatesDuck;
|
|
|
|
user: typeof userDuck;
|
|
|
|
search: typeof searchDuck;
|
|
|
|
stickers: typeof stickersDuck;
|
|
|
|
};
|
|
|
|
Selectors: {
|
|
|
|
conversations: typeof conversationsSelectors;
|
|
|
|
search: typeof searchSelectors;
|
|
|
|
};
|
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
Logs: WhatIsThis;
|
|
|
|
conversationControllerStart: WhatIsThis;
|
|
|
|
Emojis: {
|
|
|
|
getInitialState: () => WhatIsThis;
|
|
|
|
load: () => void;
|
|
|
|
};
|
2021-05-06 00:09:29 +00:00
|
|
|
challengeHandler: ChallengeHandler;
|
2020-04-13 17:37:29 +00:00
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
|
2020-07-10 18:28:49 +00:00
|
|
|
ConversationController: ConversationController;
|
2020-09-24 20:57:54 +00:00
|
|
|
Events: WhatIsThis;
|
2020-09-09 02:25:05 +00:00
|
|
|
MessageController: MessageControllerType;
|
2021-02-26 23:42:45 +00:00
|
|
|
SignalProtocolStore: typeof SignalProtocolStore;
|
2020-04-13 17:37:29 +00:00
|
|
|
WebAPI: WebAPIConnectType;
|
2020-03-31 20:03:38 +00:00
|
|
|
Whisper: WhisperType;
|
2020-06-04 18:16:19 +00:00
|
|
|
|
2020-09-24 20:57:54 +00:00
|
|
|
AccountCache: Record<string, boolean>;
|
|
|
|
AccountJobs: Record<string, Promise<void>>;
|
|
|
|
|
|
|
|
doesAccountCheckJobExist: (number: string) => boolean;
|
|
|
|
checkForSignalAccount: (number: string) => Promise<void>;
|
|
|
|
isSignalAccountCheckComplete: (number: string) => boolean;
|
|
|
|
hasSignalAccount: (number: string) => boolean;
|
|
|
|
getServerTrustRoot: () => WhatIsThis;
|
|
|
|
readyForUpdates: () => void;
|
2021-04-13 23:43:56 +00:00
|
|
|
logAppLoadedEvent: (options: { processedCount?: number }) => void;
|
|
|
|
logMessageReceiverConnect: () => void;
|
2020-11-13 19:57:55 +00:00
|
|
|
|
2021-01-29 22:16:48 +00:00
|
|
|
// Runtime Flags
|
|
|
|
isShowingModal?: boolean;
|
|
|
|
|
|
|
|
// Feature Flags
|
2020-12-07 20:35:14 +00:00
|
|
|
isGroupCallingEnabled: () => boolean;
|
2020-12-18 19:27:43 +00:00
|
|
|
GV2_ENABLE_SINGLE_CHANGE_PROCESSING: boolean;
|
|
|
|
GV2_ENABLE_CHANGE_PROCESSING: boolean;
|
|
|
|
GV2_ENABLE_STATE_PROCESSING: boolean;
|
2021-01-12 15:44:44 +00:00
|
|
|
GV2_MIGRATION_DISABLE_ADD: boolean;
|
|
|
|
GV2_MIGRATION_DISABLE_INVITE: boolean;
|
2020-03-31 20:03:38 +00:00
|
|
|
}
|
2020-05-27 21:37:06 +00:00
|
|
|
|
2021-01-14 18:07:05 +00:00
|
|
|
// We want to extend `Error`, so we need an interface.
|
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
2020-05-27 21:37:06 +00:00
|
|
|
interface Error {
|
2021-04-14 01:27:43 +00:00
|
|
|
originalError?: Event;
|
2020-05-27 21:37:06 +00:00
|
|
|
}
|
2020-03-31 20:03:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export type DCodeIOType = {
|
2020-09-04 01:25:19 +00:00
|
|
|
ByteBuffer: typeof ByteBufferClass & {
|
|
|
|
BIG_ENDIAN: number;
|
|
|
|
LITTLE_ENDIAN: number;
|
|
|
|
Long: DCodeIOType['Long'];
|
|
|
|
};
|
|
|
|
Long: Long & {
|
2021-04-09 16:19:38 +00:00
|
|
|
MAX_VALUE: Long;
|
2021-04-08 19:27:20 +00:00
|
|
|
equals: (other: Long | number | string) => boolean;
|
2020-04-13 17:37:29 +00:00
|
|
|
fromBits: (low: number, high: number, unsigned: boolean) => number;
|
2021-04-08 19:27:20 +00:00
|
|
|
fromNumber: (value: number, unsigned?: boolean) => Long;
|
2020-09-24 20:57:54 +00:00
|
|
|
fromString: (str: string | null) => Long;
|
2021-04-08 19:27:20 +00:00
|
|
|
isLong: (obj: unknown) => obj is Long;
|
2020-03-31 20:03:38 +00:00
|
|
|
};
|
2021-04-08 16:24:21 +00:00
|
|
|
ProtoBuf: WhatIsThis;
|
2020-03-31 20:03:38 +00:00
|
|
|
};
|
|
|
|
|
2020-09-09 02:25:05 +00:00
|
|
|
type MessageControllerType = {
|
2021-03-04 21:44:57 +00:00
|
|
|
findBySender: (sender: string) => MessageModel | null;
|
|
|
|
findBySentAt: (sentAt: number) => MessageModel | null;
|
2021-05-07 01:15:25 +00:00
|
|
|
getById: (id: string) => MessageModel | undefined;
|
2020-09-24 20:57:54 +00:00
|
|
|
register: (id: string, model: MessageModel) => MessageModel;
|
|
|
|
unregister: (id: string) => void;
|
2020-09-09 02:25:05 +00:00
|
|
|
};
|
|
|
|
|
2020-04-13 17:37:29 +00:00
|
|
|
export class CertificateValidatorType {
|
|
|
|
validate: (cerficate: any, certificateTime: number) => Promise<void>;
|
|
|
|
}
|
2020-03-31 20:03:38 +00:00
|
|
|
|
2020-04-13 17:37:29 +00:00
|
|
|
export class ByteBufferClass {
|
2020-09-04 01:25:19 +00:00
|
|
|
constructor(value?: any, littleEndian?: number);
|
|
|
|
static wrap: (
|
|
|
|
value: any,
|
|
|
|
encoding?: string,
|
|
|
|
littleEndian?: number
|
|
|
|
) => ByteBufferClass;
|
|
|
|
buffer: ArrayBuffer;
|
2020-04-13 17:37:29 +00:00
|
|
|
toString: (type: string) => string;
|
|
|
|
toArrayBuffer: () => ArrayBuffer;
|
2020-07-07 00:56:56 +00:00
|
|
|
toBinary: () => string;
|
2020-04-13 17:37:29 +00:00
|
|
|
slice: (start: number, end?: number) => ByteBufferClass;
|
|
|
|
append: (data: ArrayBuffer) => void;
|
|
|
|
limit: number;
|
|
|
|
offset: 0;
|
2020-09-04 01:25:19 +00:00
|
|
|
readInt: (offset: number) => number;
|
|
|
|
readLong: (offset: number) => Long;
|
|
|
|
readShort: (offset: number) => number;
|
2020-04-13 17:37:29 +00:00
|
|
|
readVarint32: () => number;
|
2021-04-26 23:52:20 +00:00
|
|
|
reset: () => void;
|
2020-09-04 01:25:19 +00:00
|
|
|
writeLong: (l: Long) => void;
|
2020-04-13 17:37:29 +00:00
|
|
|
skip: (length: number) => void;
|
|
|
|
}
|
|
|
|
|
2020-06-04 18:16:19 +00:00
|
|
|
export class GumVideoCapturer {
|
|
|
|
constructor(
|
|
|
|
maxWidth: number,
|
|
|
|
maxHeight: number,
|
|
|
|
maxFramerate: number,
|
|
|
|
localPreview: Ref<HTMLVideoElement>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export class CanvasVideoRenderer {
|
|
|
|
constructor(canvas: Ref<HTMLCanvasElement>);
|
|
|
|
}
|
|
|
|
|
2021-01-27 21:13:33 +00:00
|
|
|
export type LoggerType = (...args: Array<unknown>) => void;
|
2020-03-31 20:03:38 +00:00
|
|
|
|
|
|
|
export type WhisperType = {
|
|
|
|
events: {
|
2020-09-14 22:16:57 +00:00
|
|
|
on: (name: string, callback: (param1: any, param2?: any) => void) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
trigger: (name: string, param1?: any, param2?: any) => void;
|
2020-03-31 20:03:38 +00:00
|
|
|
};
|
2020-04-01 18:59:11 +00:00
|
|
|
Database: {
|
|
|
|
open: () => Promise<IDBDatabase>;
|
|
|
|
handleDOMException: (
|
|
|
|
context: string,
|
|
|
|
error: DOMException | null,
|
|
|
|
reject: Function
|
|
|
|
) => void;
|
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
GroupConversationCollection: typeof ConversationModelCollectionType;
|
2020-07-10 18:28:49 +00:00
|
|
|
ConversationCollection: typeof ConversationModelCollectionType;
|
2020-09-24 20:57:54 +00:00
|
|
|
ConversationCollectionType: ConversationModelCollectionType;
|
|
|
|
Conversation: typeof ConversationModel;
|
|
|
|
ConversationType: ConversationModel;
|
2020-07-10 18:28:49 +00:00
|
|
|
MessageCollection: typeof MessageModelCollectionType;
|
2020-09-24 20:57:54 +00:00
|
|
|
MessageCollectionType: MessageModelCollectionType;
|
|
|
|
MessageAttributesType: MessageAttributesType;
|
|
|
|
Message: typeof MessageModel;
|
|
|
|
MessageType: MessageModel;
|
|
|
|
GroupMemberConversation: WhatIsThis;
|
|
|
|
KeyChangeListener: WhatIsThis;
|
|
|
|
ClearDataView: WhatIsThis;
|
|
|
|
ReactWrapperView: WhatIsThis;
|
|
|
|
activeConfirmationView: WhatIsThis;
|
2021-02-26 21:06:37 +00:00
|
|
|
ToastView: typeof window.Whisper.View & {
|
2021-01-29 22:16:48 +00:00
|
|
|
show: (view: typeof Backbone.View, el: Element) => void;
|
2020-10-02 18:30:43 +00:00
|
|
|
};
|
2020-09-24 20:57:54 +00:00
|
|
|
ConversationArchivedToast: WhatIsThis;
|
|
|
|
ConversationUnarchivedToast: WhatIsThis;
|
2020-10-28 22:54:32 +00:00
|
|
|
ConversationMarkedUnreadToast: WhatIsThis;
|
2020-09-24 20:57:54 +00:00
|
|
|
AppView: WhatIsThis;
|
|
|
|
WallClockListener: WhatIsThis;
|
|
|
|
MessageRequests: WhatIsThis;
|
|
|
|
BannerView: any;
|
|
|
|
RecorderView: any;
|
|
|
|
GroupMemberList: any;
|
2021-01-29 21:19:24 +00:00
|
|
|
GroupLinkCopiedToast: typeof Backbone.View;
|
2020-09-24 20:57:54 +00:00
|
|
|
KeyVerificationPanelView: any;
|
|
|
|
SafetyNumberChangeDialogView: any;
|
2020-11-03 01:19:52 +00:00
|
|
|
BodyRangesType: BodyRangesType;
|
|
|
|
BodyRangeType: BodyRangeType;
|
2020-09-24 20:57:54 +00:00
|
|
|
|
|
|
|
Notifications: {
|
2021-04-09 15:52:31 +00:00
|
|
|
isEnabled: boolean;
|
2020-09-24 20:57:54 +00:00
|
|
|
removeBy: (filter: Partial<unknown>) => void;
|
|
|
|
add: (notification: unknown) => void;
|
|
|
|
clear: () => void;
|
|
|
|
disable: () => void;
|
|
|
|
enable: () => void;
|
|
|
|
fastClear: () => void;
|
|
|
|
on: (
|
|
|
|
event: string,
|
|
|
|
callback: (id: string, messageId: string) => void
|
|
|
|
) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
DeliveryReceipts: {
|
2021-04-02 20:28:07 +00:00
|
|
|
add: (receipt: WhatIsThis) => void;
|
2020-09-24 20:57:54 +00:00
|
|
|
forMessage: (conversation: unknown, message: unknown) => Array<WhatIsThis>;
|
|
|
|
onReceipt: (receipt: WhatIsThis) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
ReadReceipts: {
|
|
|
|
add: (receipt: WhatIsThis) => WhatIsThis;
|
|
|
|
forMessage: (conversation: unknown, message: unknown) => Array<WhatIsThis>;
|
|
|
|
onReceipt: (receipt: WhatIsThis) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
ReadSyncs: {
|
|
|
|
add: (sync: WhatIsThis) => WhatIsThis;
|
|
|
|
forMessage: (message: unknown) => WhatIsThis;
|
|
|
|
onReceipt: (receipt: WhatIsThis) => WhatIsThis;
|
|
|
|
};
|
|
|
|
|
|
|
|
ViewSyncs: {
|
|
|
|
add: (sync: WhatIsThis) => WhatIsThis;
|
|
|
|
forMessage: (message: unknown) => Array<WhatIsThis>;
|
|
|
|
onSync: (sync: WhatIsThis) => WhatIsThis;
|
|
|
|
};
|
|
|
|
|
|
|
|
Reactions: {
|
2021-05-13 19:10:20 +00:00
|
|
|
forMessage: (message: unknown) => Array<ReactionModelType>;
|
|
|
|
add: (reaction: ReactionAttributesType) => ReactionModelType;
|
|
|
|
onReaction: (reactionModel: ReactionModelType) => ReactionAttributesType;
|
2020-09-24 20:57:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Deletes: {
|
|
|
|
add: (model: WhatIsThis) => WhatIsThis;
|
|
|
|
forMessage: (message: unknown) => Array<WhatIsThis>;
|
|
|
|
onDelete: (model: WhatIsThis) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
IdenticonSVGView: WhatIsThis;
|
|
|
|
|
|
|
|
ExpiringMessagesListener: WhatIsThis;
|
|
|
|
TapToViewMessagesListener: WhatIsThis;
|
|
|
|
|
|
|
|
deliveryReceiptQueue: PQueue<WhatIsThis>;
|
|
|
|
deliveryReceiptBatcher: BatcherType<WhatIsThis>;
|
|
|
|
RotateSignedPreKeyListener: WhatIsThis;
|
|
|
|
|
2021-02-26 21:06:37 +00:00
|
|
|
AlreadyGroupMemberToast: typeof window.Whisper.ToastView;
|
|
|
|
AlreadyRequestedToJoinToast: typeof window.Whisper.ToastView;
|
|
|
|
BlockedGroupToast: typeof window.Whisper.ToastView;
|
|
|
|
BlockedToast: typeof window.Whisper.ToastView;
|
|
|
|
CannotMixImageAndNonImageAttachmentsToast: typeof window.Whisper.ToastView;
|
2021-05-06 00:09:29 +00:00
|
|
|
CaptchaSolvedToast: typeof window.Whisper.ToastView;
|
|
|
|
CaptchaFailedToast: typeof window.Whisper.ToastView;
|
2021-02-26 21:06:37 +00:00
|
|
|
DangerousFileTypeToast: typeof window.Whisper.ToastView;
|
|
|
|
ExpiredToast: typeof window.Whisper.ToastView;
|
|
|
|
FileSavedToast: typeof window.Whisper.ToastView;
|
2020-11-16 21:34:41 +00:00
|
|
|
FileSizeToast: any;
|
2021-02-26 21:06:37 +00:00
|
|
|
FoundButNotLoadedToast: typeof window.Whisper.ToastView;
|
|
|
|
InvalidConversationToast: typeof window.Whisper.ToastView;
|
|
|
|
LeftGroupToast: typeof window.Whisper.ToastView;
|
|
|
|
MaxAttachmentsToast: typeof window.Whisper.ToastView;
|
|
|
|
MessageBodyTooLongToast: typeof window.Whisper.ToastView;
|
|
|
|
OneNonImageAtATimeToast: typeof window.Whisper.ToastView;
|
|
|
|
OriginalNoLongerAvailableToast: typeof window.Whisper.ToastView;
|
|
|
|
OriginalNotFoundToast: typeof window.Whisper.ToastView;
|
|
|
|
PinnedConversationsFullToast: typeof window.Whisper.ToastView;
|
|
|
|
ReactionFailedToast: typeof window.Whisper.ToastView;
|
2021-05-06 00:09:29 +00:00
|
|
|
DeleteForEveryoneFailedToast: typeof window.Whisper.ToastView;
|
2021-02-26 21:06:37 +00:00
|
|
|
TapToViewExpiredIncomingToast: typeof window.Whisper.ToastView;
|
|
|
|
TapToViewExpiredOutgoingToast: typeof window.Whisper.ToastView;
|
|
|
|
TimerConflictToast: typeof window.Whisper.ToastView;
|
|
|
|
UnableToLoadToast: typeof window.Whisper.ToastView;
|
|
|
|
VoiceNoteLimit: typeof window.Whisper.ToastView;
|
|
|
|
VoiceNoteMustBeOnlyAttachmentToast: typeof window.Whisper.ToastView;
|
|
|
|
|
|
|
|
ConversationLoadingScreen: typeof window.Whisper.View;
|
|
|
|
ConversationView: typeof window.Whisper.View;
|
|
|
|
View: typeof Backbone.View & {
|
|
|
|
Templates: Record<string, string>;
|
|
|
|
};
|
2020-03-31 20:03:38 +00:00
|
|
|
};
|