diff --git a/index.ts b/index.ts index b814403f..2657e993 100644 --- a/index.ts +++ b/index.ts @@ -1,6 +1,8 @@ -import { Addon } from "./src/addon-wrapper"; -import { QueueManager } from "./src/queue/queue-manager"; -import { QueueItem, typeQueue, HandleAction, HandleActions } from "./src/queue/queueManager"; -import VirtualDrive from "./src/virtual-drive"; +import { Addon } from "@/addon-wrapper"; +import { QueueManager } from "@/queue/queue-manager"; +import { QueueItem, typeQueue, HandleAction, HandleActions } from "@/queue/queueManager"; +import { Callbacks } from "@/types/callbacks.type"; +import { PinState, SyncState } from "@/types/placeholder.type"; +import VirtualDrive from "@/virtual-drive"; -export { Addon, VirtualDrive, QueueItem, typeQueue, HandleAction, HandleActions, QueueManager }; +export { Addon, VirtualDrive, QueueItem, typeQueue, HandleAction, HandleActions, QueueManager, Callbacks, PinState, SyncState }; diff --git a/src/addon-wrapper.ts b/src/addon-wrapper.ts index 2220599b..5e39f33a 100644 --- a/src/addon-wrapper.ts +++ b/src/addon-wrapper.ts @@ -137,9 +137,4 @@ export class Addon { const result = await addon.hydrateFile(path); return this.parseAddonZod("hydrateFile", result); } - - getPlaceholderAttribute({ path }: { path: string }) { - const result = addon.getPlaceholderAttribute(path); - return this.parseAddonZod("getPlaceholderAttribute", result); - } } diff --git a/src/addon.ts b/src/addon.ts index 2663ab83..0faf0632 100644 --- a/src/addon.ts +++ b/src/addon.ts @@ -29,7 +29,6 @@ export type TAddon = { path: string, ): any; hydrateFile(path: string): Promise>; - getPlaceholderAttribute(path: string): z.infer; dehydrateFile(path: string): z.infer; connectSyncRoot(path: string, callbacks: InputSyncCallbacks): z.infer; convertToPlaceholder(path: string, id: string): z.infer; diff --git a/src/addon/addon-zod.ts b/src/addon/addon-zod.ts index 3ef93aca..f8ffbbc9 100644 --- a/src/addon/addon-zod.ts +++ b/src/addon/addon-zod.ts @@ -8,11 +8,6 @@ export const addonZod = { convertToPlaceholder: z.boolean(), dehydrateFile: z.boolean(), getFileIdentity: z.string(), - getPlaceholderAttribute: z.object({ attribute: z.union([z.literal(0), z.literal(1), z.literal(2)]) }).transform(({ attribute }) => { - if (attribute === 1) return "NOT_PINNED"; - if (attribute === 2) return "PINNED"; - return "OTHER"; - }), getPlaceholderState: z.object({ pinState: z.nativeEnum(PinState), syncState: z.nativeEnum(SyncState) }), getPlaceholderWithStatePending: z.array(z.string()), hydrateFile: z.undefined(), diff --git a/src/virtual-drive.ts b/src/virtual-drive.ts index c806346c..a5810212 100644 --- a/src/virtual-drive.ts +++ b/src/virtual-drive.ts @@ -410,10 +410,6 @@ class VirtualDrive { async hydrateFile(itemPath: string): Promise { return addon.hydrateFile({ path: this.fixPath(itemPath) }); } - - getPlaceholderAttribute(itemPath: string) { - return addon.getPlaceholderAttribute({ path: this.fixPath(itemPath) }); - } } export default VirtualDrive; diff --git a/src/watcher/detect-context-menu-action.service.ts b/src/watcher/detect-context-menu-action.service.ts index b50420ef..3b22d2d1 100644 --- a/src/watcher/detect-context-menu-action.service.ts +++ b/src/watcher/detect-context-menu-action.service.ts @@ -10,7 +10,6 @@ export class DetectContextMenuActionService { const { prev, curr } = details; const status = self.addon.getPlaceholderState({ path }); - const attribute = self.addon.getPlaceholderAttribute({ path }); const itemId = self.addon.getFileIdentity({ path }); const isInDevice = self.fileInDevice.has(path); @@ -18,7 +17,6 @@ export class DetectContextMenuActionService { event: "onRaw", path, status, - attribute, itemId, isInDevice, prev: {