signal-desktop/ts/window.d.ts

688 lines
26 KiB
TypeScript
Raw Normal View History

// Copyright 2020-2021 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
// Captures the globals put in place by preload.js, background.js and others
import { DeepPartial, Store } from 'redux';
import * as Backbone from 'backbone';
import * as Underscore from 'underscore';
import moment from 'moment';
2021-08-26 20:51:55 +00:00
import sharp from 'sharp';
import PQueue from 'p-queue/dist';
2021-08-18 20:08:14 +00:00
import { Attributes, ComponentClass, FunctionComponent, Ref } from 'react';
import { imageToBlurHash } from './util/imageToBlurHash';
import * as Util from './util';
import {
ConversationModelCollectionType,
MessageModelCollectionType,
MessageAttributesType,
2021-05-13 19:10:20 +00:00
ReactionAttributesType,
} from './model-types.d';
2021-07-14 23:39:52 +00:00
import { TextSecureType } from './textsecure.d';
import { Storage } from './textsecure/Storage';
import {
ChallengeHandler,
IPCRequest as IPCChallengeRequest,
} from './challenge';
import { WebAPIConnectType } from './textsecure/WebAPI';
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';
import * as Crypto from './Crypto';
import * as Curve from './Curve';
import * as RemoteConfig from './RemoteConfig';
import * as OS from './OS';
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';
import * as Attachment from './types/Attachment';
import * as MIME from './types/MIME';
import * as EmbeddedContact from './types/EmbeddedContact';
2021-07-14 23:39:52 +00:00
import * as Errors from './types/errors';
import { ConversationController } from './ConversationController';
import { ReduxActions } from './state/types';
2020-10-30 17:52:21 +00:00
import { createStore } from './state/createStore';
2021-06-14 19:01:00 +00:00
import { createApp } from './state/roots/createApp';
2021-05-28 16:15:17 +00:00
import { createChatColorPicker } from './state/roots/createChatColorPicker';
2020-10-30 17:52:21 +00:00
import { createCompositionArea } from './state/roots/createCompositionArea';
import { createContactModal } from './state/roots/createContactModal';
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';
import { createGroupLinkManagement } from './state/roots/createGroupLinkManagement';
import { createGroupV1MigrationModal } from './state/roots/createGroupV1MigrationModal';
import { createGroupV2JoinModal } from './state/roots/createGroupV2JoinModal';
import { createGroupV2Permissions } from './state/roots/createGroupV2Permissions';
2020-10-30 17:52:21 +00:00
import { createLeftPane } from './state/roots/createLeftPane';
import { createMessageDetail } from './state/roots/createMessageDetail';
2021-08-05 12:35:33 +00:00
import { createConversationNotificationsSettings } from './state/roots/createConversationNotificationsSettings';
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';
2021-06-14 19:01:00 +00:00
import * as appDuck from './state/ducks/app';
2020-10-30 17:52:21 +00:00
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';
import Data from './sql/Client';
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';
import { AttachmentList } from './components/conversation/AttachmentList';
import {
CallingScreenSharingController,
PropsType as CallingScreenSharingControllerProps,
} from './components/CallingScreenSharingController';
import { CaptionEditor } from './components/CaptionEditor';
2021-05-28 16:15:17 +00:00
import { ChatColorPicker } from './components/ChatColorPicker';
import { ConfirmationDialog } from './components/ConfirmationDialog';
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';
import { Lightbox } from './components/Lightbox';
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';
import { Quote } from './components/conversation/Quote';
import { StagedLinkPreview } from './components/conversation/StagedLinkPreview';
import { DisappearingTimeDialog } from './components/DisappearingTimeDialog';
import { WhatsNew } from './components/WhatsNew';
import { MIMEType } from './types/MIME';
2021-07-14 23:39:52 +00:00
import { DownloadedAttachmentType } from './types/Attachment';
2021-02-18 16:40:26 +00:00
import { ElectronLocaleType } from './util/mapToSupportLocale';
import { SignalProtocolStore } from './SignalProtocolStore';
2021-06-22 14:46:42 +00:00
import { Context as SignalContext } from './context';
2021-03-13 01:22:36 +00:00
import { StartupQueue } from './util/StartupQueue';
import * as synchronousCrypto from './util/synchronousCrypto';
2021-06-09 22:28:54 +00:00
import { SocketStatus } from './types/SocketStatus';
2021-04-08 16:24:21 +00:00
import SyncRequest from './textsecure/SyncRequest';
import { ConversationColorType, CustomColorType } from './types/Colors';
import { MessageController } from './util/MessageController';
2021-06-22 14:46:42 +00:00
import { isValidGuid } from './util/isValidGuid';
import { StateType } from './state/reducer';
import { SystemTraySetting } from './types/SystemTraySetting';
2021-08-11 19:29:07 +00:00
import { CI } from './CI';
2021-08-18 20:08:14 +00:00
import { IPCEventsType } from './util/createIPCEvents';
2020-09-04 01:25:19 +00:00
export { Long } from 'long';
type TaskResultType = any;
2020-11-20 17:30:45 +00:00
export type WhatIsThis = any;
// 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;
reject?: (error: Error) => void;
resolve: () => void;
};
2021-08-06 00:17:05 +00:00
// This is the subset of `window.FontFace` that we need. We should delete this after
// upgrading to TypeScript 4.4, which will include a full declaration in [its official
// DOM type definitions][0].
//
// [0]: https://github.com/microsoft/TypeScript/blob/03dff41c9f2038f66fb358e5c23ebd7271145978/lib/lib.dom.d.ts#L5343-L5364
declare class FontFace {
constructor(
family: string,
source: string | ArrayBuffer | ArrayBufferView,
descriptors?: unknown
);
load(): Promise<FontFace>;
}
declare global {
// We want to extend `window`'s properties, so we need an interface.
// eslint-disable-next-line no-restricted-syntax
interface Window {
startApp: () => void;
2021-08-06 00:17:05 +00:00
FontFace: typeof FontFace;
_: typeof Underscore;
$: typeof jQuery;
2021-08-26 20:51:55 +00:00
sharp: typeof sharp;
moment: typeof moment;
imageToBlurHash: typeof imageToBlurHash;
loadImage: any;
isBehindProxy: () => boolean;
getAutoLaunch: () => boolean;
setAutoLaunch: (value: boolean) => void;
PQueue: typeof PQueue;
PQueueType: PQueue;
Mustache: {
render: (template: string, data: any, partials?: any) => string;
parse: (template: string) => void;
};
WhatIsThis: WhatIsThis;
2021-08-18 20:08:14 +00:00
SignalModule: {
registerReactRenderer: (
f: <P extends {}>(
component: FunctionComponent<P> | ComponentClass<P>,
props?: (Attributes & P) | null
) => void
) => void;
};
registerScreenShareControllerRenderer: (
f: (
component: typeof CallingScreenSharingController,
props: CallingScreenSharingControllerProps
) => void
) => void;
2021-06-14 19:01:00 +00:00
addSetupMenuItems: () => void;
attachmentDownloadQueue: Array<MessageModel> | undefined;
2021-03-13 01:22:36 +00:00
startupProcessingQueue: StartupQueue | undefined;
baseAttachmentsPath: string;
baseStickersPath: string;
baseTempPath: string;
enterKeyboardMode: () => void;
enterMouseMode: () => void;
getAccountManager: () => AccountManager;
2021-05-03 16:38:20 +00:00
getBuiltInImages: () => Promise<Array<string>>;
getConversations: () => ConversationModelCollectionType;
getEnvironment: typeof getEnvironment;
getExpiration: () => string;
getGuid: () => string;
getInboxCollection: () => ConversationModelCollectionType;
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>;
getMediaPermissions: () => Promise<boolean>;
getNodeVersion: () => string;
2020-09-09 02:25:05 +00:00
getServerPublicParams: () => string;
getSfuUrl: () => string;
2021-06-09 22:28:54 +00:00
getSocketStatus: () => SocketStatus;
getSyncRequest: (timeoutMillis?: number) => SyncRequest;
getTitle: () => string;
2020-09-09 02:25:05 +00:00
waitForEmptyEventQueue: () => Promise<void>;
getVersion: () => string;
2020-06-04 18:16:19 +00:00
showCallingPermissionsPopup: (forCamera: boolean) => Promise<void>;
i18n: LocalizerType;
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;
2021-06-22 14:46:42 +00:00
isValidGuid: typeof isValidGuid;
libphonenumber: {
util: {
getRegionCodeForNumber: (number: string) => string;
parseNumber: (
e164: string,
2021-06-25 16:08:16 +00:00
defaultRegionCode?: string
) =>
| { isValidNumber: false; error: unknown }
| {
isValidNumber: true;
regionCode: string | undefined;
countryCode: string;
nationalNumber: string;
e164: string;
};
};
parse: (number: string) => string;
getRegionCodeForNumber: (number: string) => string;
format: (number: string, format: PhoneNumberFormat) => string;
};
log: LoggerType;
nodeSetImmediate: typeof setImmediate;
2021-02-01 20:01:25 +00:00
onFullScreenChange: (fullScreen: boolean) => void;
2020-06-04 18:16:19 +00:00
platform: string;
preloadedImages: Array<WhatIsThis>;
reduxActions: ReduxActions;
reduxStore: Store<StateType>;
registerForActive: (handler: () => void) => void;
restart: () => void;
setImmediate: typeof setImmediate;
2020-06-04 18:16:19 +00:00
showWindow: () => void;
2020-09-16 19:31:05 +00:00
showSettings: () => void;
shutdown: () => void;
showDebugLog: () => void;
sendChallengeRequest: (request: IPCChallengeRequest) => void;
setAutoHideMenuBar: (value: WhatIsThis) => void;
setBadgeCount: (count: number) => void;
setMenuBarVisibility: (value: WhatIsThis) => void;
updateSystemTraySetting: (value: SystemTraySetting) => void;
showConfirmationDialog: (options: ConfirmationDialogViewProps) => void;
showKeyboardShortcuts: () => void;
storage: Storage;
systemTheme: WhatIsThis;
textsecure: TextSecureType;
synchronousCrypto: typeof synchronousCrypto;
2021-02-01 20:01:25 +00:00
titleBarDoubleClick: () => void;
unregisterForActive: (handler: () => void) => void;
updateTrayIcon: (count: number) => void;
2021-03-04 21:44:57 +00:00
sqlInitializer: {
initialize: () => Promise<void>;
goBackToMainProcess: () => Promise<void>;
2021-03-04 21:44:57 +00:00
};
Backbone: typeof Backbone;
2021-08-11 19:29:07 +00:00
CI?: CI;
2021-04-27 22:11:59 +00:00
Accessibility: {
reducedMotionSetting: boolean;
};
Signal: {
Backbone: any;
Crypto: typeof Crypto;
Curve: typeof Curve;
Data: typeof Data;
2020-10-06 17:06:34 +00:00
Groups: typeof Groups;
RemoteConfig: typeof RemoteConfig;
2020-06-04 18:16:19 +00:00
Services: {
calling: CallingClass;
enableStorageService: () => boolean;
eraseAllStorageServiceState: () => Promise<void>;
initializeGroupCredentialFetcher: () => void;
initializeNetworkObserver: (network: ReduxActions['network']) => void;
initializeUpdateListener: (updates: ReduxActions['updates']) => void;
onTimeout: (timestamp: number, cb: () => void, id?: string) => string;
removeTimeout: (uuid: string) => void;
2021-05-28 19:11:19 +00:00
retryPlaceholders?: Util.RetryPlaceholders;
lightSessionResetQueue?: PQueue;
runStorageServiceSyncJob: () => Promise<void>;
storageServiceUploadJob: () => void;
2020-06-04 18:16:19 +00:00
};
2020-09-09 02:25:05 +00:00
Migrations: {
readTempData: any;
2020-09-09 02:25:05 +00:00
deleteAttachmentData: (path: string) => Promise<void>;
doesAttachmentExist: () => unknown;
2020-09-09 02:25:05 +00:00
writeNewAttachmentData: (data: ArrayBuffer) => Promise<string>;
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>;
2021-07-09 19:36:10 +00:00
deleteSticker: (path: string) => Promise<void>;
getAbsoluteStickerPath: (path: string) => string;
processNewEphemeralSticker: (
stickerData: ArrayBuffer
) => {
path: string;
width: number;
height: number;
};
processNewSticker: (
stickerData: ArrayBuffer
) => {
path: string;
width: number;
height: number;
};
copyIntoAttachmentsDirectory: (path: string) => Promise<string>;
upgradeMessageSchema: (attributes: unknown) => WhatIsThis;
processNewAttachment: (
2021-07-14 23:39:52 +00:00
attachment: DownloadedAttachmentType
) => Promise<DownloadedAttachmentType>;
copyIntoTempDirectory: any;
2021-07-09 19:36:10 +00:00
deleteDraftFile: (path: string) => Promise<void>;
deleteTempFile: (path: string) => Promise<void>;
getAbsoluteDraftPath: any;
getAbsoluteTempPath: any;
openFileInFolder: any;
readAttachmentData: any;
readDraftData: any;
saveAttachmentToDisk: any;
writeNewDraftData: any;
2021-08-06 00:17:05 +00:00
deleteAvatar: (path: string) => Promise<void>;
getAbsoluteAvatarPath: (src: string) => string;
writeNewAvatarData: (data: ArrayBuffer) => Promise<string>;
};
2020-09-09 02:25:05 +00:00
Types: {
2021-07-14 23:39:52 +00:00
Attachment: typeof Attachment;
MIME: typeof MIME;
EmbeddedContact: typeof EmbeddedContact;
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>;
};
Errors: typeof Errors;
2020-09-09 02:25:05 +00:00
Message: {
CURRENT_SCHEMA_VERSION: number;
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
};
VisualAttachment: any;
};
Util: typeof Util;
GroupChange: {
renderChange: (change: unknown, things: unknown) => Array<string>;
};
Components: {
AttachmentList: typeof AttachmentList;
CaptionEditor: typeof CaptionEditor;
2021-05-28 16:15:17 +00:00
ChatColorPicker: typeof ChatColorPicker;
ConfirmationDialog: typeof ConfirmationDialog;
ContactDetail: typeof ContactDetail;
ContactModal: typeof ContactModal;
DisappearingTimeDialog: typeof DisappearingTimeDialog;
ErrorModal: typeof ErrorModal;
Lightbox: typeof Lightbox;
MediaGallery: typeof MediaGallery;
MessageDetail: typeof MessageDetail;
2020-10-06 17:06:34 +00:00
ProgressModal: typeof ProgressModal;
Quote: typeof Quote;
StagedLinkPreview: typeof StagedLinkPreview;
WhatsNew: typeof WhatsNew;
};
OS: typeof OS;
Workflow: {
IdleDetector: WhatIsThis;
MessageDataMigrator: WhatIsThis;
};
IndexedDB: {
removeDatabase: WhatIsThis;
doesDatabaseExist: WhatIsThis;
};
Views: WhatIsThis;
2020-10-30 17:52:21 +00:00
State: {
createStore: typeof createStore;
Roots: {
2021-06-14 19:01:00 +00:00
createApp: typeof createApp;
2021-05-28 16:15:17 +00:00
createChatColorPicker: typeof createChatColorPicker;
2020-10-30 17:52:21 +00:00
createCompositionArea: typeof createCompositionArea;
createContactModal: typeof createContactModal;
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;
createGroupLinkManagement: typeof createGroupLinkManagement;
createGroupV1MigrationModal: typeof createGroupV1MigrationModal;
createGroupV2JoinModal: typeof createGroupV2JoinModal;
createGroupV2Permissions: typeof createGroupV2Permissions;
2020-10-30 17:52:21 +00:00
createLeftPane: typeof createLeftPane;
createMessageDetail: typeof createMessageDetail;
2021-08-05 12:35:33 +00:00
createConversationNotificationsSettings: typeof createConversationNotificationsSettings;
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: {
2021-06-14 19:01:00 +00:00
app: typeof appDuck;
2020-10-30 17:52:21 +00:00
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;
};
};
Logs: WhatIsThis;
conversationControllerStart: WhatIsThis;
Emojis: {
getInitialState: () => WhatIsThis;
load: () => void;
};
challengeHandler: ChallengeHandler;
};
2021-06-22 14:46:42 +00:00
SignalContext: SignalContext;
ConversationController: ConversationController;
2021-08-18 20:08:14 +00:00
Events: IPCEventsType;
MessageController: MessageController;
2021-02-26 23:42:45 +00:00
SignalProtocolStore: typeof SignalProtocolStore;
WebAPI: WebAPIConnectType;
Whisper: WhisperType;
2020-06-04 18:16:19 +00:00
getServerTrustRoot: () => WhatIsThis;
readyForUpdates: () => void;
2021-08-03 17:05:20 +00:00
logAppLoadedEvent?: (options: { processedCount?: number }) => void;
logAuthenticatedConnect?: () => void;
2020-11-13 19:57:55 +00:00
// Runtime Flags
isShowingModal?: boolean;
// Feature Flags
GV2_ENABLE_SINGLE_CHANGE_PROCESSING: boolean;
GV2_ENABLE_CHANGE_PROCESSING: boolean;
GV2_ENABLE_STATE_PROCESSING: boolean;
GV2_MIGRATION_DISABLE_ADD: boolean;
GV2_MIGRATION_DISABLE_INVITE: boolean;
2021-08-20 16:06:15 +00:00
RETRY_DELAY: boolean;
}
2020-05-27 21:37:06 +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;
2021-07-09 19:36:10 +00:00
reason?: any;
stackForLog?: string;
2020-05-27 21:37:06 +00:00
}
// Uint8Array and ArrayBuffer are type-compatible in TypeScript's covariant
// type checker, but in reality they are not. Let's assert correct use!
interface Uint8Array {
__uint8array: never;
}
interface ArrayBuffer {
__array_buffer: never;
}
interface SharedArrayBuffer {
__array_buffer: never;
}
}
export class CertificateValidatorType {
validate: (cerficate: any, certificateTime: number) => Promise<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>);
}
export type DeliveryReceiptBatcherItemType = {
messageId: string;
source?: string;
sourceUuid?: string;
timestamp: number;
};
export type LoggerType = {
fatal: LogFunctionType;
info: LogFunctionType;
warn: LogFunctionType;
error: LogFunctionType;
debug: LogFunctionType;
trace: LogFunctionType;
fetch: () => Promise<string>;
publish: typeof uploadDebugLogs;
};
export type LogFunctionType = (...args: Array<unknown>) => void;
export type WhisperType = {
events: Backbone.Events;
Database: {
open: () => Promise<IDBDatabase>;
handleDOMException: (
context: string,
error: DOMException | null,
reject: Function
) => void;
};
ConversationCollection: typeof ConversationModelCollectionType;
ConversationCollectionType: ConversationModelCollectionType;
Conversation: typeof ConversationModel;
ConversationType: ConversationModel;
MessageCollection: typeof MessageModelCollectionType;
MessageCollectionType: MessageModelCollectionType;
MessageAttributesType: MessageAttributesType;
Message: typeof MessageModel;
MessageType: MessageModel;
GroupMemberConversation: WhatIsThis;
KeyChangeListener: WhatIsThis;
ClearDataView: WhatIsThis;
ReactWrapperView: WhatIsThis;
activeConfirmationView: WhatIsThis;
ToastView: typeof window.Whisper.View & {
show: (view: typeof Backbone.View, el: Element) => void;
2020-10-02 18:30:43 +00:00
};
ConversationArchivedToast: WhatIsThis;
ConversationUnarchivedToast: WhatIsThis;
ConversationMarkedUnreadToast: WhatIsThis;
WallClockListener: WhatIsThis;
BannerView: any;
RecorderView: any;
GroupMemberList: any;
GroupLinkCopiedToast: typeof Backbone.View;
2021-06-14 19:01:00 +00:00
InboxView: typeof window.Whisper.View;
InstallView: typeof window.Whisper.View;
StandaloneRegistrationView: typeof window.Whisper.View;
KeyVerificationPanelView: any;
SafetyNumberChangeDialogView: any;
2020-11-03 01:19:52 +00:00
BodyRangesType: BodyRangesType;
BodyRangeType: BodyRangeType;
Notifications: {
isEnabled: boolean;
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;
};
ExpiringMessagesListener: {
init: (events: Backbone.Events) => void;
update: () => void;
};
TapToViewMessagesListener: {
nextCheck: null | number;
init: (events: Backbone.Events) => void;
update: () => void;
};
deliveryReceiptQueue: PQueue;
deliveryReceiptBatcher: BatcherType<DeliveryReceiptBatcherItemType>;
RotateSignedPreKeyListener: WhatIsThis;
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;
CaptchaSolvedToast: typeof window.Whisper.ToastView;
CaptchaFailedToast: typeof window.Whisper.ToastView;
2021-07-20 20:18:35 +00:00
CannotStartGroupCallToast: typeof window.Whisper.ToastView;
DangerousFileTypeToast: typeof window.Whisper.ToastView;
DecryptionErrorToast: typeof window.Whisper.ToastView;
ExpiredToast: typeof window.Whisper.ToastView;
FileSavedToast: typeof window.Whisper.ToastView;
FileSizeToast: any;
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;
DeleteForEveryoneFailedToast: typeof window.Whisper.ToastView;
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>;
};
2021-06-01 20:45:43 +00:00
DisappearingTimeDialog: typeof window.Whisper.View | undefined;
};