xray16 1.3.2 → 1.4.0

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.
Files changed (85) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +112 -106
  3. package/package.json +45 -42
  4. package/plugins/built_at_info.d.ts +1 -1
  5. package/plugins/from_cast_utils.d.ts +1 -1
  6. package/plugins/global_declarations_transform.d.ts +1 -1
  7. package/plugins/inject_file_meta.d.ts +1 -1
  8. package/plugins/inject_tracy_zones.d.ts +1 -1
  9. package/plugins/inject_tracy_zones.js +4 -4
  10. package/plugins/strip_lua_logger.d.ts +1 -1
  11. package/plugins/strip_lua_logger.js +1 -1
  12. package/plugins/transform_luabind_class/plugin.d.ts +1 -1
  13. package/plugins/transform_luabind_class/transformation/class_declaration.d.ts +3 -3
  14. package/plugins/transform_luabind_class/transformation/decorators.d.ts +5 -2
  15. package/plugins/transform_luabind_class/transformation/decorators.js +3 -0
  16. package/plugins/transform_luabind_class/transformation/members/accessors.d.ts +1 -1
  17. package/plugins/transform_luabind_class/transformation/members/constructor.d.ts +2 -2
  18. package/plugins/transform_luabind_class/transformation/members/constructor.js +2 -2
  19. package/plugins/transform_luabind_class/transformation/members/fields.d.ts +5 -2
  20. package/plugins/transform_luabind_class/transformation/members/fields.js +5 -2
  21. package/plugins/transform_luabind_class/transformation/members/method.d.ts +6 -3
  22. package/plugins/transform_luabind_class/transformation/members/method.js +4 -1
  23. package/plugins/transform_luabind_class/transformation/new.d.ts +7 -3
  24. package/plugins/transform_luabind_class/transformation/new.js +5 -1
  25. package/plugins/transform_luabind_class/transformation/setup.d.ts +9 -3
  26. package/plugins/transform_luabind_class/transformation/setup.js +22 -6
  27. package/plugins/transform_luabind_class/transformation/super.d.ts +19 -3
  28. package/plugins/transform_luabind_class/transformation/super.js +17 -1
  29. package/plugins/transform_luabind_class/transformation/utils.d.ts +27 -4
  30. package/plugins/transform_luabind_class/transformation/utils.js +25 -2
  31. package/plugins/utils/ast.d.ts +1 -1
  32. package/plugins/utils/diagnostics.d.ts +9 -5
  33. package/plugins/utils/diagnostics.js +5 -1
  34. package/plugins/utils/tracy.d.ts +2 -2
  35. package/plugins/utils/tracy.js +2 -5
  36. package/types/index.d.ts +55 -55
  37. package/types/xr_ai/xr_action.d.ts +510 -510
  38. package/types/xr_ai/xr_alife.d.ts +566 -566
  39. package/types/xr_ai/xr_enemy_evaluation.d.ts +41 -41
  40. package/types/xr_ai/xr_goap.d.ts +669 -668
  41. package/types/xr_ai/xr_graph.d.ts +47 -47
  42. package/types/xr_ai/xr_memory.d.ts +148 -148
  43. package/types/xr_lib/xr_animation.d.ts +81 -81
  44. package/types/xr_lib/xr_bitwise.d.ts +32 -21
  45. package/types/xr_lib/xr_color.d.ts +45 -40
  46. package/types/xr_lib/xr_debug.d.ts +83 -77
  47. package/types/xr_lib/xr_dialog.d.ts +40 -40
  48. package/types/xr_lib/xr_flags.d.ts +529 -148
  49. package/types/xr_lib/xr_fs.d.ts +149 -148
  50. package/types/xr_lib/xr_game.d.ts +261 -158
  51. package/types/xr_lib/xr_hit.d.ts +41 -41
  52. package/types/xr_lib/xr_ini.d.ts +415 -188
  53. package/types/xr_lib/xr_level.d.ts +652 -225
  54. package/types/xr_lib/xr_luabind.d.ts +64 -59
  55. package/types/xr_lib/xr_map.d.ts +61 -61
  56. package/types/xr_lib/xr_math.d.ts +815 -233
  57. package/types/xr_lib/xr_multiplayer.d.ts +351 -351
  58. package/types/xr_lib/xr_profile.d.ts +192 -160
  59. package/types/xr_lib/xr_properties.d.ts +455 -166
  60. package/types/xr_lib/xr_relation.d.ts +84 -84
  61. package/types/xr_lib/xr_render.d.ts +71 -69
  62. package/types/xr_lib/xr_save.d.ts +727 -223
  63. package/types/xr_lib/xr_sound.d.ts +151 -151
  64. package/types/xr_lib/xr_stats.ts +20 -20
  65. package/types/xr_lib/xr_task.d.ts +111 -111
  66. package/types/xr_lib/xr_time.d.ts +166 -61
  67. package/types/xr_lib/xr_type.d.ts +75 -75
  68. package/types/xr_object/client/xr_anomaly.d.ts +50 -50
  69. package/types/xr_object/client/xr_artefact.d.ts +98 -98
  70. package/types/xr_object/client/xr_client_object.d.ts +76 -76
  71. package/types/xr_object/client/xr_creature.d.ts +164 -164
  72. package/types/xr_object/client/xr_item.d.ts +264 -264
  73. package/types/xr_object/client/xr_level.d.ts +285 -285
  74. package/types/xr_object/client/xr_physic.d.ts +214 -214
  75. package/types/xr_object/client/xr_zone.d.ts +47 -47
  76. package/types/xr_object/script/xr_script_interface.d.ts +584 -584
  77. package/types/xr_object/script/xr_script_object.d.ts +2408 -1390
  78. package/types/xr_object/script/xr_script_trade.d.ts +41 -26
  79. package/types/xr_object/server/xr_server_object.d.ts +794 -792
  80. package/types/xr_ui/xr_ui_asset.d.ts +129 -123
  81. package/types/xr_ui/xr_ui_core.d.ts +106 -97
  82. package/types/xr_ui/xr_ui_event.d.ts +383 -381
  83. package/types/xr_ui/xr_ui_interface.d.ts +901 -903
  84. package/types/xr_ui/xr_ui_menu.d.ts +142 -142
  85. package/types/xrf_plugin.d.ts +59 -51
@@ -1,8 +1,14 @@
1
- import { ClassLikeDeclarationBase } from "typescript";
1
+ import { type ClassLikeDeclarationBase } from "typescript";
2
2
  import * as tstl from "typescript-to-lua";
3
- import { TransformationContext } from "typescript-to-lua";
3
+ import { type TransformationContext } from "typescript-to-lua";
4
4
  /**
5
- * Create full class setup statement with name/super calls/methods/declaration/fields etc.
5
+ * Build the full set of statements that define a luabind class.
6
+ *
7
+ * @param context - Active transformation context.
8
+ * @param statement - Class declaration being transformed.
9
+ * @param className - Exported class identifier.
10
+ * @param localClassName - Local class identifier.
11
+ * @returns Lua statements that set up the class.
6
12
  */
7
13
  export declare function createClassSetup(context: TransformationContext, statement: ClassLikeDeclarationBase, className: tstl.Identifier, localClassName: tstl.Identifier): tstl.Statement[];
8
14
  export declare function getReflectionClassName(declaration: ClassLikeDeclarationBase, className: tstl.Identifier): tstl.Expression;
@@ -9,11 +9,17 @@ const lua_ast_1 = require("typescript-to-lua/dist/transformation/utils/lua-ast")
9
9
  const constants_1 = require("./constants");
10
10
  const utils_1 = require("./utils");
11
11
  /**
12
- * Create full class setup statement with name/super calls/methods/declaration/fields etc.
12
+ * Build the full set of statements that define a luabind class.
13
+ *
14
+ * @param context - Active transformation context.
15
+ * @param statement - Class declaration being transformed.
16
+ * @param className - Exported class identifier.
17
+ * @param localClassName - Local class identifier.
18
+ * @returns Lua statements that set up the class.
13
19
  */
14
20
  function createClassSetup(context, statement, className, localClassName) {
15
21
  const result = [];
16
- // class("name")(base)
22
+ // Class("name")(base)
17
23
  const classInitializer = createLuabindClassStatement(statement, context, localClassName);
18
24
  result.push(tstl.createExpressionStatement(classInitializer));
19
25
  const classReference = createLuabindClassGlobalClassRef(statement, context, localClassName);
@@ -28,17 +34,17 @@ function createClassSetup(context, statement, className, localClassName) {
28
34
  result.push(...(0, lua_ast_1.createLocalOrExportedOrGlobalDeclaration)(context, className, classReference, statement));
29
35
  }
30
36
  if (defaultExportLeftHandSide) {
31
- // local localClassName = ____exports.default
37
+ // Local localClassName = ____exports.default
32
38
  result.push(tstl.createVariableDeclarationStatement(localClassName, defaultExportLeftHandSide));
33
39
  }
34
40
  else {
35
41
  const exportScope = (0, export_1.getIdentifierExportScope)(context, className);
36
42
  if (exportScope) {
37
- // local localClassName = ____exports.className
43
+ // Local localClassName = ____exports.className
38
44
  result.push(tstl.createVariableDeclarationStatement(localClassName, (0, export_1.createExportedIdentifier)(context, tstl.cloneIdentifier(className), exportScope)));
39
45
  }
40
46
  }
41
- // localClassName.__name = className
47
+ // LocalClassName.__name = className
42
48
  result.push(tstl.createAssignmentStatement(tstl.createTableIndexExpression(tstl.cloneIdentifier(localClassName), tstl.createStringLiteral(constants_1.LUABIND_NAME_FIELD)), getReflectionClassName(statement, className), statement));
43
49
  return result;
44
50
  }
@@ -59,6 +65,11 @@ function getReflectionClassName(declaration, className) {
59
65
  }
60
66
  /**
61
67
  * Creates class("Name")(base) expression for luabind classes.
68
+ *
69
+ * @param declaration - Class declaration being transformed.
70
+ * @param context - Active transformation context.
71
+ * @param className - Exported class identifier.
72
+ * @returns Lua expression that creates the class.
62
73
  */
63
74
  function createLuabindClassStatement(declaration, context, className) {
64
75
  const extendedNode = (0, utils_1.getExtendedNode)(declaration);
@@ -73,7 +84,12 @@ function createLuabindClassStatement(declaration, context, className) {
73
84
  return classDeclaration;
74
85
  }
75
86
  /**
76
- * Creates name expression for luabind classes.
87
+ * Create the global reference expression for a luabind class.
88
+ *
89
+ * @param declaration - Class declaration being transformed.
90
+ * @param context - Active transformation context.
91
+ * @param className - Exported class identifier.
92
+ * @returns Identifier used to reference the class.
77
93
  */
78
94
  function createLuabindClassGlobalClassRef(declaration, context, className) {
79
95
  return className;
@@ -1,20 +1,36 @@
1
- import { CallExpression, Expression, SuperExpression } from "typescript";
1
+ import { type CallExpression, type Expression, type SuperExpression } from "typescript";
2
2
  import * as tstl from "typescript-to-lua";
3
- import { ITransformationContext } from "./class_declaration";
3
+ import { type ITransformationContext } from "./class_declaration";
4
4
  /**
5
5
  * Transform generic methods super calls.
6
6
  * Example: super.parentMethod(first, second).
7
+ *
8
+ * @param expression - Super expression to transform.
9
+ * @param context - Active transformation context.
10
+ * @returns Lua expression referencing the base class.
7
11
  */
8
12
  export declare function transformClassSuperMethodExpression(expression: Expression, context: ITransformationContext): tstl.Expression;
9
13
  /**
10
14
  * Check if super() call is in luabind class target.
15
+ *
16
+ * @param expression - Call or super expression to check.
17
+ * @param context - Active transformation context.
18
+ * @returns True when the call targets a luabind class.
11
19
  */
12
20
  export declare function isLuabindClassSuperCall(expression: CallExpression | SuperExpression, context: ITransformationContext): boolean;
13
21
  /**
14
22
  * Check if super.method() call is in luabind class target.
23
+ *
24
+ * @param expression - Call or super expression to check.
25
+ * @param context - Active transformation context.
26
+ * @returns True when the call targets a luabind class.
15
27
  */
16
28
  export declare function isLuabindClassSuperMethodCall(expression: CallExpression | SuperExpression, context: ITransformationContext): boolean;
17
29
  /**
18
- * Transform super() call in luabind classes to base_class.__init(self, param).
30
+ * Transform a super() call into luabind classes to base_class.__init(self, param).
31
+ *
32
+ * @param expression - Super constructor call to transform.
33
+ * @param context - Active transformation context.
34
+ * @returns Lua call to the base class constructor.
19
35
  */
20
36
  export declare function transformLuabindConstructorSuperCall(expression: CallExpression, context: ITransformationContext): tstl.CallExpression;
@@ -14,6 +14,10 @@ const utils_1 = require("./utils");
14
14
  /**
15
15
  * Transform generic methods super calls.
16
16
  * Example: super.parentMethod(first, second).
17
+ *
18
+ * @param expression - Super expression to transform.
19
+ * @param context - Active transformation context.
20
+ * @returns Lua expression referencing the base class.
17
21
  */
18
22
  function transformClassSuperMethodExpression(expression, context) {
19
23
  const superInfos = context.classSuperInfos;
@@ -39,6 +43,10 @@ function transformClassSuperMethodExpression(expression, context) {
39
43
  }
40
44
  /**
41
45
  * Check if super() call is in luabind class target.
46
+ *
47
+ * @param expression - Call or super expression to check.
48
+ * @param context - Active transformation context.
49
+ * @returns True when the call targets a luabind class.
42
50
  */
43
51
  function isLuabindClassSuperCall(expression, context) {
44
52
  const calledExpression = (0, call_1.getCalledExpression)(expression);
@@ -54,6 +62,10 @@ function isLuabindClassSuperCall(expression, context) {
54
62
  }
55
63
  /**
56
64
  * Check if super.method() call is in luabind class target.
65
+ *
66
+ * @param expression - Call or super expression to check.
67
+ * @param context - Active transformation context.
68
+ * @returns True when the call targets a luabind class.
57
69
  */
58
70
  function isLuabindClassSuperMethodCall(expression, context) {
59
71
  const superInfos = context.classSuperInfos;
@@ -62,7 +74,11 @@ function isLuabindClassSuperMethodCall(expression, context) {
62
74
  return superInfo?.classDeclaration ? (0, utils_1.isLuabindClassType)(superInfo.classDeclaration, context) : false;
63
75
  }
64
76
  /**
65
- * Transform super() call in luabind classes to base_class.__init(self, param).
77
+ * Transform a super() call into luabind classes to base_class.__init(self, param).
78
+ *
79
+ * @param expression - Super constructor call to transform.
80
+ * @param context - Active transformation context.
81
+ * @returns Lua call to the base class constructor.
66
82
  */
67
83
  function transformLuabindConstructorSuperCall(expression, context) {
68
84
  const signature = context.checker.getResolvedSignature(expression);
@@ -1,30 +1,53 @@
1
- import { ClassLikeDeclaration, ClassLikeDeclarationBase, Expression, ExpressionWithTypeArguments, HasModifiers, HeritageClause, Type } from "typescript";
2
- import { TransformationContext } from "typescript-to-lua";
1
+ import { type ClassLikeDeclaration, type ClassLikeDeclarationBase, type Expression, type ExpressionWithTypeArguments, type HasModifiers, type HeritageClause, type Type } from "typescript";
2
+ import { type TransformationContext } from "typescript-to-lua";
3
3
  /**
4
- * Whether method / field is static.
4
+ * Whether a method or field is static.
5
+ *
6
+ * @param node - Node with modifiers to check.
7
+ * @returns True when the node is marked static.
5
8
  */
6
9
  export declare function isStaticNode(node: HasModifiers): boolean;
7
10
  /**
8
11
  * Get class extends node.
12
+ *
13
+ * @param node - Class declaration to read.
14
+ * @returns Extends clause of the class, if any.
9
15
  */
10
16
  export declare function getExtendsClause(node: ClassLikeDeclarationBase): HeritageClause | undefined;
11
17
  /**
12
18
  * Get class extended node.
19
+ *
20
+ * @param node - Class declaration to read.
21
+ * @returns First extended type node, if any.
13
22
  */
14
23
  export declare function getExtendedNode(node: ClassLikeDeclarationBase): ExpressionWithTypeArguments | undefined;
15
24
  /**
16
- * Get class extended node.
25
+ * Get the resolved type of the extended class.
26
+ *
27
+ * @param context - Active transformation context.
28
+ * @param node - Class declaration to read.
29
+ * @returns Resolved type of the extended class, if any.
17
30
  */
18
31
  export declare function getExtendedType(context: TransformationContext, node: ClassLikeDeclarationBase): Type | undefined;
19
32
  /**
20
33
  * Check if class is decorated with provided decorator name.
34
+ *
35
+ * @param declaration - Class declaration to inspect.
36
+ * @returns True when the class carries the luabind decorator.
21
37
  */
22
38
  export declare function isLuabindDecoratedClass(declaration: ClassLikeDeclaration): boolean;
23
39
  /**
24
40
  * Mark provided class as Luabind target.
41
+ *
42
+ * @param declaration - Class declaration to mark.
43
+ * @param context Active transformation context.
25
44
  */
26
45
  export declare function markTypeAsLuabind(declaration: ClassLikeDeclaration, context: TransformationContext): void;
27
46
  /**
28
47
  * Check if provided class is specified as LuaBind.
48
+ *
49
+ * @param declaration - Class declaration or expression to inspect.
50
+ * @param context - Active transformation context.
51
+ * @returns True when the class is a luabind target.
29
52
  */
30
53
  export declare function isLuabindClassType(declaration: Expression | ClassLikeDeclaration, context: TransformationContext): boolean;
@@ -10,19 +10,28 @@ exports.isLuabindClassType = isLuabindClassType;
10
10
  const typescript_1 = require("typescript");
11
11
  const constants_1 = require("./constants");
12
12
  /**
13
- * Whether method / field is static.
13
+ * Whether a method or field is static.
14
+ *
15
+ * @param node - Node with modifiers to check.
16
+ * @returns True when the node is marked static.
14
17
  */
15
18
  function isStaticNode(node) {
16
19
  return node.modifiers?.some((m) => m.kind === typescript_1.SyntaxKind.StaticKeyword) === true;
17
20
  }
18
21
  /**
19
22
  * Get class extends node.
23
+ *
24
+ * @param node - Class declaration to read.
25
+ * @returns Extends clause of the class, if any.
20
26
  */
21
27
  function getExtendsClause(node) {
22
28
  return node.heritageClauses?.find((clause) => clause.token === typescript_1.SyntaxKind.ExtendsKeyword);
23
29
  }
24
30
  /**
25
31
  * Get class extended node.
32
+ *
33
+ * @param node - Class declaration to read.
34
+ * @returns First extended type node, if any.
26
35
  */
27
36
  function getExtendedNode(node) {
28
37
  const extendsClause = getExtendsClause(node);
@@ -31,7 +40,11 @@ function getExtendedNode(node) {
31
40
  return extendsClause.types[0];
32
41
  }
33
42
  /**
34
- * Get class extended node.
43
+ * Get the resolved type of the extended class.
44
+ *
45
+ * @param context - Active transformation context.
46
+ * @param node - Class declaration to read.
47
+ * @returns Resolved type of the extended class, if any.
35
48
  */
36
49
  function getExtendedType(context, node) {
37
50
  const extendedNode = getExtendedNode(node);
@@ -39,6 +52,9 @@ function getExtendedType(context, node) {
39
52
  }
40
53
  /**
41
54
  * Check if class is decorated with provided decorator name.
55
+ *
56
+ * @param declaration - Class declaration to inspect.
57
+ * @returns True when the class carries the luabind decorator.
42
58
  */
43
59
  function isLuabindDecoratedClass(declaration) {
44
60
  const decorators = (0, typescript_1.getDecorators)(declaration);
@@ -49,6 +65,9 @@ function isLuabindDecoratedClass(declaration) {
49
65
  }
50
66
  /**
51
67
  * Mark provided class as Luabind target.
68
+ *
69
+ * @param declaration - Class declaration to mark.
70
+ * @param context Active transformation context.
52
71
  */
53
72
  function markTypeAsLuabind(declaration, context) {
54
73
  const typeAtLocation = context.checker.getTypeAtLocation(declaration);
@@ -57,6 +76,10 @@ function markTypeAsLuabind(declaration, context) {
57
76
  }
58
77
  /**
59
78
  * Check if provided class is specified as LuaBind.
79
+ *
80
+ * @param declaration - Class declaration or expression to inspect.
81
+ * @param context - Active transformation context.
82
+ * @returns True when the class is a luabind target.
60
83
  */
61
84
  function isLuabindClassType(declaration, context) {
62
85
  const typeAtLocation = context.checker.getTypeAtLocation(declaration);
@@ -1,2 +1,2 @@
1
- import { Identifier, StringLiteral } from "typescript";
1
+ import { type Identifier, type StringLiteral } from "typescript";
2
2
  export declare function getIdentifierText(node: Identifier | StringLiteral): string;
@@ -1,12 +1,16 @@
1
- import { DiagnosticCategory, Node } from "typescript";
2
- type MessageProvider<TArgs extends any[]> = string | ((...args: TArgs) => string);
1
+ import { DiagnosticCategory, type Node } from "typescript";
2
+ type MessageProvider<TArgs extends Array<any>> = string | ((...args: TArgs) => string);
3
3
  /**
4
- * Create diagnostics factory to push errors when transpile lua to typescript.
4
+ * Create a factory that builds diagnostics for transformation errors.
5
+ *
6
+ * @param category - Severity assigned to produced diagnostics.
7
+ * @param message - Static message or a function that builds it.
8
+ * @returns Factory that creates a diagnostic for a given node.
5
9
  */
6
- export declare function createDiagnosticFactory<TArgs extends any[]>(category: DiagnosticCategory, message: MessageProvider<TArgs>): ((node: Node, ...args: TArgs) => import("typescript").Diagnostic) & {
10
+ export declare function createDiagnosticFactory<TArgs extends Array<any>>(category: DiagnosticCategory, message: MessageProvider<TArgs>): ((node: Node, ...args: TArgs) => import("typescript").Diagnostic) & {
7
11
  code: number;
8
12
  };
9
- export declare function createErrorDiagnosticFactory<TArgs extends any[]>(message: MessageProvider<TArgs>): ((node: Node, ...args: TArgs) => import("typescript").Diagnostic) & {
13
+ export declare function createErrorDiagnosticFactory<TArgs extends Array<any>>(message: MessageProvider<TArgs>): ((node: Node, ...args: TArgs) => import("typescript").Diagnostic) & {
10
14
  code: number;
11
15
  };
12
16
  export {};
@@ -5,7 +5,11 @@ exports.createErrorDiagnosticFactory = createErrorDiagnosticFactory;
5
5
  const typescript_1 = require("typescript");
6
6
  const utils_1 = require("typescript-to-lua/dist/utils");
7
7
  /**
8
- * Create diagnostics factory to push errors when transpile lua to typescript.
8
+ * Create a factory that builds diagnostics for transformation errors.
9
+ *
10
+ * @param category - Severity assigned to produced diagnostics.
11
+ * @param message - Static message or a function that builds it.
12
+ * @returns Factory that creates a diagnostic for a given node.
9
13
  */
10
14
  function createDiagnosticFactory(category, message) {
11
15
  return (0, utils_1.createSerialDiagnosticFactory)((node, ...args) => ({
@@ -1,4 +1,4 @@
1
- import { ArrowFunction, ConstructorDeclaration, ExpressionStatement, FunctionDeclaration, MethodDeclaration, Node, NodeArray, Statement } from "typescript";
1
+ import { type ArrowFunction, type ExpressionStatement, type FunctionDeclaration, type MethodDeclaration, type Node, type NodeArray, type Statement } from "typescript";
2
2
  export declare function isTraceBeginExpression(node: Node): boolean;
3
3
  export declare function isTraceEndExpression(node: Node): boolean;
4
4
  export declare function createTraceZoneBeginExpression(): ExpressionStatement;
@@ -9,5 +9,5 @@ export declare function remapStatementsWithZoneEnd<T extends {
9
9
  statements: NodeArray<Statement>;
10
10
  }>(target: T): Array<Statement>;
11
11
  export declare function transformNestedStatementsToInjectEndZones(statement?: Statement): Statement;
12
- export declare function transformWithInjectedZones<T extends FunctionDeclaration | MethodDeclaration | ConstructorDeclaration>(node: T, parentName?: string): T;
12
+ export declare function transformWithInjectedZones<T extends FunctionDeclaration | MethodDeclaration>(node: T, parentName?: string): T;
13
13
  export declare function transformArrowFunctionWithInjectedZones<T extends ArrowFunction>(node: T, name: string): T;
@@ -120,7 +120,7 @@ function transformWithInjectedZones(node, parentName) {
120
120
  }
121
121
  const statements = remapStatementsWithZoneEnd(node.body).map(transformNestedStatementsToInjectEndZones);
122
122
  // Zone start declaration.
123
- statements.unshift(createTraceZoneBeginNExpression(`${parentName ? `${parentName}::` : ""}${name}@lua`));
123
+ statements.unshift(createTraceZoneBeginNExpression(`lua::${(0, typescript_1.isMethodDeclaration)(node) ? "method" : "function"}::${parentName ? `${parentName}::` : ""}${name}`));
124
124
  // Zone end declaration without explicit return.
125
125
  if (!hasReturnStatement) {
126
126
  statements.push(createTraceZoneEndExpression());
@@ -128,9 +128,6 @@ function transformWithInjectedZones(node, parentName) {
128
128
  if ((0, typescript_1.isMethodDeclaration)(node)) {
129
129
  return typescript_1.factory.updateMethodDeclaration(node, node.modifiers, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, typescript_1.factory.updateBlock(node.body, statements));
130
130
  }
131
- else if ((0, typescript_1.isConstructorDeclaration)(node)) {
132
- return typescript_1.factory.updateConstructorDeclaration(node, node.modifiers, node.parameters, typescript_1.factory.updateBlock(node.body, statements));
133
- }
134
131
  else {
135
132
  return typescript_1.factory.updateFunctionDeclaration(node, node.modifiers, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, typescript_1.factory.updateBlock(node.body, statements));
136
133
  }
@@ -146,7 +143,7 @@ function transformArrowFunctionWithInjectedZones(node, name) {
146
143
  }
147
144
  const statements = remapStatementsWithZoneEnd(node.body).map(transformNestedStatementsToInjectEndZones);
148
145
  // Zone start declaration.
149
- statements.unshift(createTraceZoneBeginNExpression(`${name}@lua`));
146
+ statements.unshift(createTraceZoneBeginNExpression(`lua::function::${name}`));
150
147
  // Zone end declaration without explicit return.
151
148
  if (!hasReturnStatement) {
152
149
  statements.push(createTraceZoneEndExpression());
package/types/index.d.ts CHANGED
@@ -1,55 +1,55 @@
1
- import "./xr_ai/xr_action";
2
- import "./xr_ai/xr_alife";
3
- import "./xr_ai/xr_enemy_evaluation";
4
- import "./xr_ai/xr_goap";
5
- import "./xr_ai/xr_graph";
6
- import "./xr_ai/xr_memory";
7
-
8
- import "./xr_lib/xr_animation";
9
- import "./xr_lib/xr_bitwise";
10
- import "./xr_lib/xr_color";
11
- import "./xr_lib/xr_debug";
12
- import "./xr_lib/xr_dialog";
13
- import "./xr_lib/xr_flags";
14
- import "./xr_lib/xr_fs";
15
- import "./xr_lib/xr_game";
16
- import "./xr_lib/xr_hit";
17
- import "./xr_lib/xr_ini";
18
- import "./xr_lib/xr_level";
19
- import "./xr_lib/xr_luabind";
20
- import "./xr_lib/xr_map";
21
- import "./xr_lib/xr_math";
22
- import "./xr_lib/xr_multiplayer";
23
- import "./xr_lib/xr_profile";
24
- import "./xr_lib/xr_properties";
25
- import "./xr_lib/xr_relation";
26
- import "./xr_lib/xr_render";
27
- import "./xr_lib/xr_save";
28
- import "./xr_lib/xr_sound";
29
- import "./xr_lib/xr_stats";
30
- import "./xr_lib/xr_task";
31
- import "./xr_lib/xr_time";
32
- import "./xr_lib/xr_type";
33
-
34
- import "./xr_object/client/xr_anomaly";
35
- import "./xr_object/client/xr_artefact";
36
- import "./xr_object/client/xr_client_object";
37
- import "./xr_object/client/xr_creature";
38
- import "./xr_object/client/xr_item";
39
- import "./xr_object/client/xr_level";
40
- import "./xr_object/client/xr_physic";
41
- import "./xr_object/client/xr_zone";
42
- import "./xr_object/script/xr_script_interface";
43
- import "./xr_object/script/xr_script_object";
44
- import "./xr_object/script/xr_script_trade";
45
- import "./xr_object/server/xr_server_object";
46
-
47
- import "./xr_ui/xr_ui_asset";
48
- import "./xr_ui/xr_ui_core";
49
- import "./xr_ui/xr_ui_event";
50
- import "./xr_ui/xr_ui_interface";
51
- import "./xr_ui/xr_ui_menu";
52
-
53
- import "./xrf_plugin";
54
-
55
- declare module "xray16" {}
1
+ import "./xr_ai/xr_action";
2
+ import "./xr_ai/xr_alife";
3
+ import "./xr_ai/xr_enemy_evaluation";
4
+ import "./xr_ai/xr_goap";
5
+ import "./xr_ai/xr_graph";
6
+ import "./xr_ai/xr_memory";
7
+
8
+ import "./xr_lib/xr_animation";
9
+ import "./xr_lib/xr_bitwise";
10
+ import "./xr_lib/xr_color";
11
+ import "./xr_lib/xr_debug";
12
+ import "./xr_lib/xr_dialog";
13
+ import "./xr_lib/xr_flags";
14
+ import "./xr_lib/xr_fs";
15
+ import "./xr_lib/xr_game";
16
+ import "./xr_lib/xr_hit";
17
+ import "./xr_lib/xr_ini";
18
+ import "./xr_lib/xr_level";
19
+ import "./xr_lib/xr_luabind";
20
+ import "./xr_lib/xr_map";
21
+ import "./xr_lib/xr_math";
22
+ import "./xr_lib/xr_multiplayer";
23
+ import "./xr_lib/xr_profile";
24
+ import "./xr_lib/xr_properties";
25
+ import "./xr_lib/xr_relation";
26
+ import "./xr_lib/xr_render";
27
+ import "./xr_lib/xr_save";
28
+ import "./xr_lib/xr_sound";
29
+ import "./xr_lib/xr_stats";
30
+ import "./xr_lib/xr_task";
31
+ import "./xr_lib/xr_time";
32
+ import "./xr_lib/xr_type";
33
+
34
+ import "./xr_object/client/xr_anomaly";
35
+ import "./xr_object/client/xr_artefact";
36
+ import "./xr_object/client/xr_client_object";
37
+ import "./xr_object/client/xr_creature";
38
+ import "./xr_object/client/xr_item";
39
+ import "./xr_object/client/xr_level";
40
+ import "./xr_object/client/xr_physic";
41
+ import "./xr_object/client/xr_zone";
42
+ import "./xr_object/script/xr_script_interface";
43
+ import "./xr_object/script/xr_script_object";
44
+ import "./xr_object/script/xr_script_trade";
45
+ import "./xr_object/server/xr_server_object";
46
+
47
+ import "./xr_ui/xr_ui_asset";
48
+ import "./xr_ui/xr_ui_core";
49
+ import "./xr_ui/xr_ui_event";
50
+ import "./xr_ui/xr_ui_interface";
51
+ import "./xr_ui/xr_ui_menu";
52
+
53
+ import "./xrf_plugin";
54
+
55
+ declare module "xray16" {}