@quenty/animations 8.26.0 → 8.26.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.26.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/animations@8.26.0...@quenty/animations@8.26.1) (2026-01-21)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * Enhance annotations ([1a19df4](https://github.com/Quenty/NevermoreEngine/commit/1a19df4ce6ae80aa978c96e300151ea7005bd5f0))
12
+
13
+
14
+
15
+
16
+
6
17
  # [8.26.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/animations@8.25.0...@quenty/animations@8.26.0) (2026-01-18)
7
18
 
8
19
  **Note:** Version bump only for package @quenty/animations
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/animations",
3
- "version": "8.26.0",
3
+ "version": "8.26.1",
4
4
  "description": "Utility methods for playing back animations on Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -31,18 +31,18 @@
31
31
  "@quenty/baseobject": "10.9.3",
32
32
  "@quenty/enumutils": "3.4.5",
33
33
  "@quenty/humanoidanimatorutils": "3.2.3",
34
- "@quenty/instanceutils": "13.24.0",
34
+ "@quenty/instanceutils": "13.24.1",
35
35
  "@quenty/loader": "10.9.3",
36
36
  "@quenty/maid": "3.5.3",
37
37
  "@quenty/promise": "10.13.0",
38
38
  "@quenty/promisemaid": "5.13.0",
39
39
  "@quenty/rbxasset": "5.10.3",
40
- "@quenty/rx": "13.23.0",
40
+ "@quenty/rx": "13.23.1",
41
41
  "@quenty/signal": "7.11.5",
42
- "@quenty/valueobject": "13.25.0"
42
+ "@quenty/valueobject": "13.25.1"
43
43
  },
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  },
47
- "gitHead": "1f5d9bafb4e17d73030b5673eb979e0661b6d95a"
47
+ "gitHead": "cc1fcc17caeaae61ff9337195df211376a5c691f"
48
48
  }
@@ -9,6 +9,7 @@ local require = require(script.Parent.loader).load(script)
9
9
 
10
10
  local AnimationUtils = require("AnimationUtils")
11
11
  local BaseObject = require("BaseObject")
12
+ local Maid = require("Maid")
12
13
  local Rx = require("Rx")
13
14
  local Signal = require("Signal")
14
15
  local ValueObject = require("ValueObject")
@@ -17,17 +18,19 @@ local AnimationTrackPlayer = setmetatable({}, BaseObject)
17
18
  AnimationTrackPlayer.ClassName = "AnimationTrackPlayer"
18
19
  AnimationTrackPlayer.__index = AnimationTrackPlayer
19
20
 
21
+ type AnimationId = string | number
22
+
20
23
  export type AnimationTrackPlayer =
21
24
  typeof(setmetatable(
22
25
  {} :: {
23
26
  -- Public
24
- KeyframeReached: Signal.Signal<()>,
27
+ KeyframeReached: Signal.Signal<string>,
25
28
 
26
29
  -- Private
27
- _animationTarget: ValueObject.ValueObject<Instance>,
28
- _trackId: ValueObject.ValueObject<string | number>,
30
+ _animationTarget: ValueObject.ValueObject<Instance?>,
31
+ _trackId: ValueObject.ValueObject<AnimationId?>,
29
32
  _currentTrack: ValueObject.ValueObject<AnimationTrack?>,
30
- _animationPriority: ValueObject.ValueObject<number>,
33
+ _animationPriority: ValueObject.ValueObject<number?>,
31
34
  },
32
35
  {} :: typeof({ __index = AnimationTrackPlayer })
33
36
  ))
@@ -36,12 +39,11 @@ export type AnimationTrackPlayer =
36
39
  --[=[
37
40
  Plays an animation track in the target. Async loads the track when
38
41
  all data is found.
39
-
40
- @param animationTarget Instance | Observable<Instance>
41
- @param animationId string | number?
42
- @return AnimationTrackPlayer
43
42
  ]=]
44
- function AnimationTrackPlayer.new(animationTarget, animationId: string | number): AnimationTrackPlayer
43
+ function AnimationTrackPlayer.new(
44
+ animationTarget: ValueObject.Mountable<Instance?>,
45
+ animationId: AnimationId?
46
+ ): AnimationTrackPlayer
45
47
  local self: AnimationTrackPlayer = setmetatable(BaseObject.new() :: any, AnimationTrackPlayer)
46
48
 
47
49
  self._animationTarget = self._maid:Add(ValueObject.new(nil))
@@ -49,7 +51,7 @@ function AnimationTrackPlayer.new(animationTarget, animationId: string | number)
49
51
  self._currentTrack = self._maid:Add(ValueObject.new(nil))
50
52
  self._animationPriority = self._maid:Add(ValueObject.new(nil))
51
53
 
52
- self.KeyframeReached = self._maid:Add(Signal.new())
54
+ self.KeyframeReached = self._maid:Add(Signal.new() :: any)
53
55
 
54
56
  if animationTarget then
55
57
  self:SetAnimationTarget(animationTarget)
@@ -64,7 +66,7 @@ function AnimationTrackPlayer.new(animationTarget, animationId: string | number)
64
66
  return self
65
67
  end
66
68
 
67
- function AnimationTrackPlayer:_setupState()
69
+ function AnimationTrackPlayer._setupState(self: AnimationTrackPlayer): ()
68
70
  self._maid:GiveTask(Rx.combineLatest({
69
71
  animationTarget = self._animationTarget:Observe(),
70
72
  trackId = self._trackId:Observe(),
@@ -95,7 +97,7 @@ function AnimationTrackPlayer:_setupState()
95
97
  end
96
98
 
97
99
  local maid = brio:ToMaid()
98
- local track = brio:GetValue()
100
+ local track = brio:GetValue() :: AnimationTrack
99
101
 
100
102
  maid:GiveTask(track.KeyframeReached:Connect(function(...)
101
103
  self.KeyframeReached:Fire(...)
@@ -105,39 +107,40 @@ end
105
107
 
106
108
  --[=[
107
109
  Sets the animation id to play
108
-
109
- @param animationId string | number
110
110
  ]=]
111
- function AnimationTrackPlayer:SetAnimationId(animationId: string | number)
111
+ function AnimationTrackPlayer.SetAnimationId(
112
+ self: AnimationTrackPlayer,
113
+ animationId: ValueObject.Mountable<AnimationId?>
114
+ ): Maid.MaidTask
112
115
  return self._trackId:Mount(animationId)
113
116
  end
114
117
 
115
118
  --[=[
116
119
  Returns the current animation id
117
-
118
- @return string | number
119
120
  ]=]
120
- function AnimationTrackPlayer:GetAnimationId(): string | number
121
+ function AnimationTrackPlayer.GetAnimationId(self: AnimationTrackPlayer): AnimationId?
121
122
  return self._trackId.Value
122
123
  end
123
124
 
124
125
  --[=[
125
126
  Sets an animation target to play the animation on
126
-
127
- @param animationTarget Instance | Observable<Instance>
128
127
  ]=]
129
- function AnimationTrackPlayer:SetAnimationTarget(animationTarget)
128
+ function AnimationTrackPlayer.SetAnimationTarget(
129
+ self: AnimationTrackPlayer,
130
+ animationTarget: ValueObject.Mountable<Instance?>
131
+ ): Maid.MaidTask
130
132
  return self._animationTarget:Mount(animationTarget)
131
133
  end
132
134
 
133
135
  --[=[
134
136
  Sets the weight target if it hasn't been set
135
-
136
- @param weight number
137
- @param fadeTime number
138
137
  ]=]
139
- function AnimationTrackPlayer:SetWeightTargetIfNotSet(weight: number, fadeTime: number)
140
- self._maid._adjustWeight = self:_onEachTrack(function(track)
138
+ function AnimationTrackPlayer.SetWeightTargetIfNotSet(
139
+ self: AnimationTrackPlayer,
140
+ weight: number?,
141
+ fadeTime: number?
142
+ ): ()
143
+ self._maid._adjustWeight = self:_onEachTrack(function(track: AnimationTrack)
141
144
  if track.WeightTarget ~= weight then
142
145
  track:AdjustWeight(weight, fadeTime)
143
146
  end
@@ -146,12 +149,8 @@ end
146
149
 
147
150
  --[=[
148
151
  Plays the current animation specified
149
-
150
- @param fadeTime number
151
- @param weight number
152
- @param speed number
153
152
  ]=]
154
- function AnimationTrackPlayer:Play(fadeTime: number, weight: number, speed: number)
153
+ function AnimationTrackPlayer.Play(self: AnimationTrackPlayer, fadeTime: number?, weight: number?, speed: number): ()
155
154
  if weight then
156
155
  self._maid._adjustWeight = nil
157
156
  end
@@ -161,54 +160,44 @@ function AnimationTrackPlayer:Play(fadeTime: number, weight: number, speed: numb
161
160
  end
162
161
 
163
162
  self._maid._stop = nil
164
- self._maid._play = self:_onEachTrack(function(track)
163
+ self._maid._play = self:_onEachTrack(function(track: AnimationTrack)
165
164
  track:Play(fadeTime, weight, speed)
166
165
  end)
167
166
  end
168
167
 
169
168
  --[=[
170
169
  Stops the current animation
171
-
172
- @param fadeTime number
173
170
  ]=]
174
- function AnimationTrackPlayer:Stop(fadeTime: number)
171
+ function AnimationTrackPlayer.Stop(self: AnimationTrackPlayer, fadeTime: number?): ()
175
172
  self._maid._play = nil
176
- self._maid._stop = self:_onEachTrack(function(track)
173
+ self._maid._stop = self:_onEachTrack(function(track: AnimationTrack)
177
174
  track:Stop(fadeTime)
178
175
  end)
179
176
  end
180
177
 
181
178
  --[=[
182
179
  Adjusts the weight of the animation track
183
-
184
- @param weight number
185
- @param fadeTime number
186
180
  ]=]
187
- function AnimationTrackPlayer:AdjustWeight(weight: number, fadeTime: number)
188
- self._maid._adjustWeight = self:_onEachTrack(function(track)
181
+ function AnimationTrackPlayer.AdjustWeight(self: AnimationTrackPlayer, weight: number?, fadeTime: number?): ()
182
+ self._maid._adjustWeight = self:_onEachTrack(function(track: AnimationTrack)
189
183
  track:AdjustWeight(weight, fadeTime)
190
184
  end)
191
185
  end
192
186
 
193
187
  --[=[
194
188
  Adjusts the speed of the animation track
195
-
196
- @param speed number
197
- @param fadeTime number
198
189
  ]=]
199
- function AnimationTrackPlayer:AdjustSpeed(speed: number, fadeTime: number)
200
- self._maid._adjustSpeed = self:_onEachTrack(function(track)
201
- track:AdjustSpeed(speed, fadeTime)
190
+ function AnimationTrackPlayer.AdjustSpeed(self: AnimationTrackPlayer, speed: number?): ()
191
+ self._maid._adjustSpeed = self:_onEachTrack(function(track: AnimationTrack)
192
+ track:AdjustSpeed(speed)
202
193
  end)
203
194
  end
204
195
 
205
196
  --[=[
206
197
  Returns true if playing
207
-
208
- @return boolean
209
198
  ]=]
210
- function AnimationTrackPlayer:IsPlaying(): boolean
211
- local track = self._currentTrack.Value
199
+ function AnimationTrackPlayer.IsPlaying(self: AnimationTrackPlayer): boolean
200
+ local track: AnimationTrack? = self._currentTrack.Value
212
201
  if track then
213
202
  return track.IsPlaying
214
203
  else
@@ -216,8 +205,8 @@ function AnimationTrackPlayer:IsPlaying(): boolean
216
205
  end
217
206
  end
218
207
 
219
- function AnimationTrackPlayer:_onEachTrack(callback)
220
- return self._currentTrack:Observe():Subscribe(function(track)
208
+ function AnimationTrackPlayer._onEachTrack(self: AnimationTrackPlayer, callback)
209
+ return self._currentTrack:Observe():Subscribe(function(track: AnimationTrack?)
221
210
  if track ~= nil then
222
211
  callback(track)
223
212
  end