5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-06 04:51:13 +08:00
wails/v3/plugins/kvstore/plugin.js
2023-08-27 16:59:18 +10:00

32 lines
767 B
JavaScript

// plugin.js
// This file should contain helper functions for the that can be used by the frontend.
// Below are examples of how to use JSDoc to define the Hashes struct and the exported functions.
/**
* Get the value of a key.
* @param key {string} - The store key.
* @returns {Promise<any>} - The value of the key.
*/
export function Get(key) {
return wails.CallByID(3322496224, key);
}
/**
* Set the value of a key.
@param key {string} - The store key.
@param value {any} - The value to set.
* @returns {Promise<void>}
*/
export function Set(key, value) {
return wails.CallByID(1207638860, key, value);
}
/**
* Save the database to disk.
* @returns {Promise<void|Error>}
*/
export function Save() {
return wails.CallByID(1377075201);
}