- Now periodic internal file scanning works well.
- The handler of Window-visibility-changed has been fixed.
- And minor fixes possibly included.
Refactored:
- Unused logic has been removed.
- Some utility functions have been moved into suitable files.
- Function names have been renamed.
This commit is contained in:
vorotamoroz
2023-03-17 17:48:24 +09:00
parent 6b7956ab67
commit 9efb6ed0c1
12 changed files with 464 additions and 423 deletions
+26 -2
View File
@@ -1,4 +1,4 @@
import { PluginManifest, TFile } from "obsidian";
import { PluginManifest, TFile } from "./deps";
import { DatabaseEntry, EntryBody } from "./lib/src/types";
export interface PluginDataEntry extends DatabaseEntry {
@@ -46,4 +46,28 @@ export type queueItem = {
timeout?: number;
done?: boolean;
warned?: boolean;
};
};
export type CacheData = string | ArrayBuffer;
export type FileEventType = "CREATE" | "DELETE" | "CHANGED" | "RENAME" | "INTERNAL";
export type FileEventArgs = {
file: FileInfo | InternalFileInfo;
cache?: CacheData;
oldPath?: string;
ctx?: any;
}
export type FileEventItem = {
type: FileEventType,
args: FileEventArgs,
key: string,
}
export const CHeader = "h:";
export const PSCHeader = "ps:";
export const PSCHeaderEnd = "ps;";
export const ICHeader = "i:";
export const ICHeaderEnd = "i;";
export const ICHeaderLength = ICHeader.length;
export const FileWatchEventQueueMax = 10;
export const configURIBase = "obsidian://setuplivesync?settings=";