@ts-defold/types 1.2.74 → 1.2.75

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 (2) hide show
  1. package/index.d.ts +27 -5
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /// <reference types="lua-types/5.1" />
4
4
  /// <reference types="lua-types/special/jit-only" />
5
5
 
6
- // DEFOLD. stable version 1.11.1 (758dfc0ea71dca26d169fddd0c5a1bc6dd0be4b3)
6
+ // DEFOLD. stable version 1.11.2 (a6d86c0083f00ee6c3709478ff3b33deff5e6d19)
7
7
 
8
8
  /**
9
9
  * All ids in the engine are represented as hashes, so a string needs to be hashed
@@ -3062,9 +3062,9 @@ end
3062
3062
  */
3063
3063
  export function animate(node: node, property: string | number, to: number | vmath.vector3 | vmath.vector4 | vmath.quaternion, easing: number | vmath.vector3 | vmath.vector4 | vmath.quaternion | ReturnType<typeof vmath.vector>, duration: number, delay?: number, complete_function?: (this: any, node: node,) => void, playback?: number): void;
3064
3064
  /**
3065
- * If an animation of the specified node is currently running (started by `gui.animate`), it will immediately be canceled.
3065
+ * If one or more animations of the specified node is currently running (started by `gui.animate`), they will immediately be canceled.
3066
3066
  * @param node node that should have its animation canceled
3067
- * @param property property for which the animation should be canceled
3067
+ * @param property optional property for which the animation should be canceled
3068
3068
 
3069
3069
  `"position"`
3070
3070
  `"rotation"`
@@ -3089,10 +3089,21 @@ local pos = vmath.vector3(100, 100, 0)
3089
3089
  gui.animate(node, "position", pos, go.EASING_LINEAR, 2)
3090
3090
  ...
3091
3091
  -- cancel animation of the x component.
3092
- gui.cancel_animation(node, "position.x")
3092
+ gui.cancel_animations(node, "position.x")
3093
+ ```
3094
+
3095
+ Cancels all property animations on a node in a single call:
3096
+ ```lua
3097
+ local node = gui.get_node("my_node")
3098
+ -- animate to new position and scale
3099
+ gui.animate(node, "position", vmath.vector3(100, 100, 0), go.EASING_LINEAR, 5)
3100
+ gui.animate(node, "scale", vmath.vector3(0.5), go.EASING_LINEAR, 5)
3101
+ ...
3102
+ -- cancel positioning and scaling at once
3103
+ gui.cancel_animations(node)
3093
3104
  ```
3094
3105
  */
3095
- export function cancel_animation(node: node, property: string | number): void;
3106
+ export function cancel_animations(node: node, property?: undefined | string | number): void;
3096
3107
  /**
3097
3108
  * Cancels any running flipbook animation on the specified node.
3098
3109
  * @param node node cancel flipbook animation for
@@ -11575,6 +11586,9 @@ print(vec - vmath.vector4(2.0)) --> vmath.vector4(-1, 0, 1, 2)
11575
11586
  */
11576
11587
  export function vector4(x: number, y: number, z: number, w: number): vmath.vector4;
11577
11588
  }declare namespace vmath {
11589
+ export function clamp(value: number, min: number | vmath.vector3 | vmath.vector4, max: number | vmath.vector3 | vmath.vector4): number;
11590
+ export function clamp(value: vmath.vector3, min: number | vmath.vector3 | vmath.vector4, max: number | vmath.vector3 | vmath.vector4): vmath.vector3;
11591
+ export function clamp(value: vmath.vector4, min: number | vmath.vector3 | vmath.vector4, max: number | vmath.vector3 | vmath.vector4): vmath.vector4;
11578
11592
  export type matrix4 = number & {
11579
11593
  /**
11580
11594
  * Multiplication Operator for Matrix4
@@ -11603,6 +11617,12 @@ export type matrix4 = number & {
11603
11617
  m33: number;
11604
11618
  m34: number;
11605
11619
  };
11620
+ export function mul_per_elem(v1: vmath.vector3, v2: vmath.vector3): vmath.vector3;
11621
+ export function mul_per_elem(v1: vmath.vector4, v2: vmath.vector4): vmath.vector4;
11622
+ export function normalize(v1: vmath.vector3): vmath.vector3;
11623
+ export function normalize(v1: vmath.vector4): vmath.vector4;
11624
+ export function normalize(v1: vmath.quaternion): vmath.quaternion;
11625
+ export function normalize(v1: vmath.vector): vmath.vector;
11606
11626
  export type quaternion = number & {
11607
11627
  /**
11608
11628
  * Multiplication Operator for Matrix4
@@ -11614,6 +11634,8 @@ export type quaternion = number & {
11614
11634
  z: number;
11615
11635
  w: number;
11616
11636
  };
11637
+ export function slerp(t: number, v1: vmath.vector3, v2: vmath.vector3): vmath.vector3;
11638
+ export function slerp(t: number, v1: vmath.vector4, v2: vmath.vector4): vmath.vector4;
11617
11639
  export type vector = number & { [key: number]: number };
11618
11640
  export type vector3 = number & {
11619
11641
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ts-defold/types",
3
- "version": "1.2.74",
3
+ "version": "1.2.75",
4
4
  "description": "TypeScript definitions for Defold",
5
5
  "repository": "github:ts-defold/types",
6
6
  "keywords": [
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "tsd-ext-type-gen": "^2.0.0",
31
31
  "typescript": "5.8.2",
32
- "typescript-to-lua": "~1.31.0"
32
+ "typescript-to-lua": "~1.32.0"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "typescript-to-lua": "^1.10.0"