mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-05-07 08:11:50 +00:00
Preparing v0.24.0
This commit is contained in:
48
src/modules/interfaces/StorageAccess.ts
Normal file
48
src/modules/interfaces/StorageAccess.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { FilePath, FilePathWithPrefix, UXDataWriteOptions, UXFileInfo, UXFileInfoStub, UXFolderInfo, UXStat } from "../../lib/src/common/types"
|
||||
|
||||
export interface StorageAccess {
|
||||
|
||||
deleteVaultItem(file: FilePathWithPrefix | UXFileInfoStub | UXFolderInfo): Promise<void>
|
||||
|
||||
writeFileAuto(path: string, data: string | ArrayBuffer, opt?: UXDataWriteOptions): Promise<boolean>
|
||||
|
||||
readFileAuto(path: string): Promise<string | ArrayBuffer>
|
||||
readFileText(path: string): Promise<string>
|
||||
isExists(path: string): Promise<boolean>
|
||||
writeHiddenFileAuto(path: string, data: string | ArrayBuffer, opt?: UXDataWriteOptions): Promise<boolean>
|
||||
appendHiddenFile(path: string, data: string, opt?: UXDataWriteOptions): Promise<boolean>
|
||||
|
||||
stat(path: string): Promise<UXStat | null>
|
||||
statHidden(path: string): Promise<UXStat | null>
|
||||
removeHidden(path: string): Promise<boolean>
|
||||
readHiddenFileAuto(path: string): Promise<string | ArrayBuffer>
|
||||
readHiddenFileBinary(path: string): Promise<ArrayBuffer>
|
||||
readHiddenFileText(path: string): Promise<string>
|
||||
isExistsIncludeHidden(path: string): Promise<boolean>
|
||||
// This could be work also for the hidden files.
|
||||
ensureDir(path: string): Promise<boolean>
|
||||
triggerFileEvent(event: string, path: string): void
|
||||
triggerHiddenFile(path: string): Promise<void>
|
||||
|
||||
getFileStub(path: string): UXFileInfoStub | null
|
||||
readStubContent(stub: UXFileInfoStub): Promise<UXFileInfo | false>;
|
||||
getStub(path: string): UXFileInfoStub | UXFolderInfo | null
|
||||
|
||||
getFiles(): UXFileInfoStub[]
|
||||
getFileNames(): FilePathWithPrefix[]
|
||||
|
||||
touched(file: UXFileInfoStub | FilePathWithPrefix): void
|
||||
recentlyTouched(file: UXFileInfoStub | FilePathWithPrefix): boolean
|
||||
clearTouched(): void
|
||||
|
||||
// -- Low-Level
|
||||
delete(file: FilePathWithPrefix | UXFileInfoStub | string, force: boolean): Promise<void>
|
||||
trash(file: FilePathWithPrefix | UXFileInfoStub | string, system: boolean): Promise<void>
|
||||
|
||||
getFilesIncludeHidden(
|
||||
basePath: string,
|
||||
includeFilter?: RegExp[],
|
||||
excludeFilter?: RegExp[],
|
||||
skipFolder?: string[]
|
||||
): Promise<FilePath[]>;
|
||||
}
|
||||
Reference in New Issue
Block a user