Initial I Want to Heal app
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
import { Capacitor, registerPlugin } from '@capacitor/core'
|
||||
|
||||
export type AndroidDisplay = {
|
||||
id: number
|
||||
name: string
|
||||
width: number
|
||||
height: number
|
||||
refreshRate: number
|
||||
isCurrent: boolean
|
||||
isPresentation: boolean
|
||||
}
|
||||
|
||||
type DualScreenNativePlugin = {
|
||||
getDisplays: () => Promise<{
|
||||
currentDisplayId: number
|
||||
displays: AndroidDisplay[]
|
||||
}>
|
||||
openTopDisplay: (options?: { displayId?: number }) => Promise<AndroidDisplay & {
|
||||
opened: boolean
|
||||
}>
|
||||
closeTopDisplay: () => Promise<void>
|
||||
}
|
||||
|
||||
const nativePlugin = registerPlugin<DualScreenNativePlugin>('DualScreen')
|
||||
|
||||
export function hasNativeDualScreenBridge() {
|
||||
return Capacitor.isNativePlatform()
|
||||
}
|
||||
|
||||
export function getNativeDisplays() {
|
||||
return nativePlugin.getDisplays()
|
||||
}
|
||||
|
||||
export function openNativeTopDisplay(displayId?: number) {
|
||||
return nativePlugin.openTopDisplay(
|
||||
displayId === undefined ? undefined : { displayId },
|
||||
)
|
||||
}
|
||||
|
||||
export function closeNativeTopDisplay() {
|
||||
return nativePlugin.closeTopDisplay()
|
||||
}
|
||||
Reference in New Issue
Block a user