From e2801915efa9ce906ed56835ae1f85dbadc52349 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Mon, 23 Oct 2023 10:55:38 +1100 Subject: [PATCH] chore: cleaned up window.d.ts --- about_preload.js | 8 -------- preload.js | 2 +- ts/window.d.ts | 17 +++-------------- 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/about_preload.js b/about_preload.js index 27f48d231..17f121021 100644 --- a/about_preload.js +++ b/about_preload.js @@ -20,14 +20,6 @@ window.getVersion = () => config.version; window.getCommitHash = () => config.commitHash; window.getAppInstance = () => config.appInstance; -const { AboutView } = require('./ts/components/AboutView'); - -window.Signal = { - Components: { - AboutView, - }, -}; - window.closeAbout = () => ipcRenderer.send('close-about'); require('./ts/util/logging'); diff --git a/preload.js b/preload.js index c0fc59dea..bb904551f 100644 --- a/preload.js +++ b/preload.js @@ -237,7 +237,7 @@ window.nodeSetImmediate = setImmediate; const data = require('./ts/data/dataInit'); const { setupi18n } = require('./ts/util/i18n'); -window.Signal = data.initData(); +data.initData(); const { ConvoHub } = require('./ts/session/conversations/ConversationController'); window.getConversationController = ConvoHub.use; diff --git a/ts/window.d.ts b/ts/window.d.ts index 6ccc54c19..9283b5925 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -3,7 +3,6 @@ import {} from 'styled-components/cssprop'; import { LocalizerType } from './types/Util'; -import { ConversationCollection } from './models/conversation'; import { PrimaryColorStateType, ThemeStateType } from './themes/constants/colors'; export interface LibTextsecure { @@ -17,14 +16,11 @@ If you import anything in global.d.ts, the type system won't work correctly. declare global { interface Window { - CONSTANTS: any; Events: any; - Lodash: any; Session: any; Whisper: any; clearLocalData: any; clipboard: any; - dcodeIO: any; getSettingValue: (id: string, comparisonValue?: any) => any; setSettingValue: (id: string, value: any) => Promise; @@ -43,28 +39,25 @@ declare global { debugOnionRequests: boolean; }; }; - SessionSnodeAPI: SessionSnodeAPI; onLogin: (pw: string) => Promise; persistStore?: Persistor; - restart: any; + restart: () => void; getSeedNodeList: () => Array | undefined; - setPassword: any; + setPassword: (passPhrase: string | null, oldPhrase: string | null) => Promise; isOnline: boolean; toggleMediaPermissions: () => Promise; toggleCallMediaPermissionsTo: (enabled: boolean) => Promise; getCallMediaPermissions: () => boolean; toggleMenuBar: () => void; - toggleSpellCheck: any; + toggleSpellCheck: () => void; primaryColor: PrimaryColorStateType; theme: ThemeStateType; setTheme: (newTheme: string) => Promise; isDev?: () => boolean; userConfig: any; versionInfo: any; - getConversations: () => ConversationCollection; readyForUpdates: () => void; drawAttention: () => void; - MediaRecorder: any; platform: string; openFromNotification: (convoId: string) => void; @@ -91,9 +84,7 @@ declare global { conversationKey: string; messageId: string | null; }) => Promise; - LokiPushNotificationServer: any; getGlobalOnlineStatus: () => boolean; - confirmationDialog: any; setStartInTray: (val: boolean) => Promise; getStartInTray: () => Promise; getOpengroupPruning: () => Promise; @@ -104,7 +95,5 @@ declare global { setAutoUpdateEnabled: (enabled: boolean) => void; setZoomFactor: (newZoom: number) => void; updateZoomFactor: () => void; - - Signal: any; } }