hedera-web/js/vn/model-proxy.js

81 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-05-30 01:30:33 +00:00
var ModelIface = require('./object');
/**
* Monitorizes all changes made to a model.
*/
var Klass = new Class();
module.exports = Klass;
var Mode = {
ON_CHANGE : 1
,ON_DEMAND : 2
};
var Operation = {
INSERT : 1 << 1
,UPDATE : 1 << 2
,DELETE : 1 << 3
};
Klass.extend({
Mode: Mode
,Operation: Operation
});
Klass.implement({
Implements: ModelIface
,Properties: {
/**
* Update mode.
*/
mode: {
enumType: Mode
,value: Mode.ON_CHANGE
}
}
/**
* Updates a value on the model.
*
* @param {number} rowIndex The row index
* @param {string} columnName The column name
* @param {*} value The new value
*/
2022-11-16 01:46:44 +00:00
,set() {}
2022-05-30 01:30:33 +00:00
/**
* Updates a value on the model using the column index.
*
* @param {number} rowIndex The row index
* @param {number} col The column index
* @param {*} value The new value
*/
2022-11-16 01:46:44 +00:00
,setByIndex() {}
2022-05-30 01:30:33 +00:00
/**
* Deletes a row from the model.
*
* @param {number} rowIndex The row index
*/
2022-11-16 01:46:44 +00:00
,deleteRow() {}
2022-05-30 01:30:33 +00:00
/**
* Inserts a new row on the model.
*
* @return The index of the inserted row
*/
2022-11-16 01:46:44 +00:00
,insertRow() {}
2022-05-30 01:30:33 +00:00
/**
* Cleans the model data.
*/
2022-11-16 01:46:44 +00:00
,clean() {}
2022-05-30 01:30:33 +00:00
/**
* Performs all model changes on the database.
*/
2022-11-16 01:46:44 +00:00
,performOperations() {}
2022-05-30 01:30:33 +00:00
});