@huyooo/file-explorer-bridge-electron 0.2.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/dist/main/index.cjs +235 -0
- package/dist/main/index.d.cts +27 -0
- package/dist/main/index.d.ts +27 -0
- package/dist/main/index.js +220 -0
- package/dist/preload/index.cjs +71 -0
- package/dist/preload/index.d.cts +145 -0
- package/dist/preload/index.d.ts +145 -0
- package/dist/preload/index.js +45 -0
- package/dist/renderer/index.cjs +57 -0
- package/dist/renderer/index.d.cts +150 -0
- package/dist/renderer/index.d.ts +150 -0
- package/dist/renderer/index.js +36 -0
- package/package.json +63 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// src/renderer/index.ts
|
|
2
|
+
function createElectronAdapter() {
|
|
3
|
+
const api = window.fileExplorerAPI;
|
|
4
|
+
if (!api) {
|
|
5
|
+
throw new Error(
|
|
6
|
+
"window.fileExplorerAPI not found. Make sure to call exposeFileExplorerAPI() in your preload script."
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
readDirectory: (dirPath) => api.readDirectory(dirPath),
|
|
11
|
+
readSystemPath: (pathId) => api.readSystemPath(pathId),
|
|
12
|
+
getSystemPath: (pathId) => api.getSystemPath(pathId),
|
|
13
|
+
readFileContent: (filePath) => api.readFileContent(filePath),
|
|
14
|
+
writeFileContent: (filePath, content) => api.writeFileContent(filePath, content),
|
|
15
|
+
createFolder: (parentDir, folderName) => api.createFolder(parentDir, folderName),
|
|
16
|
+
createFile: (parentDir, fileName, content) => api.createFile(parentDir, fileName, content),
|
|
17
|
+
deleteFiles: (paths) => api.deleteFiles(paths),
|
|
18
|
+
renameFile: (oldPath, newPath) => api.renameFile(oldPath, newPath),
|
|
19
|
+
copyFiles: (sourcePaths, targetDir) => api.copyFiles(sourcePaths, targetDir),
|
|
20
|
+
moveFiles: (sourcePaths, targetDir) => api.moveFiles(sourcePaths, targetDir),
|
|
21
|
+
getFileInfo: (filePath) => api.getFileInfo(filePath),
|
|
22
|
+
readImageAsBase64: (imagePath) => api.readImageAsBase64(imagePath),
|
|
23
|
+
openPath: (filePath) => api.openPath(filePath),
|
|
24
|
+
getApplicationIcon: (appPath) => api.getApplicationIcon(appPath),
|
|
25
|
+
getThumbnailUrl: (filePath) => api.getThumbnailUrl(filePath),
|
|
26
|
+
copyFilesToClipboard: (filePaths) => api.copyFilesToClipboard(filePaths),
|
|
27
|
+
getClipboardFiles: () => api.getClipboardFiles(),
|
|
28
|
+
pasteFiles: (targetDir, sourcePaths) => api.pasteFiles(targetDir, sourcePaths),
|
|
29
|
+
searchFiles: (searchPath, pattern, maxDepth) => api.searchFiles(searchPath, pattern, maxDepth),
|
|
30
|
+
searchFilesStream: (searchPath, pattern, searchId) => api.searchFilesStream(searchPath, pattern, searchId),
|
|
31
|
+
onSearchResults: (callback) => api.onSearchResults(callback)
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
createElectronAdapter
|
|
36
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@huyooo/file-explorer-bridge-electron",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "File Explorer Electron Bridge - IPC integration for Electron apps",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/main/index.cjs",
|
|
7
|
+
"module": "./dist/main/index.js",
|
|
8
|
+
"types": "./dist/main/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
"./main": {
|
|
11
|
+
"types": "./dist/main/index.d.ts",
|
|
12
|
+
"development": "./src/main/index.ts",
|
|
13
|
+
"import": "./dist/main/index.js",
|
|
14
|
+
"require": "./dist/main/index.cjs"
|
|
15
|
+
},
|
|
16
|
+
"./preload": {
|
|
17
|
+
"types": "./dist/preload/index.d.ts",
|
|
18
|
+
"development": "./src/preload/index.ts",
|
|
19
|
+
"import": "./dist/preload/index.js",
|
|
20
|
+
"require": "./dist/preload/index.cjs"
|
|
21
|
+
},
|
|
22
|
+
"./renderer": {
|
|
23
|
+
"types": "./dist/renderer/index.d.ts",
|
|
24
|
+
"development": "./src/renderer/index.ts",
|
|
25
|
+
"import": "./dist/renderer/index.js",
|
|
26
|
+
"require": "./dist/renderer/index.cjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist"
|
|
31
|
+
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"dev": "tsup --watch",
|
|
35
|
+
"typecheck": "tsc --noEmit",
|
|
36
|
+
"clean": "rm -rf dist"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@huyooo/file-explorer-core": "^0.2.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"electron": ">=20.0.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/better-sqlite3": "^7.6.0",
|
|
46
|
+
"@types/node": "^22.0.0",
|
|
47
|
+
"electron": "^33.0.0",
|
|
48
|
+
"tsup": "^8.0.0",
|
|
49
|
+
"typescript": "^5.0.0"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"file",
|
|
53
|
+
"explorer",
|
|
54
|
+
"electron",
|
|
55
|
+
"ipc",
|
|
56
|
+
"bridge"
|
|
57
|
+
],
|
|
58
|
+
"author": "huyooo",
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
}
|
|
63
|
+
}
|