Cotal TypeScript packages
    Preparing search index...

    Function writePreference

    • Set (value a string) or clear (value undefined) one key in one scope, and report whether the file changed. The write holds the preferences lock, refuses with CONFLICT when the file is no longer at expectedRevision, and replaces the file atomically, so a concurrent edit is never lost. A folder another local account could write refuses it with PERMISSION_DENIED before anything is written (see assertPreferencesFolderProtected). The new file is private (0600); replacedMode is the old file's mode when it was another, such as a read-only 0400, so the caller can say the mode changed.

      Parameters

      • scope: PreferenceScope
      • key: string
      • value: string | undefined
      • expectedRevision: number

      Returns { changed: boolean; replacedMode?: number; revision: number }