xray16 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -6
- package/plugins/transform_luabind_class/transformation/class_declaration.js +15 -4
- package/plugins/transform_luabind_class/transformation/decorators.js +1 -2
- package/plugins/transform_luabind_class/transformation/members/accessors.js +1 -2
- package/plugins/transform_luabind_class/transformation/members/constructor.js +2 -3
- package/plugins/transform_luabind_class/transformation/members/fields.js +2 -3
- package/plugins/transform_luabind_class/transformation/members/method.js +4 -5
- package/plugins/transform_luabind_class/transformation/new.js +1 -2
- package/plugins/transform_luabind_class/transformation/setup.js +2 -3
- package/plugins/transform_luabind_class/transformation/super.js +4 -5
- package/plugins/transform_luabind_class/transformation/utils.js +7 -8
- package/plugins/utils/diagnostics.js +2 -3
- package/types/xr_object/script/xr_script_interface.d.ts +210 -33
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xray16",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"author": "Neloreck",
|
|
5
5
|
"repository": "https://github.com/stalker-xrts/xray-16-types",
|
|
6
6
|
"private": false,
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"lint": "eslint . --ext .ts,.tsx,.js"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"typescript-to-lua": "1.
|
|
19
|
+
"typescript-to-lua": "^1.28.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/node": "
|
|
22
|
+
"@types/node": "22.10.2",
|
|
23
23
|
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
24
24
|
"@typescript-eslint/parser": "^5.54.0",
|
|
25
25
|
"@typescript-to-lua/language-extensions": "1.0.0",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"eslint-plugin-jest": "^27.2.1",
|
|
30
30
|
"eslint-plugin-jsdoc": "^46.8.0",
|
|
31
31
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
32
|
-
"prettier": "^3.
|
|
33
|
-
"typedoc": "^0.
|
|
34
|
-
"typescript": "5.
|
|
32
|
+
"prettier": "^3.4.2",
|
|
33
|
+
"typedoc": "^0.27.5",
|
|
34
|
+
"typescript": "^5.7.2"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"plugins/**/*",
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformLuabindClassDeclaration = void 0;
|
|
4
|
+
exports.transformClassAsExpression = transformClassAsExpression;
|
|
5
|
+
exports.transformClassLikeDeclaration = transformClassLikeDeclaration;
|
|
4
6
|
const typescript_1 = require("typescript");
|
|
5
7
|
const tstl = require("typescript-to-lua");
|
|
6
8
|
const typescript_to_lua_1 = require("typescript-to-lua");
|
|
@@ -37,7 +39,6 @@ function transformClassAsExpression(expression, context) {
|
|
|
37
39
|
context.addPrecedingStatements(statements);
|
|
38
40
|
return name;
|
|
39
41
|
}
|
|
40
|
-
exports.transformClassAsExpression = transformClassAsExpression;
|
|
41
42
|
function transformClassLikeDeclaration(classDeclaration, context, nameOverride) {
|
|
42
43
|
let className;
|
|
43
44
|
if (nameOverride !== undefined) {
|
|
@@ -101,7 +102,7 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
|
|
|
101
102
|
for (const member of classDeclaration.members) {
|
|
102
103
|
if (!(0, typescript_1.isAccessor)(member))
|
|
103
104
|
continue;
|
|
104
|
-
const accessors =
|
|
105
|
+
const accessors = getAllAccessorDeclarations(classDeclaration);
|
|
105
106
|
if (accessors.firstAccessor !== member)
|
|
106
107
|
continue;
|
|
107
108
|
const accessorsResult = (0, accessors_1.transformAccessorDeclarations)(context, accessors, localClassName);
|
|
@@ -144,4 +145,14 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
|
|
|
144
145
|
context.classSuperInfos.pop();
|
|
145
146
|
return { statements: result, name: className };
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
+
function getAllAccessorDeclarations(classDeclaration) {
|
|
149
|
+
const getAccessor = classDeclaration.members.find(typescript_1.isGetAccessor);
|
|
150
|
+
const setAccessor = classDeclaration.members.find(typescript_1.isSetAccessor);
|
|
151
|
+
// Get the first of the two (that is not undefined)
|
|
152
|
+
const firstAccessor = getAccessor && (!setAccessor || getAccessor.pos < setAccessor.pos) ? getAccessor : setAccessor;
|
|
153
|
+
return {
|
|
154
|
+
firstAccessor,
|
|
155
|
+
setAccessor,
|
|
156
|
+
getAccessor,
|
|
157
|
+
};
|
|
158
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkLuabindClassDecoratorExpression =
|
|
3
|
+
exports.checkLuabindClassDecoratorExpression = checkLuabindClassDecoratorExpression;
|
|
4
4
|
const constants_1 = require("./constants");
|
|
5
5
|
const errors_1 = require("./errors");
|
|
6
6
|
/**
|
|
@@ -13,4 +13,3 @@ function checkLuabindClassDecoratorExpression(context, decorator) {
|
|
|
13
13
|
context.diagnostics.push((0, errors_1.unsupportedClassDecorator)(expression));
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
|
-
exports.checkLuabindClassDecoratorExpression = checkLuabindClassDecoratorExpression;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformAccessorDeclarations =
|
|
3
|
+
exports.transformAccessorDeclarations = transformAccessorDeclarations;
|
|
4
4
|
const typescript_to_lua_1 = require("typescript-to-lua");
|
|
5
5
|
const lua = require("typescript-to-lua");
|
|
6
6
|
const lua_ast_1 = require("typescript-to-lua/dist/transformation/utils/lua-ast");
|
|
@@ -36,4 +36,3 @@ function transformAccessorDeclarations(context, { firstAccessor, getAccessor, se
|
|
|
36
36
|
const call = (0, lualib_1.transformLuaLibFunction)(context, feature, undefined, ...parameters);
|
|
37
37
|
return lua.createExpressionStatement(call);
|
|
38
38
|
}
|
|
39
|
-
exports.transformAccessorDeclarations = transformAccessorDeclarations;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createConstructorName = createConstructorName;
|
|
4
|
+
exports.transformConstructorDeclaration = transformConstructorDeclaration;
|
|
4
5
|
const typescript_1 = require("typescript");
|
|
5
6
|
const lua = require("typescript-to-lua");
|
|
6
7
|
const lua_ast_1 = require("typescript-to-lua/dist/transformation/utils/lua-ast");
|
|
@@ -12,7 +13,6 @@ const fields_1 = require("./fields");
|
|
|
12
13
|
function createConstructorName(className) {
|
|
13
14
|
return lua.createTableIndexExpression(lua.cloneIdentifier(className), lua.createStringLiteral(constants_1.LUABIND_CONSTRUCTOR_METHOD));
|
|
14
15
|
}
|
|
15
|
-
exports.createConstructorName = createConstructorName;
|
|
16
16
|
function transformConstructorDeclaration(context, statement, className, instanceFields, classDeclaration) {
|
|
17
17
|
// Don't transform methods without body (overload declarations)
|
|
18
18
|
if (!statement.body) {
|
|
@@ -58,4 +58,3 @@ function transformConstructorDeclaration(context, statement, className, instance
|
|
|
58
58
|
context.popScope();
|
|
59
59
|
return lua.createAssignmentStatement(createConstructorName(className), lua.createFunctionExpression(block, params, dotsLiteral, lua.NodeFlags.Declaration), constructorWasGenerated ? classDeclaration : statement);
|
|
60
60
|
}
|
|
61
|
-
exports.transformConstructorDeclaration = transformConstructorDeclaration;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.verifyPropertyDecoratingExpression = verifyPropertyDecoratingExpression;
|
|
4
|
+
exports.transformClassInstanceFields = transformClassInstanceFields;
|
|
4
5
|
const typescript_1 = require("typescript");
|
|
5
6
|
const tstl = require("typescript-to-lua");
|
|
6
7
|
const lua_ast_1 = require("typescript-to-lua/dist/transformation/utils/lua-ast");
|
|
@@ -20,7 +21,6 @@ function verifyPropertyDecoratingExpression(context, node) {
|
|
|
20
21
|
context.diagnostics.push((0, errors_1.unsupportedPropertyDecorator)(decorator));
|
|
21
22
|
});
|
|
22
23
|
}
|
|
23
|
-
exports.verifyPropertyDecoratingExpression = verifyPropertyDecoratingExpression;
|
|
24
24
|
function transformClassInstanceFields(context, instanceFields) {
|
|
25
25
|
const statements = [];
|
|
26
26
|
for (const f of instanceFields) {
|
|
@@ -38,4 +38,3 @@ function transformClassInstanceFields(context, instanceFields) {
|
|
|
38
38
|
}
|
|
39
39
|
return statements;
|
|
40
40
|
}
|
|
41
|
-
exports.transformClassInstanceFields = transformClassInstanceFields;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformMemberExpressionOwnerName = transformMemberExpressionOwnerName;
|
|
4
|
+
exports.transformMethodName = transformMethodName;
|
|
5
|
+
exports.transformMethodDeclaration = transformMethodDeclaration;
|
|
6
|
+
exports.verifyMethodDecoratingExpression = verifyMethodDecoratingExpression;
|
|
4
7
|
const typescript_1 = require("typescript");
|
|
5
8
|
const lua = require("typescript-to-lua");
|
|
6
9
|
const function_1 = require("typescript-to-lua/dist/transformation/visitors/function");
|
|
@@ -10,7 +13,6 @@ const utils_1 = require("../utils");
|
|
|
10
13
|
function transformMemberExpressionOwnerName(node, className) {
|
|
11
14
|
return lua.cloneIdentifier(className);
|
|
12
15
|
}
|
|
13
|
-
exports.transformMemberExpressionOwnerName = transformMemberExpressionOwnerName;
|
|
14
16
|
function transformMethodName(context, node) {
|
|
15
17
|
const methodName = (0, literal_1.transformPropertyName)(context, node.name);
|
|
16
18
|
if (lua.isStringLiteral(methodName) && methodName.value === "toString") {
|
|
@@ -18,7 +20,6 @@ function transformMethodName(context, node) {
|
|
|
18
20
|
}
|
|
19
21
|
return methodName;
|
|
20
22
|
}
|
|
21
|
-
exports.transformMethodName = transformMethodName;
|
|
22
23
|
function transformMethodDeclaration(context, node, className) {
|
|
23
24
|
// Don't transform methods without body (overload declarations)
|
|
24
25
|
if (!node.body)
|
|
@@ -33,7 +34,6 @@ function transformMethodDeclaration(context, node, className) {
|
|
|
33
34
|
const [functionExpression] = (0, function_1.transformFunctionToExpression)(context, node);
|
|
34
35
|
return lua.createAssignmentStatement(lua.createTableIndexExpression(methodTable, methodName), functionExpression, node);
|
|
35
36
|
}
|
|
36
|
-
exports.transformMethodDeclaration = transformMethodDeclaration;
|
|
37
37
|
/**
|
|
38
38
|
* Verify that method statement is not using decorators for methods/parameters.
|
|
39
39
|
*/
|
|
@@ -53,4 +53,3 @@ function verifyMethodDecoratingExpression(context, node) {
|
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
exports.verifyMethodDecoratingExpression = verifyMethodDecoratingExpression;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformNewCallExpression =
|
|
3
|
+
exports.transformNewCallExpression = transformNewCallExpression;
|
|
4
4
|
const tstl = require("typescript-to-lua");
|
|
5
5
|
const call_1 = require("typescript-to-lua/dist/transformation/visitors/call");
|
|
6
6
|
/**
|
|
@@ -9,4 +9,3 @@ const call_1 = require("typescript-to-lua/dist/transformation/visitors/call");
|
|
|
9
9
|
function transformNewCallExpression(expression, context) {
|
|
10
10
|
return tstl.createCallExpression(context.transformExpression(expression.expression), (0, call_1.transformArguments)(context, expression.arguments ?? []));
|
|
11
11
|
}
|
|
12
|
-
exports.transformNewCallExpression = transformNewCallExpression;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createClassSetup = createClassSetup;
|
|
4
|
+
exports.getReflectionClassName = getReflectionClassName;
|
|
4
5
|
const typescript_1 = require("typescript");
|
|
5
6
|
const tstl = require("typescript-to-lua");
|
|
6
7
|
const export_1 = require("typescript-to-lua/dist/transformation/utils/export");
|
|
@@ -41,7 +42,6 @@ function createClassSetup(context, statement, className, localClassName) {
|
|
|
41
42
|
result.push(tstl.createAssignmentStatement(tstl.createTableIndexExpression(tstl.cloneIdentifier(localClassName), tstl.createStringLiteral(constants_1.LUABIND_NAME_FIELD)), getReflectionClassName(statement, className), statement));
|
|
42
43
|
return result;
|
|
43
44
|
}
|
|
44
|
-
exports.createClassSetup = createClassSetup;
|
|
45
45
|
function getReflectionClassName(declaration, className) {
|
|
46
46
|
if (declaration.name) {
|
|
47
47
|
return tstl.createStringLiteral(declaration.name.text);
|
|
@@ -57,7 +57,6 @@ function getReflectionClassName(declaration, className) {
|
|
|
57
57
|
}
|
|
58
58
|
return tstl.createStringLiteral("");
|
|
59
59
|
}
|
|
60
|
-
exports.getReflectionClassName = getReflectionClassName;
|
|
61
60
|
/**
|
|
62
61
|
* Creates class("Name")(base) expression for luabind classes.
|
|
63
62
|
*/
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.transformClassSuperMethodExpression = transformClassSuperMethodExpression;
|
|
4
|
+
exports.isLuabindClassSuperCall = isLuabindClassSuperCall;
|
|
5
|
+
exports.isLuabindClassSuperMethodCall = isLuabindClassSuperMethodCall;
|
|
6
|
+
exports.transformLuabindConstructorSuperCall = transformLuabindConstructorSuperCall;
|
|
4
7
|
const typescript_1 = require("typescript");
|
|
5
8
|
const tstl = require("typescript-to-lua");
|
|
6
9
|
const export_1 = require("typescript-to-lua/dist/transformation/utils/export");
|
|
@@ -34,7 +37,6 @@ function transformClassSuperMethodExpression(expression, context) {
|
|
|
34
37
|
}
|
|
35
38
|
return baseClassName;
|
|
36
39
|
}
|
|
37
|
-
exports.transformClassSuperMethodExpression = transformClassSuperMethodExpression;
|
|
38
40
|
/**
|
|
39
41
|
* Check if super() call is in luabind class target.
|
|
40
42
|
*/
|
|
@@ -50,7 +52,6 @@ function isLuabindClassSuperCall(expression, context) {
|
|
|
50
52
|
return superInfo?.classDeclaration ? (0, utils_1.isLuabindClassType)(superInfo.classDeclaration, context) : false;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
exports.isLuabindClassSuperCall = isLuabindClassSuperCall;
|
|
54
55
|
/**
|
|
55
56
|
* Check if super.method() call is in luabind class target.
|
|
56
57
|
*/
|
|
@@ -60,7 +61,6 @@ function isLuabindClassSuperMethodCall(expression, context) {
|
|
|
60
61
|
// Handle super calls properly for luabind classes.
|
|
61
62
|
return superInfo?.classDeclaration ? (0, utils_1.isLuabindClassType)(superInfo.classDeclaration, context) : false;
|
|
62
63
|
}
|
|
63
|
-
exports.isLuabindClassSuperMethodCall = isLuabindClassSuperMethodCall;
|
|
64
64
|
/**
|
|
65
65
|
* Transform super() call in luabind classes to base_class.__init(self, param).
|
|
66
66
|
*/
|
|
@@ -69,4 +69,3 @@ function transformLuabindConstructorSuperCall(expression, context) {
|
|
|
69
69
|
const parameters = (0, call_1.transformArguments)(context, expression.arguments, signature, typescript_1.factory.createThis());
|
|
70
70
|
return tstl.createCallExpression(tstl.createTableIndexExpression(context.transformExpression(typescript_1.factory.createSuper()), tstl.createStringLiteral(constants_1.LUABIND_CONSTRUCTOR_METHOD)), parameters, expression);
|
|
71
71
|
}
|
|
72
|
-
exports.transformLuabindConstructorSuperCall = transformLuabindConstructorSuperCall;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isStaticNode = isStaticNode;
|
|
4
|
+
exports.getExtendsClause = getExtendsClause;
|
|
5
|
+
exports.getExtendedNode = getExtendedNode;
|
|
6
|
+
exports.getExtendedType = getExtendedType;
|
|
7
|
+
exports.isLuabindDecoratedClass = isLuabindDecoratedClass;
|
|
8
|
+
exports.markTypeAsLuabind = markTypeAsLuabind;
|
|
9
|
+
exports.isLuabindClassType = isLuabindClassType;
|
|
4
10
|
const typescript_1 = require("typescript");
|
|
5
11
|
const constants_1 = require("./constants");
|
|
6
12
|
/**
|
|
@@ -9,14 +15,12 @@ const constants_1 = require("./constants");
|
|
|
9
15
|
function isStaticNode(node) {
|
|
10
16
|
return node.modifiers?.some((m) => m.kind === typescript_1.SyntaxKind.StaticKeyword) === true;
|
|
11
17
|
}
|
|
12
|
-
exports.isStaticNode = isStaticNode;
|
|
13
18
|
/**
|
|
14
19
|
* Get class extends node.
|
|
15
20
|
*/
|
|
16
21
|
function getExtendsClause(node) {
|
|
17
22
|
return node.heritageClauses?.find((clause) => clause.token === typescript_1.SyntaxKind.ExtendsKeyword);
|
|
18
23
|
}
|
|
19
|
-
exports.getExtendsClause = getExtendsClause;
|
|
20
24
|
/**
|
|
21
25
|
* Get class extended node.
|
|
22
26
|
*/
|
|
@@ -26,7 +30,6 @@ function getExtendedNode(node) {
|
|
|
26
30
|
return;
|
|
27
31
|
return extendsClause.types[0];
|
|
28
32
|
}
|
|
29
|
-
exports.getExtendedNode = getExtendedNode;
|
|
30
33
|
/**
|
|
31
34
|
* Get class extended node.
|
|
32
35
|
*/
|
|
@@ -34,7 +37,6 @@ function getExtendedType(context, node) {
|
|
|
34
37
|
const extendedNode = getExtendedNode(node);
|
|
35
38
|
return extendedNode && context.checker.getTypeAtLocation(extendedNode);
|
|
36
39
|
}
|
|
37
|
-
exports.getExtendedType = getExtendedType;
|
|
38
40
|
/**
|
|
39
41
|
* Check if class is decorated with provided decorator name.
|
|
40
42
|
*/
|
|
@@ -45,7 +47,6 @@ function isLuabindDecoratedClass(declaration) {
|
|
|
45
47
|
}
|
|
46
48
|
return decorators.some((it) => it.expression.expression?.escapedText === constants_1.LUABIND_DECORATOR);
|
|
47
49
|
}
|
|
48
|
-
exports.isLuabindDecoratedClass = isLuabindDecoratedClass;
|
|
49
50
|
/**
|
|
50
51
|
* Mark provided class as Luabind target.
|
|
51
52
|
*/
|
|
@@ -54,7 +55,6 @@ function markTypeAsLuabind(declaration, context) {
|
|
|
54
55
|
const typeSymbol = typeAtLocation.symbol || typeAtLocation.aliasSymbol;
|
|
55
56
|
typeSymbol[constants_1.LUABIND_SYMBOL] = true;
|
|
56
57
|
}
|
|
57
|
-
exports.markTypeAsLuabind = markTypeAsLuabind;
|
|
58
58
|
/**
|
|
59
59
|
* Check if provided class is specified as LuaBind.
|
|
60
60
|
*/
|
|
@@ -74,4 +74,3 @@ function isLuabindClassType(declaration, context) {
|
|
|
74
74
|
return false;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
exports.isLuabindClassType = isLuabindClassType;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.createDiagnosticFactory = createDiagnosticFactory;
|
|
4
|
+
exports.createErrorDiagnosticFactory = createErrorDiagnosticFactory;
|
|
4
5
|
const typescript_1 = require("typescript");
|
|
5
6
|
const utils_1 = require("typescript-to-lua/dist/utils");
|
|
6
7
|
/**
|
|
@@ -15,8 +16,6 @@ function createDiagnosticFactory(category, message) {
|
|
|
15
16
|
category,
|
|
16
17
|
}));
|
|
17
18
|
}
|
|
18
|
-
exports.createDiagnosticFactory = createDiagnosticFactory;
|
|
19
19
|
function createErrorDiagnosticFactory(message) {
|
|
20
20
|
return createDiagnosticFactory(typescript_1.DiagnosticCategory.Error, message);
|
|
21
21
|
}
|
|
22
|
-
exports.createErrorDiagnosticFactory = createErrorDiagnosticFactory;
|
|
@@ -145,9 +145,23 @@ declare module "xray16" {
|
|
|
145
145
|
*/
|
|
146
146
|
public set_callback(type: TXR_callback, cb: null): void;
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
/**
|
|
149
|
+
* 0 todo;
|
|
150
|
+
*/
|
|
151
|
+
public set_callback<T extends AnyObject>(
|
|
152
|
+
type: TXR_callbacks["trade_start"],
|
|
153
|
+
cb?: ((this: void) => void) | null,
|
|
154
|
+
object?: Maybe<T>
|
|
155
|
+
): void;
|
|
149
156
|
|
|
150
|
-
|
|
157
|
+
/**
|
|
158
|
+
* 1 todo;
|
|
159
|
+
*/
|
|
160
|
+
public set_callback<T extends AnyObject>(
|
|
161
|
+
type: TXR_callbacks["trade_stop"],
|
|
162
|
+
cb?: ((this: void) => void) | null,
|
|
163
|
+
object?: Maybe<T>
|
|
164
|
+
): void;
|
|
151
165
|
|
|
152
166
|
/**
|
|
153
167
|
* 2 todo;
|
|
@@ -158,7 +172,14 @@ declare module "xray16" {
|
|
|
158
172
|
object?: Maybe<T>
|
|
159
173
|
): void;
|
|
160
174
|
|
|
161
|
-
|
|
175
|
+
/**
|
|
176
|
+
* 3 todo;
|
|
177
|
+
*/
|
|
178
|
+
public set_callback<T extends AnyObject>(
|
|
179
|
+
type: TXR_callbacks["trade_perform_operation"],
|
|
180
|
+
cb?: ((this: void, money_get: u32, money_put: u32) => void) | null,
|
|
181
|
+
object?: Maybe<T>
|
|
182
|
+
): void;
|
|
162
183
|
|
|
163
184
|
/**
|
|
164
185
|
* 4 todo;
|
|
@@ -172,7 +193,7 @@ declare module "xray16" {
|
|
|
172
193
|
): void;
|
|
173
194
|
|
|
174
195
|
/**
|
|
175
|
-
*
|
|
196
|
+
* 5 todo;
|
|
176
197
|
*
|
|
177
198
|
* Works with script_zone objects.
|
|
178
199
|
*/
|
|
@@ -182,9 +203,23 @@ declare module "xray16" {
|
|
|
182
203
|
object?: Maybe<T>
|
|
183
204
|
): void;
|
|
184
205
|
|
|
185
|
-
|
|
206
|
+
/**
|
|
207
|
+
* 6 todo;
|
|
208
|
+
*/
|
|
209
|
+
public set_callback<T extends AnyObject>(
|
|
210
|
+
type: TXR_callbacks["level_border_exit"],
|
|
211
|
+
cb?: ((this: void, xobject: game_object) => void) | null,
|
|
212
|
+
object?: Maybe<T>
|
|
213
|
+
): void;
|
|
186
214
|
|
|
187
|
-
|
|
215
|
+
/**
|
|
216
|
+
* 7 todo;
|
|
217
|
+
*/
|
|
218
|
+
public set_callback<T extends AnyObject>(
|
|
219
|
+
type: TXR_callbacks["level_border_enter"],
|
|
220
|
+
cb?: ((this: void, xobject: game_object) => void) | null,
|
|
221
|
+
object?: Maybe<T>
|
|
222
|
+
): void;
|
|
188
223
|
|
|
189
224
|
/**
|
|
190
225
|
* 8 todo;
|
|
@@ -204,7 +239,7 @@ declare module "xray16" {
|
|
|
204
239
|
object?: Maybe<T>
|
|
205
240
|
): void;
|
|
206
241
|
|
|
207
|
-
// 10 todo: inventory_pda
|
|
242
|
+
// 10 todo: inventory_pda -> implement in game engine
|
|
208
243
|
|
|
209
244
|
/**
|
|
210
245
|
* 11 todo:
|
|
@@ -215,7 +250,7 @@ declare module "xray16" {
|
|
|
215
250
|
object?: Maybe<T>
|
|
216
251
|
): void;
|
|
217
252
|
|
|
218
|
-
// 12 todo: article_info
|
|
253
|
+
// 12 todo: article_info -> implement in game engine
|
|
219
254
|
|
|
220
255
|
/**
|
|
221
256
|
* 13 todo;
|
|
@@ -226,7 +261,14 @@ declare module "xray16" {
|
|
|
226
261
|
object?: Maybe<T>
|
|
227
262
|
): void;
|
|
228
263
|
|
|
229
|
-
|
|
264
|
+
/**
|
|
265
|
+
* 14 todo;
|
|
266
|
+
*/
|
|
267
|
+
public set_callback<T extends AnyObject>(
|
|
268
|
+
type: TXR_callbacks["map_location_added"],
|
|
269
|
+
cb?: ((this: void, spot_type: string, id: u16) => void) | null,
|
|
270
|
+
object?: Maybe<T>
|
|
271
|
+
): void;
|
|
230
272
|
|
|
231
273
|
/**
|
|
232
274
|
* 15 Use some object.
|
|
@@ -278,7 +320,14 @@ declare module "xray16" {
|
|
|
278
320
|
object?: Maybe<T>
|
|
279
321
|
): void;
|
|
280
322
|
|
|
281
|
-
|
|
323
|
+
/**
|
|
324
|
+
* 18 todo;
|
|
325
|
+
*/
|
|
326
|
+
public set_callback<T extends AnyObject>(
|
|
327
|
+
type: TXR_callbacks["action_movement"],
|
|
328
|
+
cb?: ((this: void, object: game_object, movement_type: u32 /* EMovementType */, unknown: -1) => void) | null,
|
|
329
|
+
object?: Maybe<T>
|
|
330
|
+
): void;
|
|
282
331
|
|
|
283
332
|
// 19 todo: action_watch
|
|
284
333
|
|
|
@@ -292,7 +341,7 @@ declare module "xray16" {
|
|
|
292
341
|
|
|
293
342
|
// 24 todo: action_object
|
|
294
343
|
|
|
295
|
-
// 25 todo: actor_sleep
|
|
344
|
+
// 25 todo: actor_sleep -> implement in game engine
|
|
296
345
|
|
|
297
346
|
/**
|
|
298
347
|
* 26 todo;
|
|
@@ -339,11 +388,32 @@ declare module "xray16" {
|
|
|
339
388
|
object?: object | null
|
|
340
389
|
): void;
|
|
341
390
|
|
|
342
|
-
|
|
391
|
+
/**
|
|
392
|
+
* 31 todo;
|
|
393
|
+
*/
|
|
394
|
+
public set_callback<T extends AnyObject>(
|
|
395
|
+
type: TXR_callbacks["trader_global_anim_request"],
|
|
396
|
+
cb?: ((this: void) => void) | null,
|
|
397
|
+
object?: Maybe<T>
|
|
398
|
+
): void;
|
|
343
399
|
|
|
344
|
-
|
|
400
|
+
/**
|
|
401
|
+
* 32 todo;
|
|
402
|
+
*/
|
|
403
|
+
public set_callback<T extends AnyObject>(
|
|
404
|
+
type: TXR_callbacks["trader_head_anim_request"],
|
|
405
|
+
cb?: ((this: void) => void) | null,
|
|
406
|
+
object?: Maybe<T>
|
|
407
|
+
): void;
|
|
345
408
|
|
|
346
|
-
|
|
409
|
+
/**
|
|
410
|
+
* 33 todo;
|
|
411
|
+
*/
|
|
412
|
+
public set_callback<T extends AnyObject>(
|
|
413
|
+
type: TXR_callbacks["trader_sound_end"],
|
|
414
|
+
cb?: ((this: void) => void) | null,
|
|
415
|
+
object?: Maybe<T>
|
|
416
|
+
): void;
|
|
347
417
|
|
|
348
418
|
/**
|
|
349
419
|
* 34 todo;
|
|
@@ -354,43 +424,150 @@ declare module "xray16" {
|
|
|
354
424
|
object?: Maybe<T>
|
|
355
425
|
): void;
|
|
356
426
|
|
|
357
|
-
|
|
427
|
+
/**
|
|
428
|
+
* 35 Callback executed when weapon has no ammo to fire.
|
|
429
|
+
*/
|
|
430
|
+
public set_callback<T extends AnyObject>(
|
|
431
|
+
type: TXR_callbacks["weapon_no_ammo"],
|
|
432
|
+
cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
|
|
433
|
+
object?: Maybe<T>
|
|
434
|
+
): void;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* 36 Callback executed on hud animation stop.
|
|
438
|
+
* Called from CHudItem class internals.
|
|
439
|
+
*/
|
|
440
|
+
public set_callback<T extends AnyObject>(
|
|
441
|
+
type: TXR_callbacks["hud_animation_end"],
|
|
442
|
+
cb?:
|
|
443
|
+
| ((
|
|
444
|
+
this: void,
|
|
445
|
+
object: game_object,
|
|
446
|
+
hud_section: string,
|
|
447
|
+
current_motion: string,
|
|
448
|
+
state: u32,
|
|
449
|
+
animation_slot: u32
|
|
450
|
+
) => void)
|
|
451
|
+
| null,
|
|
452
|
+
object?: Maybe<T>
|
|
453
|
+
): void;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* 37 todo;
|
|
457
|
+
*/
|
|
458
|
+
public set_callback<T extends AnyObject>(
|
|
459
|
+
type: TXR_callbacks["key_press"],
|
|
460
|
+
cb?: ((this: void, key: i32) => void) | null,
|
|
461
|
+
object?: Maybe<T>
|
|
462
|
+
): void;
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* 38 todo;
|
|
466
|
+
*/
|
|
467
|
+
public set_callback<T extends AnyObject>(
|
|
468
|
+
type: TXR_callbacks["key_release"],
|
|
469
|
+
cb?: ((this: void, key: i32) => void) | null,
|
|
470
|
+
object?: Maybe<T>
|
|
471
|
+
): void;
|
|
358
472
|
|
|
359
|
-
|
|
473
|
+
/**
|
|
474
|
+
* 39 todo;
|
|
475
|
+
*/
|
|
476
|
+
public set_callback<T extends AnyObject>(
|
|
477
|
+
type: TXR_callbacks["key_hold"],
|
|
478
|
+
cb?: ((this: void, key: i32) => void) | null,
|
|
479
|
+
object?: Maybe<T>
|
|
480
|
+
): void;
|
|
360
481
|
|
|
361
|
-
//
|
|
482
|
+
// 40 todo: mouse_move
|
|
362
483
|
|
|
363
|
-
//
|
|
484
|
+
// 41 todo: mouse_wheel
|
|
364
485
|
|
|
365
|
-
//
|
|
486
|
+
// 42 todo: controller_press
|
|
366
487
|
|
|
367
|
-
//
|
|
488
|
+
// 43 todo: controller_release
|
|
368
489
|
|
|
369
|
-
//
|
|
490
|
+
// 44 todo: controller_hold
|
|
370
491
|
|
|
371
|
-
//
|
|
492
|
+
// 45 todo: controller_attitude_change
|
|
372
493
|
|
|
373
|
-
|
|
494
|
+
/**
|
|
495
|
+
* 46 todo: item_to_belt
|
|
496
|
+
*/
|
|
497
|
+
public set_callback<T extends AnyObject>(
|
|
498
|
+
type: TXR_callbacks["item_to_belt"],
|
|
499
|
+
cb?: ((this: void, object: game_object) => void) | null,
|
|
500
|
+
object?: Maybe<T>
|
|
501
|
+
): void;
|
|
374
502
|
|
|
375
|
-
|
|
503
|
+
/**
|
|
504
|
+
* 47 todo: item_to_slot
|
|
505
|
+
*/
|
|
506
|
+
public set_callback<T extends AnyObject>(
|
|
507
|
+
type: TXR_callbacks["item_to_slot"],
|
|
508
|
+
cb?: ((this: void, object: game_object) => void) | null,
|
|
509
|
+
object?: Maybe<T>
|
|
510
|
+
): void;
|
|
376
511
|
|
|
377
|
-
|
|
512
|
+
/**
|
|
513
|
+
* 48 todo: item_to_ruck
|
|
514
|
+
*/
|
|
515
|
+
public set_callback<T extends AnyObject>(
|
|
516
|
+
type: TXR_callbacks["item_to_ruck"],
|
|
517
|
+
cb?: ((this: void, object: game_object) => void) | null,
|
|
518
|
+
object?: Maybe<T>
|
|
519
|
+
): void;
|
|
378
520
|
|
|
379
|
-
|
|
521
|
+
/**
|
|
522
|
+
* 49 Callback executed when weapon is zoomed in.
|
|
523
|
+
*/
|
|
524
|
+
public set_callback<T extends AnyObject>(
|
|
525
|
+
type: TXR_callbacks["weapon_zoom_in"],
|
|
526
|
+
cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
|
|
527
|
+
object?: Maybe<T>
|
|
528
|
+
): void;
|
|
380
529
|
|
|
381
|
-
|
|
530
|
+
/**
|
|
531
|
+
* 50 Callback executed when weapon is zoomed out.
|
|
532
|
+
*/
|
|
533
|
+
public set_callback<T extends AnyObject>(
|
|
534
|
+
type: TXR_callbacks["weapon_zoom_out"],
|
|
535
|
+
cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
|
|
536
|
+
object?: Maybe<T>
|
|
537
|
+
): void;
|
|
382
538
|
|
|
383
|
-
|
|
539
|
+
/**
|
|
540
|
+
* 51 Callback executed when magazine ammo is elapsed and empty.
|
|
541
|
+
*/
|
|
542
|
+
public set_callback<T extends AnyObject>(
|
|
543
|
+
type: TXR_callbacks["weapon_jammed"],
|
|
544
|
+
cb?: ((this: void, owner: game_object, weapon: game_object) => void) | null,
|
|
545
|
+
object?: Maybe<T>
|
|
546
|
+
): void;
|
|
384
547
|
|
|
385
|
-
|
|
548
|
+
/**
|
|
549
|
+
* 52 Callback executed when magazine ammo is elapsed and empty.
|
|
550
|
+
*/
|
|
551
|
+
public set_callback<T extends AnyObject>(
|
|
552
|
+
type: TXR_callbacks["weapon_magazine_empty"],
|
|
553
|
+
cb?: ((this: void, object: game_object, suitable_ammo_total: i32) => void) | null,
|
|
554
|
+
object?: Maybe<T>
|
|
555
|
+
): void;
|
|
386
556
|
|
|
387
|
-
|
|
557
|
+
/**
|
|
558
|
+
* 53 todo: actor_before_death
|
|
559
|
+
*/
|
|
560
|
+
public set_callback<T extends AnyObject>(
|
|
561
|
+
type: TXR_callbacks["actor_before_death"],
|
|
562
|
+
cb?: ((this: void, killer_id: u16) => void) | null,
|
|
563
|
+
object?: Maybe<T>
|
|
564
|
+
): void;
|
|
388
565
|
|
|
389
|
-
//
|
|
566
|
+
// 54 todo: on_attach_vehicle
|
|
390
567
|
|
|
391
|
-
//
|
|
568
|
+
// 55 todo: on_detach_vehicle
|
|
392
569
|
|
|
393
|
-
//
|
|
570
|
+
// 56 todo: on_use_vehicle
|
|
394
571
|
|
|
395
572
|
public clear_callbacks(): void;
|
|
396
573
|
|