-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.js
executable file
·34 lines (28 loc) · 960 Bytes
/
base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class VFSNode {
get url () { return false }
get type () { return 'node' }
get name () { return '' }
get size () { return 0 }
get mtime () { return 0 }
get isEditable () { return false }
get isContainer () { return false } // is folder-like?
get isEmpty () { return true }
get hasChildren () { return !this.isEmpty }
get children () { return [] }
// load any data needed to display the node in the sidebar or in the expanded state
async readData () {}
// used internally during diffs to copy state from the given node
copyDataFrom (node) {}
// sort the items according to the given params
sort(column, dir) {}
// mutators
async rename (newName) {}
async copy (newPath, targetVaultKey) {}
async move (newPath, targetVaultKey) {}
async delete () {}
}
class VFSystemContainer extends VFSNode {
get type () { return 'container' }
get isContainer () { return true }
}
module.exports = {VFSNode, VFSystemContainer}