File tree Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 38
38
]
39
39
},
40
40
"devDependencies" : {
41
+ "@types/uuid" : " ^3.4.4" ,
41
42
"electron" : " ^5.0.3" ,
42
43
"electron-packager" : " ^13.1.1" ,
43
- "foreman" : " ^3.0.1"
44
+ "foreman" : " ^3.0.1" ,
45
+ "uuid" : " ^3.3.2"
44
46
},
45
47
"main" : " src_main/entrypoint.js" ,
46
48
"homepage" : " ./"
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
3
+ import { Remote } from 'electron' ;
4
+ import uuid from 'uuid' ;
5
+
6
+ declare global {
7
+ interface Window {
8
+ require : any ;
9
+ }
10
+ }
11
+
12
+ const remote : Remote = window . require ( 'electron' ) . remote ;
13
+
3
14
function clicked ( ) {
4
- console . log ( 'clicked' ) ;
15
+ const filename = uuid . v4 ( ) + '.txt' ;
16
+ console . log ( 'created: ' + filename ) ;
5
17
}
6
18
7
19
export const CreateFileButton = ( ) => {
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ function createWindow() {
13
13
mainWindow = new BrowserWindow ( {
14
14
width : 1920 ,
15
15
height : 1080 ,
16
- webPreferences : { }
16
+ webPreferences : {
17
+ nodeIntegration : true
18
+ }
17
19
} ) ;
18
20
19
21
// and load the index.html of the app.
Original file line number Diff line number Diff line change 1315
1315
resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.3.tgz#9c088679876f374eb5983f150d4787aa6fb32d7e"
1316
1316
integrity sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ==
1317
1317
1318
+ " @types/uuid@^3.4.4 " :
1319
+ version "3.4.4"
1320
+ resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-3.4.4.tgz#7af69360fa65ef0decb41fd150bf4ca5c0cefdf5"
1321
+ integrity sha512-tPIgT0GUmdJQNSHxp0X2jnpQfBSTfGxUMc/2CXBU2mnyTFVYVa2ojpoQ74w0U2yn2vw3jnC640+77lkFFpdVDw==
1322
+ dependencies :
1323
+ " @types/node" " *"
1324
+
1318
1325
" @types/vfile-message@* " :
1319
1326
version "1.0.1"
1320
1327
resolved "https://registry.yarnpkg.com/@types/vfile-message/-/vfile-message-1.0.1.tgz#e1e9895cc6b36c462d4244e64e6d0b6eaf65355a"
You can’t perform that action at this time.
0 commit comments