| 6 | * Represents a source of files and content |
| 7 | */ |
| 8 | export interface IDataStore { |
| 9 | /** |
| 10 | * List the URIs known to this store. |
| 11 | * |
| 12 | * With no argument, returns the full set of URIs the store can see (the |
| 13 | * usual workspace enumeration). |
| 14 | * |
| 15 | * When a workspace-relative glob `pattern` is passed, the store **must** |
| 16 | * return only URIs matching that glob. |
| 17 | */ |
| 18 | list: (pattern?: string) => Promise<URI[]>; |
| 19 | |
| 20 | /** |
| 21 | * Read the content of the file from the store |
| 22 | * |
| 23 | * Returns `null` in case of errors while reading |
| 24 | */ |
| 25 | read: (uri: URI) => Promise<string | null>; |
| 26 | |
| 27 | /** |
| 28 | * Write content to the file. Creates parent directories as needed. |
| 29 | * Overwrites existing files. |
| 30 | */ |
| 31 | write: (uri: URI, content: string) => Promise<void>; |
| 32 | |
| 33 | /** |
| 34 | * Delete the file at the given URI. No-op if it doesn't exist. |
| 35 | */ |
| 36 | delete: (uri: URI) => Promise<void>; |
| 37 | |
| 38 | /** |
| 39 | * Move (rename) a file from one URI to another. Creates destination |
| 40 | * parent directories as needed. Atomic where the underlying filesystem |
| 41 | * supports it. |
| 42 | */ |
| 43 | move: (from: URI, to: URI) => Promise<void>; |
| 44 | |
| 45 | /** |
| 46 | * Returns true if the file exists at the given URI. |
| 47 | */ |
| 48 | exists: (uri: URI) => Promise<boolean>; |
| 49 | } |
| 50 | |
| 51 | export interface IWatcher { |
| 52 | onDidChange: Event<URI>; |
nothing calls this directly
no outgoing calls
no test coverage detected