diff --git a/lib/components/debug-logs-context.js b/lib/components/debug-logs-context.js --- a/lib/components/debug-logs-context.js +++ b/lib/components/debug-logs-context.js @@ -25,15 +25,17 @@ const defaultLogsFilter: $ReadOnlySet = new Set([logTypes.ERROR]); +export type AddLogCallback = ( + title: string, + message: string, + logTypes: $ReadOnlySet, +) => mixed; + export type DebugLogsContextType = { +logs: $ReadOnlyArray, +logsFilter: $ReadOnlySet, +errorLogsCount: number, - +addLog: ( - title: string, - message: string, - logTypes: $ReadOnlySet, - ) => mixed, + +addLog: AddLogCallback, +clearLogs: () => mixed, +setFilter: (logType: LogType, value: boolean) => mixed, }; diff --git a/lib/tunnelbroker/peer-to-peer-context.js b/lib/tunnelbroker/peer-to-peer-context.js --- a/lib/tunnelbroker/peer-to-peer-context.js +++ b/lib/tunnelbroker/peer-to-peer-context.js @@ -9,7 +9,7 @@ useTunnelbroker, } from './tunnelbroker-context.js'; import { - type LogType, + type AddLogCallback, logTypes, type OlmDebugLog, useDebugLogs, @@ -75,11 +75,7 @@ async function createMissingSession( userDevicesWithoutSession: { [userID: string]: Array }, peerOlmSessionsCreator: CreateOlmSessionsWithUser, - addLog: ( - title: string, - message: string, - logTypes: $ReadOnlySet, - ) => mixed, + addLog: AddLogCallback, ): Promise { const creatingSessionPromises = entries(userDevicesWithoutSession).map( async ([userID, devices]) => { @@ -132,11 +128,7 @@ peerOlmSessionsCreator: CreateOlmSessionsWithUser, messageIDs: ?$ReadOnlyArray, allPeerDevices: $ReadOnlySet, - addLog: ( - title: string, - message: string, - logTypes: $ReadOnlySet, - ) => mixed, + addLog: AddLogCallback, olmDebugLog: (olmLog: OlmDebugLog) => mixed, ): Promise { let authMetadata;