Capacitor electron plugin for Capacitor v.3
npm install @metacodi/capacitor-electron
npx cap sync
addListener('ping', ...)
exitApp()
getTextClipboard()
openWindow(...)
closeWindow()
getUrl()
setBadge(...)
showNotification(...)
playSound(...)
stopSound()
- Interfaces
addListener(eventName: 'ping', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
Param | Type |
---|---|
eventName |
'ping' |
listenerFunc |
() => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
exitApp() => Promise<void>
Exit electron app
getTextClipboard() => Promise<string>
get Text from Clipboard
Returns: Promise<string>
openWindow(options: { url: string; optionsWindow: BrowserWindowConstructorOptions | any; }) => Promise<any>
Create and control browser windows.
Window customization (BrowserWindow) <https://www.electronjs.org/docs/latest/api/browser-window>
Param | Type |
---|---|
options |
{ url: string; optionsWindow: any; } |
Returns: Promise<any>
closeWindow() => Promise<void>
Close window if opened
getUrl() => Promise<{ url: string; isClosed: boolean; }>
Get url and if window closed
Returns: Promise<{ url: string; isClosed: boolean; }>
setBadge(options: { value: number | null; }) => Promise<void>
Set Badge of application
Param | Type |
---|---|
options |
{ value: number | null; } |
showNotification(options: { package: string; title: string; message: string; }) => Promise<any>
Show system notification
Param | Type |
---|---|
options |
{ package: string; title: string; message: string; } |
Returns: Promise<any>
playSound(options: { src: string; loop?: boolean; volume?: number; }) => Promise<any>
Play Sound
Param | Type |
---|---|
options |
{ src: string; loop?: boolean; volume?: number; } |
Returns: Promise<any>
stopSound() => Promise<void>
Stop Sound
Prop | Type |
---|---|
remove |
() => Promise<void> |