refactor: improve device interface types (#996)
This commit is contained in:
44
app/assets/javascripts/Device/DesktopWebCommunication.ts
Normal file
44
app/assets/javascripts/Device/DesktopWebCommunication.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { DecryptedTransferPayload } from '@standardnotes/snjs'
|
||||
|
||||
/** Receives communications emitted by Web Core. This would be the Desktop client. */
|
||||
export interface WebCommunicationReceiver {
|
||||
localBackupsCount(): Promise<number>
|
||||
|
||||
viewlocalBackups(): void
|
||||
|
||||
deleteLocalBackups(): Promise<void>
|
||||
|
||||
syncComponents(payloads: unknown[]): void
|
||||
|
||||
onMajorDataChange(): void
|
||||
|
||||
onInitialDataLoad(): void
|
||||
|
||||
onSignOut(): void
|
||||
|
||||
onSearch(text?: string): void
|
||||
|
||||
downloadBackup(): void | Promise<void>
|
||||
|
||||
get extensionsServerHost(): string
|
||||
}
|
||||
|
||||
/** Receives communications emitted by the desktop client. This would be Web Core. */
|
||||
export interface DesktopCommunicationReceiver {
|
||||
updateAvailable(): void
|
||||
|
||||
windowGainedFocus(): void
|
||||
|
||||
windowLostFocus(): void
|
||||
|
||||
onComponentInstallationComplete(
|
||||
componentData: DecryptedTransferPayload,
|
||||
error: unknown,
|
||||
): Promise<void>
|
||||
|
||||
requestBackupFile(): Promise<string | undefined>
|
||||
|
||||
didBeginBackup(): void
|
||||
|
||||
didFinishBackup(success: boolean): void
|
||||
}
|
||||
Reference in New Issue
Block a user