-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from FIBOSIO/dev
Dev
- Loading branch information
Showing
15 changed files
with
1,949 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule fibjs
updated
23 files
+20 −16 | fibjs/fibjs.vcxproj | |
+1 −0 | fibjs/src/base/v8_api.cpp | |
+9 −6 | fibjs/src/net/net.cpp | |
+1 −1 | fibjs/src/os/os_win.cpp | |
+20 −4 | fibjs/src/sandbox/loaders/ts_loader.cpp | |
+38 −0 | test/dns_test.js | |
+3 −0 | test/main.js | |
+5 −0 | test/net_test.js | |
+1 −0 | test/os_test.js | |
+2 −2 | test/ts_files/_4_sandbox.ts | |
+15 −0 | test/ts_files/class.ts | |
+5 −0 | test/ts_files/wrong_syntax1.1.ts | |
+5 −0 | test/ts_files/wrong_syntax1.2.ts | |
+5 −0 | test/ts_files/wrong_syntax1.3.ts | |
+9 −0 | test/ts_files/wrong_syntax1.4.ts | |
+9 −0 | test/ts_files/wrong_syntax2.ts | |
+51 −5 | test/ts_test.js | |
+24 −5 | test/ts_test.ts | |
+6 −3 | tools/idlc.js | |
+20 −16 | tools/tpls/proj.txt | |
+16 −0 | tools/tsdeclare.js | |
+225 −0 | tools/util/gen_ts_type.js | |
+145 −0 | tools/util/tmpl/type.d.ts.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/*! @brief | ||
multi index DBIterator 对象 | ||
*/ | ||
|
||
interface DBIterator : object | ||
{ | ||
/*! @brief 判断数据是否为首数据 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players(action.account, action.account); | ||
var itr = players.find(v); | ||
console.log(itr.is_begin()); | ||
}; | ||
``` | ||
*/ | ||
Boolean is_begin(); | ||
|
||
/*! @brief 判断数据是否为尾数据 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players(action.account, action.account); | ||
var itr = players.find(v); | ||
console.log(itr.is_end()); | ||
}; | ||
``` | ||
*/ | ||
Boolean is_end(); | ||
|
||
/*! @brief 获取下一个数据 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players(action.account, action.account); | ||
var itr = players.find(v); | ||
var itr1 = itr.next(); | ||
console.log(itr1.toJSON()); | ||
}; | ||
``` | ||
*/ | ||
DBIterator next(); | ||
|
||
/*! @brief 获取上一个数据 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players(action.account, action.account); | ||
var itr = players.find(v); | ||
var itr1 = itr.next(); | ||
var itr2 = itr1.previous(); | ||
console.log(itr2.toJSON()); | ||
}; | ||
``` | ||
*/ | ||
DBIterator previous(); | ||
|
||
/*! @brief 删除数据 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players(action.account, action.account); | ||
var itr = players.find(v); | ||
itr.remove(); | ||
}; | ||
``` | ||
*/ | ||
remove(); | ||
|
||
/*! @brief 更新数据 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players(action.account, action.account); | ||
var itr = players.find(v); | ||
itr.data.age = 18; | ||
itr.update(action.account); | ||
}; | ||
``` | ||
@param payer 为此次操作支付 RAM 的账户 | ||
*/ | ||
update(String payer); | ||
|
||
/*! @brief 查询当前数据,返回所有数据对象,每个数据是一个新的 DBIterator 对象 */ | ||
readonly Object data; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
/*! @brief | ||
multi index table 对象 | ||
*/ | ||
|
||
interface Table : object | ||
{ | ||
/*! @brief table 名 | ||
*/ | ||
readonly String name; | ||
|
||
/*! @brief 指向合约发布者的名称 | ||
*/ | ||
readonly String code; | ||
|
||
/*! @brief table 中数据所属的 account_name | ||
*/ | ||
readonly String scope; | ||
|
||
/*! @brief 向 table 存入新数据 | ||
实例: | ||
```JavaScript | ||
exports.hi = v => { | ||
var players = db.players(action.account, action.account); | ||
players.emplace(action.account, { | ||
title: "ceo", | ||
age:48, | ||
nickname:"lion1", | ||
id:123 | ||
}); | ||
}; | ||
``` | ||
@param payer 为此次操作付费的账户 | ||
@param val 将要存入到 table 的值 | ||
*/ | ||
emplace(String payer, Object val); | ||
|
||
/*! @brief 从 table 查找数据 | ||
实例: | ||
```JavaScript | ||
exports.hi = v => { | ||
var players = db.players(action.account, action.account); | ||
console.log(players.find(v).data) | ||
}; | ||
``` | ||
@param id 查询的参数 | ||
*/ | ||
DBIterator find(Value id); | ||
|
||
/*! @brief 生成自增主键 | ||
实例: | ||
```JavaScript | ||
exports.hi = v => { | ||
var players = db.players(action.account, action.account); | ||
console.log(players.get_primary_key()) | ||
}; | ||
``` | ||
*/ | ||
Value get_primary_key(); | ||
|
||
/*! @brief 获取 Table 的 begin | ||
实例: | ||
```JavaScript | ||
exports.hi = v => { | ||
var players = db.players(action.account, action.account); | ||
console.log(players.begin()) | ||
}; | ||
``` | ||
*/ | ||
DBIterator begin(); | ||
|
||
/*! @brief 获取 Table 的 end | ||
实例: | ||
```JavaScript | ||
exports.hi = v => { | ||
var players = db.players(action.account, action.account); | ||
console.log(players.end().is_end(), players.end().previous().data); | ||
}; | ||
``` | ||
*/ | ||
DBIterator end(); | ||
|
||
/*! @brief 从 table 查找小于参数结果 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players1(action.account, action.account); | ||
var data = players.lowerbound(123); | ||
console.log(data.data, data1.data); | ||
}; | ||
``` | ||
@param id 查询的参数 | ||
*/ | ||
DBIterator lowerbound(Value id); | ||
|
||
/*! @brief 从 table 查找大于参数结果 | ||
实例: | ||
```JavaScript | ||
exports.hi1 = v => { | ||
var players = db.players1(action.account, action.account); | ||
var data1 = players.upperbound(123); | ||
console.log(data.data, data1.data); | ||
}; | ||
``` | ||
@param id 查询的参数 | ||
*/ | ||
DBIterator upperbound(Value id); | ||
|
||
/*! @brief 查询当前索引,返回所有索引对象,每个索引是一个新的 Table 对象 */ | ||
readonly Object indexes; | ||
}; |
Oops, something went wrong.