mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2026-01-21 03:51:15 -08:00
19 lines
651 B
JavaScript
19 lines
651 B
JavaScript
// @flow
|
|
/**
|
|
* Provide API from electron to tiddlywiki
|
|
* This file should be required by BrowserView's preload script to work
|
|
*/
|
|
const { contextBridge } = require('electron');
|
|
const { getModifiedFileList } = require('./inspect');
|
|
const { commitAndSync } = require('./sync');
|
|
const { getWorkspacesAsList } = require('../workspaces');
|
|
const { getPreference } = require('../preferences');
|
|
|
|
contextBridge.exposeInMainWorld('git', {
|
|
getModifiedFileList,
|
|
commitAndSync: (wikiPath, githubRepoUrl) => {
|
|
const userInfo = getPreference('github-user-info');
|
|
return commitAndSync(wikiPath, githubRepoUrl, userInfo);
|
|
},
|
|
getWorkspacesAsList,
|
|
});
|