/**
 * @typedef {Object} PlatformCrypto
 * @property {() => Promise<{rsaPub: string, rsaPriv: string, edPub: string, edPriv: string}>} generateKeys
 * @property {(size: number) => Promise<string>} randomBytes - Returns hex string
 * @property {(data: string) => Promise<string>} sha256 - Returns hex hash
 * @property {(privateKey: string, message: string) => Promise<string>} signMessage
 * @property {(publicKey: string, message: string, signature: string) => Promise<boolean>} verifySignature
 * @property {(password: string, salt: string) => Promise<{dek: string, dak: string}>} deriveAuthKeys
 * @property {(data: string, key: string) => Promise<{content: string, iv: string, tag: string}>} encryptData
 * @property {(encryptedData: string, key: string, iv: string, tag: string, options?: object) => Promise<string>} decryptData
 * @property {(items: Array) => Promise<Array>} decryptBatch
 * @property {(items: Array) => Promise<Array>} verifyBatch
 * @property {(publicKey: string, data: string) => Promise<string>} publicEncrypt
 * @property {(privateKey: string, encryptedHex: string) => Promise<string>} privateDecrypt
 */

/**
 * @typedef {Object} PlatformSession
 * @property {(data: object) => Promise<void>} save
 * @property {() => Promise<object|null>} load
 * @property {() => Promise<void>} clear
 */

/**
 * @typedef {Object} PlatformSettings
 * @property {(key: string) => Promise<any>} get
 * @property {(key: string, value: any) => Promise<void>} set
 */

/**
 * @typedef {Object} PlatformIdle
 * @property {() => Promise<number>} getSystemIdleTime - Returns idle time in seconds
 * @property {(callback: function) => void} onIdleStateChanged
 * @property {() => void} removeIdleStateListener
 */

/**
 * @typedef {Object} PlatformLinks
 * @property {(url: string) => void} openExternal
 * @property {(url: string) => Promise<object>} fetchMetadata
 */

/**
 * @typedef {Object} PlatformScreenCapture
 * @property {() => Promise<Array>} getScreenSources
 */

/**
 * @typedef {Object} PlatformWindowControls
 * @property {() => void} minimize
 * @property {() => void} maximize
 * @property {() => void} close
 */

/**
 * @typedef {Object} PlatformUpdates
 * @property {() => Promise<object>} checkUpdate
 */

/**
 * @typedef {Object} PlatformSearchDB
 * @property {(dbKeyHex: string, userId: string) => Promise<void>} open
 * @property {() => Promise<void>} close
 * @property {() => Promise<void>} save
 * @property {(messages: Array) => void} indexMessages
 * @property {(params: object) => Array} search
 * @property {(messageId: string) => boolean} isIndexed
 * @property {() => boolean} isOpen
 * @property {() => object} getStats
 */

/**
 * @typedef {Object} PlatformFeatures
 * @property {boolean} hasWindowControls
 * @property {boolean} hasScreenCapture
 * @property {boolean} hasNativeUpdates
 * @property {boolean} hasSearch
 */

/**
 * @typedef {Object} Platform
 * @property {PlatformCrypto} crypto
 * @property {PlatformSession|null} session
 * @property {PlatformSettings|null} settings
 * @property {PlatformIdle|null} idle
 * @property {PlatformLinks} links
 * @property {PlatformScreenCapture|null} screenCapture
 * @property {PlatformWindowControls|null} windowControls
 * @property {PlatformUpdates|null} updates
 * @property {PlatformSearchDB|null} searchDB
 * @property {PlatformFeatures} features
 */

export {};
