File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ contextBridge.exposeInMainWorld('electron', {
1919 app : {
2020 get : name => store . app . get ( name ) ,
2121 set : ( name , value ) => store . app . set ( name , value )
22+ } ,
23+ preferences : {
24+ get : name => store . preferences . get ( name ) ,
25+ set : ( name , value ) => store . preferences . set ( name , value )
2226 }
2327 } ,
2428 db : {
Original file line number Diff line number Diff line change 11import type { IpcRendererEvent } from 'electron'
2- import type { AppStoreSchema } from '../store/module/app '
2+ import type { AppStore , PreferencesStore } from '../store/module/types '
33import type { DB , Folder , Tag , Snippet } from './db'
44
55interface EventCallback {
66 ( event ?: IpcRendererEvent , ...args : any [ ] ) : void
77}
88
9+ interface StoreGet < T > {
10+ ( name : keyof T ) : string
11+ }
12+
13+ interface StoreSet < T > {
14+ ( name : keyof T , value : any ) : void
15+ }
16+
917export interface ElectronBridge {
1018 ipc : {
1119 on : ( channel : string , cb : EventCallback ) => void
@@ -15,8 +23,12 @@ export interface ElectronBridge {
1523 }
1624 store : {
1725 app : {
18- get : ( name : keyof AppStoreSchema ) => string
19- set : ( name : keyof AppStoreSchema , value : any ) => void
26+ get : StoreGet < AppStore >
27+ set : StoreSet < AppStore >
28+ }
29+ preferences : {
30+ get : StoreGet < PreferencesStore >
31+ set : StoreSet < PreferencesStore >
2032 }
2133 }
2234 db : {
You can’t perform that action at this time.
0 commit comments