summaryrefslogtreecommitdiff
path: root/src/preload/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/preload/index.ts')
-rw-r--r--src/preload/index.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/preload/index.ts b/src/preload/index.ts
index 116e8e2..1b8ebce 100644
--- a/src/preload/index.ts
+++ b/src/preload/index.ts
@@ -177,6 +177,13 @@ const api = {
ipcRenderer.invoke('overleaf:removeProjectsFromTag', tagId, projectIds) as Promise<{ success: boolean; message?: string }>,
overleafSetProjectState: (projectId: string, action: 'archive' | 'unarchive' | 'trash' | 'untrash' | 'delete' | 'leave') =>
ipcRenderer.invoke('overleaf:setProjectState', projectId, action) as Promise<{ success: boolean; message?: string }>,
+ overleafSetRootDoc: (projectId: string, docId: string) =>
+ ipcRenderer.invoke('overleaf:setRootDoc', projectId, docId) as Promise<{ success: boolean; message?: string }>,
+ onProjectRootDocUpdated: (cb: (docId: string) => void) => {
+ const handler = (_e: Electron.IpcRendererEvent, docId: string) => cb(docId)
+ ipcRenderer.on('project:rootDocUpdated', handler)
+ return () => { ipcRenderer.removeListener('project:rootDocUpdated', handler) }
+ },
overleafRenameProject: (projectId: string, newName: string) =>
ipcRenderer.invoke('overleaf:renameProject', projectId, newName) as Promise<{ success: boolean; message?: string }>,
overleafCloneProject: (projectId: string, projectName: string, tags?: string[]) =>