ocoge/preload.js

23 lines
848 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const electron = require("electron")
const path = require('path')
// const tf = require('@tensorflow/tfjs-node')
electron.contextBridge.exposeInMainWorld(
"ocogeapi",
{
// Electron固有index.htmlから直接 <script src で呼ばれたJSファイルでのみ利用可
electron_ipcRenderer: electron.ipcRenderer,
electron_shell: electron.shell,
// どこからでも呼び出し可
fs: require('fs'),
path: path,
child_process: require('child_process'),
tfjs_node: require('@tensorflow/tfjs-node'),
// tfjs_node: tf,
// face_api: require('@vladmandic/face-api/dist/face-api.node.js'),
lgpio: require('@ocogeclub/lgpio'),
bme280: require('@ocogeclub/bme280'),
// グローバル変数
gtest: 'qwerty' // テスト用
}
);