signal-desktop/ts/windows/preload.ts

83 lines
2.5 KiB
TypeScript
Raw Normal View History

2021-08-18 20:08:14 +00:00
// Copyright 2017-2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { ipcRenderer as ipc } from 'electron';
import { installCallback, installSetting } from '../util/preload';
// ChatColorPicker redux hookups
installCallback('getCustomColors');
installCallback('getConversationsWithCustomColor');
installCallback('addCustomColor');
installCallback('editCustomColor');
installCallback('removeCustomColor');
installCallback('removeCustomColorOnConversations');
installCallback('resetAllChatColors');
installCallback('resetDefaultChatColor');
installCallback('setGlobalDefaultConversationColor');
installCallback('getDefaultConversationColor');
installCallback('persistZoomFactor');
installCallback('closeDB');
2021-08-18 20:08:14 +00:00
// Getters only. These are set by the primary device
installSetting('blockedCount', {
setter: false,
});
installSetting('linkPreviewSetting', {
setter: false,
});
installSetting('phoneNumberDiscoverabilitySetting', {
setter: false,
});
installSetting('phoneNumberSharingSetting', {
setter: false,
});
installSetting('readReceiptSetting', {
setter: false,
});
installSetting('typingIndicatorSetting', {
setter: false,
});
2022-07-20 00:47:05 +00:00
installCallback('isPhoneNumberSharingEnabled');
installCallback('isPrimary');
installCallback('shouldShowStoriesSettings');
installCallback('syncRequest');
2021-08-18 20:08:14 +00:00
installSetting('alwaysRelayCalls');
installSetting('audioNotification');
installSetting('autoDownloadUpdate');
2021-08-18 20:08:14 +00:00
installSetting('autoLaunch');
installSetting('callRingtoneNotification');
installSetting('callSystemNotification');
2022-07-20 00:47:05 +00:00
installSetting('countMutedConversations');
2021-08-18 20:08:14 +00:00
installSetting('deviceName');
2022-07-20 00:47:05 +00:00
installSetting('hasStoriesEnabled');
2021-08-18 20:08:14 +00:00
installSetting('hideMenuBar');
installSetting('incomingCallNotification');
2022-07-20 00:47:05 +00:00
installSetting('lastSyncTime');
2021-08-18 20:08:14 +00:00
installSetting('notificationDrawAttention');
installSetting('notificationSetting');
installSetting('spellCheck');
installSetting('systemTraySetting');
installSetting('themeSetting');
installSetting('universalExpireTimer');
installSetting('zoomFactor');
// Media Settings
installCallback('getAvailableIODevices');
installSetting('preferredAudioInputDevice');
installSetting('preferredAudioOutputDevice');
installSetting('preferredVideoInputDevice');
window.getMediaPermissions = () => ipc.invoke('settings:get:mediaPermissions');
2021-08-18 20:08:14 +00:00
window.getMediaCameraPermissions = () =>
ipc.invoke('settings:get:mediaCameraPermissions');
2022-01-11 20:02:46 +00:00
window.crashReports = {
getCount: () => ipc.invoke('crash-reports:get-count'),
upload: () => ipc.invoke('crash-reports:upload'),
erase: () => ipc.invoke('crash-reports:erase'),
};