## Classes
stringJust a convenience method for getting an url for a file from the local file system.
stringJust a convenience method for getting an url for a file from the assets directory.
PromiseJust a convenience method for getting a file from the local file system.
Returns a promise from fetch.
PromiseJust a convenience method for getting a file from the assets directory.
Returns a promise from fetch.
Invokes callback when the specified IPC event is fired.
Invokes a callback once when the specified IPC event is fired.
Unregisters a callback.
Unregisters all callbacks.
Send an event to the main Electron process.
Sends and IPC event response for a provided fetch id.
PromiseFetches some data from main process by sending an IPC event and waiting for a response. Returns a promise that resolves when the response is received.
PromiseDesktop.fetch without the need to provide a timeout value.
Sets the default fetch timeout.
Send an global event to the main Electron process.
functionCallback passed to ipc on/once methods.
string
Just a convenience method for getting an url for a file from the local file system.
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| absolutePath | string | absolute path to the file |
## getAssetUrl(assetPath) ⇒ string
Just a convenience method for getting an url for a file from the assets directory.
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| assetPath | string | file path relative to assets directory |
## fetchFile(absolutePath) ⇒ Promise
Just a convenience method for getting a file from the local file system.
Returns a promise from `fetch`.
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| absolutePath | string | absolute path to the file |
## fetchAsset(assetPath) ⇒ Promise
Just a convenience method for getting a file from the assets directory.
Returns a promise from `fetch`.
**Kind**: global function
| Param | Type | Description |
| --- | --- | --- |
| assetPath | string | file path relative to assets directory |
## on(module, event, callback)
Invokes callback when the specified IPC event is fired.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | name of an event |
| callback | [ipcListener](#ipcListener) | function to invoke when `event` is triggered |
## once(module, event, callback, response)
Invokes a callback once when the specified IPC event is fired.
**Kind**: global function
**Access**: public
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| module | string | | module name |
| event | string | | name of an event |
| callback | [ipcListener](#ipcListener) | | function to invoke when `event` is triggered |
| response | boolean | false | whether we are listening for fetch response |
## removeListener(module, event, callback)
Unregisters a callback.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | name of an event |
| callback | function | listener to unregister |
## removeAllListeners(module, event)
Unregisters all callbacks.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | name of an event |
## send(module, event, ...args)
Send an event to the main Electron process.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | name of an event |
| ...args | \* | arguments to send with the event |
## respond(module, event, fetchId, [...data])
Sends and IPC event response for a provided fetch id.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | event name |
| fetchId | number | fetch id that came with then event you are responding to |
| [...data] | \* | data to send with the event |
## fetch(module, event, timeout, ...args) ⇒ Promise
Fetches some data from main process by sending an IPC event and waiting for a response.
Returns a promise that resolves when the response is received.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | name of an event |
| timeout | number | how long to wait for the response in milliseconds |
| ...args | \* | arguments to send with the event |
## call(module, event, ...args) ⇒ Promise
Desktop.fetch without the need to provide a timeout value.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| module | string | module name |
| event | string | name of an event |
| ...args | \* | arguments to send with the event |
## setDefaultFetchTimeout(timeout)
Sets the default fetch timeout.
**Kind**: global function
| Param | Type |
| --- | --- |
| timeout | number |
## sendGlobal(...args)
Send an global event to the main Electron process.
**Kind**: global function
**Access**: public
| Param | Type | Description |
| --- | --- | --- |
| ...args | \* | arguments to the ipc.send(event, arg1, arg2) |
## ipcListener : function
Callback passed to ipc on/once methods.
**Kind**: global typedef
| Param | Type | Description |
| --- | --- | --- |
| event | string | event name |
| [...args] | \* | event's arguments |