Add skeleton for file event handling
This commit is contained in:
parent
1420cf104e
commit
8a7cc65e88
6 changed files with 259 additions and 4 deletions
21
plugin/src/events/sync-event-handler.ts
Normal file
21
plugin/src/events/sync-event-handler.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import { TAbstractFile } from "obsidian";
|
||||
import { FileEventHandler } from "./file-event-handler";
|
||||
import { Logger } from "src/logger";
|
||||
|
||||
export class SyncEventHandler implements FileEventHandler {
|
||||
onCreate(path: TAbstractFile) {
|
||||
Logger.getInstance().info(`File created: ${path}`);
|
||||
}
|
||||
|
||||
onDelete(path: TAbstractFile) {
|
||||
Logger.getInstance().info(`File deleted: ${path}`);
|
||||
}
|
||||
|
||||
onRename(path: TAbstractFile, oldPath: string) {
|
||||
Logger.getInstance().info(`File renamed: ${oldPath} -> ${path}`);
|
||||
}
|
||||
|
||||
onModify(path: TAbstractFile) {
|
||||
Logger.getInstance().info(`File modified: ${path}`);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue