Module renderer/services/document
Functions
createCurrentDocChecker
- createCurrentDocChecker(): { changed: () => boolean; check: () => boolean; throwErrorIfChanged: () => void }
Returns { changed: () => boolean; check: () => boolean; throwErrorIfChanged: () => void }
changed: () => boolean
check: () => boolean
throwErrorIfChanged: () => void
createDir
- createDir(doc: Pick<Doc, "content" | "repo" | "path">, baseDoc: Doc): Promise<Doc>
- createDir(doc: Optional<Pick<Doc, "content" | "repo" | "path">, "path">, baseDoc?: Doc): Promise<Doc>
Parameters
doc: Pick<Doc, "content" | "repo" | "path">
baseDoc: Doc
Returns Promise<Doc>
Parameters
doc: Optional<Pick<Doc, "content" | "repo" | "path">, "path">
Optional baseDoc: Doc
Returns Promise<Doc>
createDoc
- createDoc(doc: Pick<Doc, "content" | "repo" | "path">, baseDoc: Doc): Promise<Doc>
- createDoc(doc: Optional<Pick<Doc, "content" | "repo" | "path">, "path">, baseDoc?: Doc): Promise<Doc>
Parameters
doc: Pick<Doc, "content" | "repo" | "path">
baseDoc: Doc
Returns Promise<Doc>
Parameters
doc: Optional<Pick<Doc, "content" | "repo" | "path">, "path">
Optional baseDoc: Doc
Returns Promise<Doc>
deleteDoc
- deleteDoc(doc: Doc, skipConfirm?: boolean): Promise<void>
Parameters
skipConfirm: boolean = false
Returns Promise<void>
duplicateDoc
- duplicateDoc(originDoc: Doc, newPath?: string): Promise<void>
Parameters
originDoc: Doc
Optional newPath: string
Returns Promise<void>
ensureCurrentFileSaved
- ensureCurrentFileSaved(): Promise<void>
Returns Promise<void>
getAbsolutePath
- getAbsolutePath(doc: Doc): string
Parameters
Returns string
getMarkedFiles
hideHistory
Returns void
isEncrypted
- isEncrypted(doc?: null | Pick<Doc, "path" | "type">): boolean
Parameters
Optional doc: null | Pick<Doc, "path" | "type">
Returns boolean
isMarkdownFile
- isMarkdownFile(doc: Doc): boolean
Parameters
Returns boolean
isMarked
- isMarked(doc: PathItem & { type?: "file" | "dir" }): boolean
Parameters
doc: PathItem & { type?: "file" | "dir" }
Returns boolean
isOutOfRepo
- isOutOfRepo(doc?: null | Doc): boolean
Parameters
Returns boolean
isSameFile
- isSameFile(docA?: null | Doc, docB?: null | Doc): undefined | null | boolean
Parameters
Optional docA: null | Doc
Optional docB: null | Doc
Returns undefined | null | boolean
isSameRepo
- isSameRepo(docA?: null | Doc, docB?: null | Doc): undefined | null | boolean
Parameters
Optional docA: null | Doc
Optional docB: null | Doc
Returns undefined | null | boolean
isSubOrSameFile
- isSubOrSameFile(docA?: null | Doc, docB?: null | Doc): undefined | null | boolean
Parameters
Optional docA: null | Doc
Optional docB: null | Doc
Returns undefined | null | boolean
markDoc
- markDoc(doc: Doc): Promise<void>
Parameters
Returns Promise<void>
moveDoc
- moveDoc(doc: Doc, newPath?: string): Promise<void>
Parameters
Returns Promise<void>
openInOS
- openInOS(doc: Doc, reveal?: boolean): Promise<void>
Parameters
Returns Promise<void>
saveDoc
- saveDoc(doc: Doc, content: string): Promise<void>
Parameters
Returns Promise<void>
showHelp
- showHelp(docName: string): Promise<void>
Parameters
Returns Promise<void>
showHistory
- showHistory(doc: Doc): void
Parameters
Returns void
switchDoc
- switchDoc(doc: null | Doc, force?: boolean): Promise<void>
Parameters
doc: null | Doc
force: boolean = false
Returns Promise<void>
switchDocByPath
- switchDocByPath(path: string): Promise<void>
Parameters
Returns Promise<void>
toUri
- toUri(doc?: null | Doc): string
Parameters
Returns string
unmarkDoc
- unmarkDoc(doc: Doc): Promise<void>
Parameters
Returns Promise<void>
Create a checker to check if a document is current activated document.