From f420559f3f073fff270cbdac8ed233d6cd1af4b0 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 28 Aug 2020 10:09:17 +1000 Subject: [PATCH] add types for window.confirmationDialog --- background.d.ts | 14 ++++++++++++++ ts/window.d.ts | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 background.d.ts diff --git a/background.d.ts b/background.d.ts new file mode 100644 index 000000000..78d1c6119 --- /dev/null +++ b/background.d.ts @@ -0,0 +1,14 @@ +export interface ConfirmationDialogParams { + title?: string; + message: string; + messageSub?: string; + resolve?: any; + reject?: any; + okText?: string; + okTheme?: string; + closeTheme?: string; + cancelText?: string; + hideCancel?: boolean; + sessionIcon?: SessionIconType; + iconSize?: SessionIconSize; + } diff --git a/ts/window.d.ts b/ts/window.d.ts index e4c1b34a4..52a3f7e59 100644 --- a/ts/window.d.ts +++ b/ts/window.d.ts @@ -11,6 +11,7 @@ import { SwarmPolling } from './session/snode_api/swarmPolling'; import { LibTextsecure } from '../libtextsecure'; import { ConversationType } from '../js/modules/data'; import { RecoveryPhraseUtil } from '../libloki/modules/mnemonic'; +import { ConfirmationDialogParams } from '../background'; /* We declare window stuff here instead of global.d.ts because we are importing other declarations. @@ -38,7 +39,7 @@ declare global { attemptConnection: ConversationType; clearLocalData: any; clipboard: any; - confirmationDialog: any; + confirmationDialog: (params: ConfirmationDialogParams) => any; dcodeIO: any; deleteAccount: any; displayNameRegex: any;