2023-01-20 15:33:26 +01:00
|
|
|
import Store from "electron-store"
|
|
|
|
|
2023-07-04 12:16:26 +02:00
|
|
|
const isDev = !!process.env.VITE_DEV_SERVER_URL
|
|
|
|
|
2023-01-20 15:33:26 +01:00
|
|
|
const schema = {
|
|
|
|
additionalProperties: false,
|
|
|
|
|
|
|
|
windowConfig: {
|
|
|
|
type: "object",
|
|
|
|
properties: {
|
|
|
|
width: {type: "number"},
|
|
|
|
height: {type: "number"},
|
|
|
|
x: {type: "number"},
|
|
|
|
y: {type: "number"},
|
|
|
|
isMaximized: {type: "boolean"},
|
|
|
|
isFullScreen: {type: "boolean"},
|
|
|
|
},
|
|
|
|
additionalProperties: false,
|
|
|
|
},
|
2023-01-27 17:18:31 +01:00
|
|
|
|
|
|
|
settings: {
|
|
|
|
type: "object",
|
|
|
|
properties: {
|
|
|
|
"keymap": { "enum": ["default", "emacs"], default:"default" },
|
|
|
|
"emacsMetaKey": { "enum": [null, "alt", "meta"], default: null },
|
|
|
|
"showLineNumberGutter": {type: "boolean", default:true},
|
|
|
|
"showFoldGutter": {type: "boolean", default:true},
|
2023-12-07 00:42:29 +01:00
|
|
|
"allowBetaVersions": {type: "boolean", default: false},
|
2023-01-27 17:18:31 +01:00
|
|
|
},
|
2023-03-09 09:46:21 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
theme: {type: "string", default: "system"},
|
2023-03-20 11:09:56 +01:00
|
|
|
|
|
|
|
currency: {
|
|
|
|
type: "object",
|
|
|
|
properties: {
|
|
|
|
data: {type: "object"},
|
|
|
|
timeFetched: {type: "number"},
|
|
|
|
},
|
|
|
|
},
|
2023-01-27 17:18:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
const defaults = {
|
|
|
|
settings: {
|
|
|
|
keymap: "default",
|
|
|
|
emacsMetaKey: "meta",
|
|
|
|
showLineNumberGutter: true,
|
|
|
|
showFoldGutter: true,
|
2023-12-07 00:42:29 +01:00
|
|
|
allowBetaVersions: false,
|
2023-03-09 09:46:21 +01:00
|
|
|
},
|
|
|
|
theme: "system",
|
2023-01-20 15:33:26 +01:00
|
|
|
}
|
|
|
|
|
2023-07-04 12:16:26 +02:00
|
|
|
export default new Store({schema, defaults, name: isDev ? "config-dev" : "config"})
|