import { ElectronAPI } from '@electron-toolkit/preload' import { Event } from 'nostr-tools' export type TRelayGroup = { groupName: string relayUrls: string[] isActive: boolean } export type TConfig = { relayGroups: TRelayGroup[] theme: TThemeSetting } export type TThemeSetting = 'light' | 'dark' | 'system' export type TTheme = 'light' | 'dark' export type TDraftEvent = Pick export interface ISigner { getPublicKey: () => Promise signEvent: (draftEvent: TDraftEvent) => Promise } export type TElectronWindow = { electron: ElectronAPI api: { system: { isEncryptionAvailable: () => Promise getSelectedStorageBackend: () => Promise } theme: { addChangeListener: (listener: (theme: TTheme) => void) => void removeChangeListener: () => void current: () => Promise } storage: { getItem: (key: string) => Promise setItem: (key: string, value: string) => Promise removeItem: (key: string) => Promise } nostr: { login: (nsec: string) => Promise<{ pubkey?: string reason?: string }> logout: () => Promise } } nostr: ISigner } export type TAccount = { pubkey: string signerType: 'nsec' | 'browser-nsec' | 'nip-07' | 'bunker' nsec?: string bunker?: string bunkerClientSecretKey?: string }