Skip to content

Commit

Permalink
Add electron-store JSON schema for the app settings (wulkano#667)
Browse files Browse the repository at this point in the history
* refactor(settings.js): Add electron-store schema

Adds a JSON schema for electron-store.

re wulkano#663

* Update settings.js
  • Loading branch information
blakedietz authored and skllcrn committed May 2, 2019
1 parent 1672995 commit 0e1e4af
Showing 1 changed file with 71 additions and 17 deletions.
88 changes: 71 additions & 17 deletions main/common/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,78 @@ const Store = require('electron-store');
const {audioDevices} = require('aperture');

const store = new Store({
defaults: {
kapturesDir: `${homedir()}/Movies/Kaptures`,
allowAnalytics: true,
showCursor: true,
highlightClicks: false,
hideDesktopIcons: false,
record60fps: false,
loopExports: true,
recordKeyboardShortcut: true,
doNotDisturb: false,
recordAudio: false,
audioInputDeviceId: null,
schema: {
kapturesDir: {
type: 'string',
default: `${homedir()}/Movies/Kaptures`
},
allowAnalytics: {
type: 'boolean',
default: true
},
showCursor: {
type: 'boolean',
default: true
},
highlightClicks: {
type: 'boolean',
default: false
},
hideDesktopIcons: {
type: 'boolean',
default: false
},
record60fps: {
type: 'boolean',
default: false
},
loopExports: {
type: 'boolean',
default: true
},
recordKeyboardShortcut: {
type: 'boolean',
default: true
},
doNotDisturb: {
type: 'boolean',
default: false
},
recordAudio: {
type: 'boolean',
default: false
},
audioInputDeviceId: {
type: [
'string',
'null'
],
default: null
},
cropperShortcut: {
metaKey: true,
altKey: false,
ctrlKey: false,
shiftKey: true,
character: '5'
type: 'object',
properties: {
metaKey: {
type: 'boolean',
default: true
},
altKey: {
type: 'boolean',
default: false
},
ctrlKey: {
type: 'boolean',
default: false
},
shiftKey: {
type: 'boolean',
default: true
},
character: {
type: 'string',
default: '5'
}
}
}
}
});
Expand Down

0 comments on commit 0e1e4af

Please sign in to comment.