session-desktop/ts/window.d.ts

98 lines
3.0 KiB
TypeScript
Raw Normal View History

2021-05-31 06:11:20 +02:00
import {} from 'styled-components/cssprop';
import { LocalizerType } from '../ts/types/Util';
import { LibsignalProtocol } from '../../libtextsecure/libsignal-protocol';
import { SignalInterface } from '../../js/modules/signal';
2020-07-03 02:08:24 +02:00
import { LibTextsecure } from '../libtextsecure';
2020-11-13 04:29:59 +01:00
import { Store } from 'redux';
2020-12-15 07:14:18 +01:00
import { ConversationCollection, ConversationModel } from './models/conversation';
2021-02-15 05:16:38 +01:00
import { ConversationType } from './state/ducks/conversations';
2021-01-29 01:29:24 +01:00
/*
We declare window stuff here instead of global.d.ts because we are importing other declarations.
If you import anything in global.d.ts, the type system won't work correctly.
*/
2020-07-07 09:46:50 +02:00
declare global {
interface Window {
CONSTANTS: any;
Events: any;
Lodash: any;
2022-02-18 03:03:47 +01:00
SessionSnodeAPI: any;
Session: any;
Signal: SignalInterface;
StubAppDotNetApi: any;
StringView: any;
StubMessageAPI: any;
Whisper: any;
clearLocalData: any;
clipboard: any;
dcodeIO: any;
2021-10-22 01:39:05 +02:00
getSettingValue: (id: string, comparisonValue?: any) => any;
setSettingValue: (id: string, value: any) => void;
i18n: LocalizerType;
libsignal: LibsignalProtocol;
log: any;
2022-02-18 03:03:47 +01:00
sessionFeatureFlags: {
useOnionRequests: boolean;
2021-09-21 09:51:23 +02:00
useCallMessage: boolean;
2020-08-04 03:23:48 +02:00
};
2022-02-18 03:03:47 +01:00
SessionSnodeAPI: SessionSnodeAPI;
onLogin: any;
2021-08-05 05:15:03 +02:00
persistStore?: Persistor;
restart: any;
getSeedNodeList: () => Array<any> | undefined;
setPassword: any;
storage: any;
2020-07-03 02:08:24 +02:00
textsecure: LibTextsecure;
toggleMediaPermissions: () => Promise<void>;
toggleCallMediaPermissionsTo: (enabled: boolean) => Promise<void>;
getCallMediaPermissions: () => boolean;
updateZoomFactor: () => boolean;
toggleMenuBar: () => void;
toggleSpellCheck: any;
setTheme: (newTheme: string) => any;
2021-08-13 06:47:00 +02:00
isDev?: () => boolean;
userConfig: any;
versionInfo: any;
2020-11-13 04:29:59 +01:00
getConversations: () => ConversationCollection;
readyForUpdates: () => void;
2022-03-23 04:27:10 +01:00
drawAttention: () => void;
2020-07-16 03:55:21 +02:00
MediaRecorder: any;
2022-03-23 04:27:10 +01:00
platform: string;
openFromNotification: (convoId: string) => void;
2022-03-23 06:35:29 +01:00
getEnvironment: () => string;
getNodeVersion: () => string;
2022-03-23 04:27:10 +01:00
2022-03-24 01:15:21 +01:00
showWindow: () => void;
setCallMediaPermissions: (val: boolean) => void;
setMediaPermissions: (val: boolean) => void;
askForMediaAccess: () => void;
getMediaPermissions: () => boolean;
nodeSetImmediate: any;
globalOnlineStatus: boolean;
getTitle: () => string;
getVersion: () => string;
setAutoHideMenuBar: (val: boolean) => void;
setMenuBarVisibility: (val: boolean) => void;
contextMenuShown: boolean;
inboxStore?: Store;
openConversationWithMessages: (args: {
conversationKey: string;
2022-02-14 06:42:53 +01:00
messageId: string | null;
}) => Promise<void>;
2021-01-29 01:29:24 +01:00
LokiPushNotificationServer: any;
2021-08-13 06:47:00 +02:00
getGlobalOnlineStatus: () => boolean;
confirmationDialog: any;
callWorker: (fnName: string, ...args: any) => Promise<any>;
setStartInTray: (val: boolean) => Promise<void>;
getStartInTray: () => Promise<boolean>;
2021-09-22 09:04:15 +02:00
libsession: any;
}
}