refactor: improve device interface types (#996)
This commit is contained in:
11
app/assets/javascripts/Device/DesktopDeviceInterface.ts
Normal file
11
app/assets/javascripts/Device/DesktopDeviceInterface.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { DeviceInterface, Environment } from '@standardnotes/snjs'
|
||||
import { WebOrDesktopDevice } from '@/Device/WebOrDesktopDevice'
|
||||
import { WebCommunicationReceiver } from './DesktopWebCommunication'
|
||||
|
||||
export function isDesktopDevice(x: DeviceInterface): x is DesktopDeviceInterface {
|
||||
return x.environment === Environment.Desktop
|
||||
}
|
||||
|
||||
export interface DesktopDeviceInterface extends WebOrDesktopDevice, WebCommunicationReceiver {
|
||||
environment: Environment.Desktop
|
||||
}
|
||||
Reference in New Issue
Block a user