MCPcopy Create free account
hub / github.com/DarkGuy10/BotClient / AppData

Class AppData

src/services/AppData.js:10–46  ·  view source on GitHub ↗

* SetOptions * @typedef {Object} SetOptions * @property {String} Key * @property {any} value Value

Source from the content-addressed store, hash-verified

8 */
9
10class AppData {
11 /**
12 * Set an item.
13 * @param {String} key
14 * @param {?any} value
15 */
16 static set(key, value) {
17 ipcRenderer.send('AppData', 'set', [key, value])
18 }
19
20 /**
21 * Get an item.
22 * @param {String} key The key of the item to get.
23 * @param {?any} defaultValue The default value to return if item does not exist.
24 * @returns {any}
25 */
26 static get(key, defaultValue) {
27 return ipcRenderer.sendSync('AppData', 'get', [key, defaultValue])
28 }
29
30 /**
31 * Check if an item exists.
32 * @param {String} key The key of the item to check.
33 * @returns {boolean}
34 */
35 static has(key) {
36 return ipcRenderer.sendSync('AppData', 'has', key)
37 }
38
39 /**
40 * Delete an item.
41 * @param {String} key The key of the item to delete.
42 */
43 static delete(key) {
44 ipcRenderer.send('AppData', 'delete', key)
45 }
46}
47
48export default AppData

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected