-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaddon.ts
More file actions
58 lines (55 loc) · 2.13 KB
/
addon.ts
File metadata and controls
58 lines (55 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { z } from "zod";
import { addonZod } from "./addon/addon-zod";
import { InputSyncCallbacks } from "./types/callbacks.type";
// eslint-disable-next-line @typescript-eslint/no-require-imports
export const addon: TAddon = require("../addon.node");
export type TAddon = {
addLoggerPath(path: string): z.infer<typeof addonZod.addLoggerPath>;
createPlaceholderFile(
fileName: string,
fileId: string,
fileSize: number,
fileAttributes: number,
creationTime: string,
lastWriteTime: string,
lastAccessTime: string,
path: string,
): any;
createEntry(
itemName: string,
itemId: string,
isDirectory: boolean,
itemSize: number,
fileAttributes: number,
creationTime: string,
lastWriteTime: string,
lastAccessTime: string,
path: string,
): any;
hydrateFile(path: string): Promise<z.infer<typeof addonZod.hydrateFile>>;
dehydrateFile(path: string): z.infer<typeof addonZod.dehydrateFile>;
connectSyncRoot(path: string, callbacks: InputSyncCallbacks): z.infer<typeof addonZod.connectSyncRoot>;
convertToPlaceholder(path: string, id: string): z.infer<typeof addonZod.convertToPlaceholder>;
deleteFileSyncRoot(path: string): any;
getFileIdentity(path: string): z.infer<typeof addonZod.getFileIdentity>;
/**
* TODO: Not all paths return value
*/
disconnectSyncRoot(path: string): unknown;
getPlaceholderState(path: string): z.infer<typeof addonZod.getPlaceholderState>;
getPlaceholderWithStatePending(path: string): z.infer<typeof addonZod.getPlaceholderWithStatePending>;
registerSyncRoot(
providerName: string,
providerVersion: string,
providerId: string,
callbacks: any,
logoPath: string,
): z.infer<typeof addonZod.registerSyncRoot>;
unregisterSyncRoot(path: string): z.infer<typeof addonZod.unregisterSyncRoot>;
updateSyncStatus(path: string, sync: boolean, isDirectory: boolean): z.infer<typeof addonZod.updateSyncStatus>;
/**
* TODO: Returns a type in c++ that is not initialized
*/
updateFileIdentity(itemPath: string, id: string, isDirectory: boolean): any;
getRegisteredSyncRoots(): z.infer<typeof addonZod.getRegisteredSyncRoots>;
};