@pipelab/asset-electron 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +110 -0
- package/package.json +18 -0
- package/template/config.cjs +45 -0
- package/template/forge.config.cjs +70 -0
- package/template/package.json +62 -0
- package/template/pipelab-plugin.cjs +160 -0
- package/template/src/custom-main.js +1 -0
- package/template/src/handlers/dialog/folder.js +25 -0
- package/template/src/handlers/dialog/open.js +25 -0
- package/template/src/handlers/dialog/save.js +24 -0
- package/template/src/handlers/discord/set-activity.js +68 -0
- package/template/src/handlers/fs/copy.js +29 -0
- package/template/src/handlers/fs/delete.js +23 -0
- package/template/src/handlers/fs/exist.js +37 -0
- package/template/src/handlers/fs/file-size.js +24 -0
- package/template/src/handlers/fs/folder-create.js +25 -0
- package/template/src/handlers/fs/list.js +61 -0
- package/template/src/handlers/fs/move.js +30 -0
- package/template/src/handlers/fs/read-binary.js +24 -0
- package/template/src/handlers/fs/read.js +42 -0
- package/template/src/handlers/fs/write-base64.js +32 -0
- package/template/src/handlers/fs/write.js +30 -0
- package/template/src/handlers/general/engine.js +17 -0
- package/template/src/handlers/general/exit.js +20 -0
- package/template/src/handlers/general/infos.js +23 -0
- package/template/src/handlers/general/open-in-explorer.js +21 -0
- package/template/src/handlers/general/open.js +21 -0
- package/template/src/handlers/general/run.js +27 -0
- package/template/src/handlers/steam/deleteItem.js +26 -0
- package/template/src/handlers/steam/download.js +26 -0
- package/template/src/handlers/steam/downloadInfo.js +26 -0
- package/template/src/handlers/steam/downloadScore.js +28 -0
- package/template/src/handlers/steam/getItem.js +28 -0
- package/template/src/handlers/steam/getItems.js +28 -0
- package/template/src/handlers/steam/installInfo.js +26 -0
- package/template/src/handlers/steam/raw.js +42 -0
- package/template/src/handlers/steam/saveScreenshot.js +66 -0
- package/template/src/handlers/steam/state.js +26 -0
- package/template/src/handlers/steam/subscribe.js +26 -0
- package/template/src/handlers/steam/unsubscribe.js +26 -0
- package/template/src/handlers/steam/updateItem.js +26 -0
- package/template/src/handlers/steam/uploadScore.js +27 -0
- package/template/src/handlers/steam/utils.js +78 -0
- package/template/src/handlers/user/folder.js +71 -0
- package/template/src/handlers/window/maximize.js +20 -0
- package/template/src/handlers/window/minimize.js +20 -0
- package/template/src/handlers/window/request-attention.js +20 -0
- package/template/src/handlers/window/restore.js +20 -0
- package/template/src/handlers/window/set-always-on-top.js +20 -0
- package/template/src/handlers/window/set-fullscreen.js +26 -0
- package/template/src/handlers/window/set-height.js +21 -0
- package/template/src/handlers/window/set-ignore-mouse-events.js +36 -0
- package/template/src/handlers/window/set-maximum-size.js +20 -0
- package/template/src/handlers/window/set-minimum-size.js +20 -0
- package/template/src/handlers/window/set-resizable.js +20 -0
- package/template/src/handlers/window/set-title.js +20 -0
- package/template/src/handlers/window/set-width.js +21 -0
- package/template/src/handlers/window/set-x.js +21 -0
- package/template/src/handlers/window/set-y.js +21 -0
- package/template/src/handlers/window/show-dev-tools.js +24 -0
- package/template/src/handlers/window/unmaximize.js +20 -0
- package/template/src/index.js +958 -0
- package/template/src/preload.js +27 -0
- package/template/src/utils.js +18 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetWidth, 'input'>} json
|
|
3
|
+
* @param {import('ws').WebSocket} ws
|
|
4
|
+
* @param {import('electron').BrowserWindow} mainWindow
|
|
5
|
+
*/
|
|
6
|
+
export default async (json, ws, mainWindow) => {
|
|
7
|
+
const [, height] = mainWindow.getSize();
|
|
8
|
+
mainWindow.setSize(json.body.value, height);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetWidth, 'output'>}
|
|
12
|
+
*/
|
|
13
|
+
const setWidthResult = {
|
|
14
|
+
correlationId: json.correlationId,
|
|
15
|
+
url: json.url,
|
|
16
|
+
body: {
|
|
17
|
+
success: true,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
ws.send(JSON.stringify(setWidthResult));
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetX, 'input'>} json
|
|
3
|
+
* @param {import('ws').WebSocket} ws
|
|
4
|
+
* @param {import('electron').BrowserWindow} mainWindow
|
|
5
|
+
*/
|
|
6
|
+
export default async (json, ws, mainWindow) => {
|
|
7
|
+
const [x, y] = mainWindow.getPosition();
|
|
8
|
+
mainWindow.setPosition(json.body.value, y);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetX, 'output'>}
|
|
12
|
+
*/
|
|
13
|
+
const setXResult = {
|
|
14
|
+
correlationId: json.correlationId,
|
|
15
|
+
url: json.url,
|
|
16
|
+
body: {
|
|
17
|
+
success: true,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
ws.send(JSON.stringify(setXResult));
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetY, 'input'>} json
|
|
3
|
+
* @param {import('ws').WebSocket} ws
|
|
4
|
+
* @param {import('electron').BrowserWindow} mainWindow
|
|
5
|
+
*/
|
|
6
|
+
export default async (json, ws, mainWindow) => {
|
|
7
|
+
const [x, y] = mainWindow.getPosition();
|
|
8
|
+
mainWindow.setPosition(x, json.body.value);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageSetY, 'output'>}
|
|
12
|
+
*/
|
|
13
|
+
const setYResult = {
|
|
14
|
+
correlationId: json.correlationId,
|
|
15
|
+
url: json.url,
|
|
16
|
+
body: {
|
|
17
|
+
success: true,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
ws.send(JSON.stringify(setYResult));
|
|
21
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageShowDevTools, 'input'>} json
|
|
3
|
+
* @param {import('ws').WebSocket} ws
|
|
4
|
+
* @param {import('electron').BrowserWindow} mainWindow
|
|
5
|
+
*/
|
|
6
|
+
export default async (json, ws, mainWindow) => {
|
|
7
|
+
if (json.body.value === true) {
|
|
8
|
+
mainWindow.webContents.openDevTools();
|
|
9
|
+
} else {
|
|
10
|
+
mainWindow.webContents.closeDevTools();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageShowDevTools, 'output'>}
|
|
15
|
+
*/
|
|
16
|
+
const showDevtoolsResult = {
|
|
17
|
+
correlationId: json.correlationId,
|
|
18
|
+
url: json.url,
|
|
19
|
+
body: {
|
|
20
|
+
success: true,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
ws.send(JSON.stringify(showDevtoolsResult));
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageWindowUnmaximize, 'input'>} json
|
|
3
|
+
* @param {import('ws').WebSocket} ws
|
|
4
|
+
* @param {import('electron').BrowserWindow} mainWindow
|
|
5
|
+
*/
|
|
6
|
+
export default async (json, ws, mainWindow) => {
|
|
7
|
+
mainWindow.unmaximize();
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @type {import('@pipelab/core').MakeInputOutput<import('@pipelab/core').MessageWindowUnmaximize, 'output'>}
|
|
11
|
+
*/
|
|
12
|
+
const unmaximizeResult = {
|
|
13
|
+
correlationId: json.correlationId,
|
|
14
|
+
url: json.url,
|
|
15
|
+
body: {
|
|
16
|
+
success: true,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
ws.send(JSON.stringify(unmaximizeResult));
|
|
20
|
+
};
|