-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.js
More file actions
52 lines (40 loc) · 1.3 KB
/
model.js
File metadata and controls
52 lines (40 loc) · 1.3 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Model interface.
var EventEmitter = require('events').EventEmitter;
var inherits = require('inherits');
inherits(Model, EventEmitter);
module.exports = Model;
function Model() {
EventEmitter.call(this);
}
// Returns true iff this value is paused, in which case local mutations are
// disallowed.
Model.prototype.paused = function() {
throw new Error('not implemented');
};
Model.prototype.getText = function() {
throw new Error('not implemented');
};
Model.prototype.getSelectionRange = function() {
throw new Error('not implemented');
};
Model.prototype.insertText = function(pos, value) {
return this.replaceText(pos, 0, value);
};
Model.prototype.deleteText = function(pos, len) {
return this.replaceText(pos, len, '');
};
// Replaces text.substr(pos, len) with the given value and updates the selection
// range accordingly. Assumes line breaks have been canonicalized to \n.
Model.prototype.replaceText = function(pos, len, value) {
throw new Error('not implemented');
};
// Updates the selection range to the half-closed interval [start, end).
Model.prototype.setSelectionRange = function(start, end) {
throw new Error('not implemented');
};
Model.prototype.undo = function() {
throw new Error('not implemented');
};
Model.prototype.redo = function() {
throw new Error('not implemented');
};