code/editor/fs-adapter
import { … } from 'zidane-ui/code/editor'ui/src/code/editor/fs-adapter.ts
Interfaces#
FileContentsInterface#
A file's text with the version it was read at.
interface FileContents extends FileVersionProperties
| Name | Type | Description |
|---|---|---|
| contents | string | The file's text. |
versionfrom FileVersion | number | Changes whenever the file does (an mtime, an etag, a content hash); saves compare it to spot conflicts. |
FileSystemAdapterInterface#
The file operations an EditorColumn needs: list, read and write, plus optional change events and conflict checks.
interface FileSystemAdapterProperties
| Name | Type | Description |
|---|---|---|
| list | (dir: string) => Promise<TreeEntry[]> | Every entry under |
| read | (path: string) => Promise<FileContents> | The file's text and current version; rejects when it cannot be read. |
| stat? | (path: string) => Promise<FileVersion | null> | The file's version now; |
| watch? | (listener: (paths: readonly string[]) => void) => () => void | Paths that changed (written, created, removed) from anywhere; returns the unsubscribe. |
| write | (path: string, text: string) => Promise<FileVersion> | Writes |
FileVersionInterface#
A file's version stamp.
interface FileVersionProperties
| Name | Type | Description |
|---|---|---|
| version | number | Changes whenever the file does (an mtime, an etag, a content hash); saves compare it to spot conflicts. |