Options
All
  • Public
  • Public/Protected
  • All
Menu

Module renderer/services/document

Index

Functions

createCurrentDocChecker

  • createCurrentDocChecker(): { changed: () => boolean; check: () => boolean; throwErrorIfChanged: () => void }
  • Create a checker to check if a document is current activated document.

    Returns { changed: () => boolean; check: () => boolean; throwErrorIfChanged: () => void }

    • changed: () => boolean
        • (): boolean
        • Returns boolean

    • check: () => boolean
        • (): boolean
        • Returns boolean

    • throwErrorIfChanged: () => void
        • (): void
        • Returns 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>
  • Create a dir.

    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>
  • Create a document.

    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>
  • Delete a document.

    Parameters

    • doc: Doc
    • skipConfirm: boolean = false

    Returns Promise<void>

duplicateDoc

  • duplicateDoc(originDoc: Doc, newPath?: string): Promise<void>
  • Duplicate a document.

    Parameters

    • originDoc: Doc
    • Optional newPath: string

    Returns Promise<void>

ensureCurrentFileSaved

  • ensureCurrentFileSaved(): Promise<void>
  • Ensure current document is saved.

    Returns Promise<void>

getAbsolutePath

  • getAbsolutePath(doc: Doc): string
  • Get absolutePath of document

    Parameters

    Returns string

getMarkedFiles

  • Returns FileItem[]

hideHistory

  • hideHistory(): void
  • hide history panel

    Returns void

isEncrypted

  • isEncrypted(doc?: null | Pick<Doc, "path" | "type">): boolean
  • Determine if the document is encrypted.

    Parameters

    • Optional doc: null | Pick<Doc, "path" | "type">

    Returns boolean

isMarkdownFile

  • isMarkdownFile(doc: Doc): boolean
  • Check if the document is a markdown file.

    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
  • Check if the document is out of a repository.

    Parameters

    • Optional doc: null | Doc

    Returns boolean

isSameFile

  • isSameFile(docA?: null | Doc, docB?: null | Doc): undefined | null | boolean
  • Determine if it is the same document.

    Parameters

    • Optional docA: null | Doc
    • Optional docB: null | Doc

    Returns undefined | null | boolean

isSameRepo

  • isSameRepo(docA?: null | Doc, docB?: null | Doc): undefined | null | boolean
  • Determine if it is in the same repository.

    Parameters

    • Optional docA: null | Doc
    • Optional docB: null | Doc

    Returns undefined | null | boolean

isSubOrSameFile

  • isSubOrSameFile(docA?: null | Doc, docB?: null | Doc): undefined | null | boolean
  • Determine whether document B is the same as document A or a subordinate to directory A.

    Parameters

    • Optional docA: null | Doc
    • Optional docB: null | Doc

    Returns undefined | null | boolean

markDoc

  • markDoc(doc: Doc): Promise<void>
  • Mark document.

    Parameters

    Returns Promise<void>

moveDoc

  • moveDoc(doc: Doc, newPath?: string): Promise<void>
  • Move or rename a document.

    Parameters

    • doc: Doc
    • Optional newPath: string

    Returns Promise<void>

openInOS

  • openInOS(doc: Doc, reveal?: boolean): Promise<void>
  • Open in OS.

    Parameters

    • doc: Doc
    • Optional reveal: boolean

    Returns Promise<void>

saveDoc

  • saveDoc(doc: Doc, content: string): Promise<void>
  • Save a document.

    Parameters

    • doc: Doc
    • content: string

    Returns Promise<void>

showHelp

  • showHelp(docName: string): Promise<void>
  • Show help file.

    Parameters

    • docName: string

    Returns Promise<void>

showHistory

  • showHistory(doc: Doc): void
  • show history versions of document

    Parameters

    Returns void

switchDoc

  • switchDoc(doc: null | Doc, force?: boolean): Promise<void>
  • Switch document.

    Parameters

    • doc: null | Doc
    • force: boolean = false

    Returns Promise<void>

switchDocByPath

  • switchDocByPath(path: string): Promise<void>
  • Parameters

    • path: string

    Returns Promise<void>

toUri

  • toUri(doc?: null | Doc): string
  • Get file URI.

    Parameters

    • Optional doc: null | Doc

    Returns string

unmarkDoc

  • unmarkDoc(doc: Doc): Promise<void>
  • Unmark document.

    Parameters

    Returns Promise<void>

Generated using TypeDoc