@quenty/instanceutils 13.16.0 → 13.16.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,14 @@
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
+ ## [13.16.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/instanceutils@13.16.0...@quenty/instanceutils@13.16.1) (2025-03-21)
7
+
8
+ **Note:** Version bump only for package @quenty/instanceutils
9
+
10
+
11
+
12
+
13
+
6
14
  # [13.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/instanceutils@13.15.0...@quenty/instanceutils@13.16.0) (2025-02-18)
7
15
 
8
16
  **Note:** Version bump only for package @quenty/instanceutils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/instanceutils",
3
- "version": "13.16.0",
3
+ "version": "13.16.1",
4
4
  "description": "Utility functions involving instances in Roblox",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,14 +26,14 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/brio": "^14.16.0",
29
+ "@quenty/brio": "^14.16.1",
30
30
  "@quenty/loader": "^10.8.0",
31
31
  "@quenty/maid": "^3.4.0",
32
- "@quenty/rx": "^13.16.0",
32
+ "@quenty/rx": "^13.16.1",
33
33
  "@quenty/symbol": "^3.4.0"
34
34
  },
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "184a407d8d7366c39009444c3c9a7023cb176471"
38
+ "gitHead": "6b7c3e15e60cdb185986207b574e2b5591261e7a"
39
39
  }
@@ -29,7 +29,7 @@ local RxInstanceUtils = {}
29
29
  @param propertyName string
30
30
  @return Observable<T>
31
31
  ]=]
32
- function RxInstanceUtils.observeProperty(instance, propertyName)
32
+ function RxInstanceUtils.observeProperty(instance: Instance, propertyName: string)
33
33
  assert(typeof(instance) == "Instance", "'instance' should be of type Instance")
34
34
  assert(type(propertyName) == "string", "'propertyName' should be of type string")
35
35
 
@@ -49,7 +49,7 @@ end
49
49
  @param instance Instance
50
50
  @return Observable<Instance>
51
51
  ]=]
52
- function RxInstanceUtils.observeAncestry(instance)
52
+ function RxInstanceUtils.observeAncestry(instance: Instance)
53
53
  local startWithParent = Rx.start(function()
54
54
  return instance, instance.Parent
55
55
  end)
@@ -64,7 +64,7 @@ end
64
64
  @param className string
65
65
  @return Observable<Brio<Instance>>
66
66
  ]=]
67
- function RxInstanceUtils.observeFirstAncestorBrio(instance, className)
67
+ function RxInstanceUtils.observeFirstAncestorBrio(instance: Instance, className: string)
68
68
  assert(typeof(instance) == "Instance", "Bad instance")
69
69
  assert(type(className) == "string", "Bad className")
70
70
 
@@ -102,7 +102,7 @@ end
102
102
  @param instance Instance
103
103
  @return Observable<Brio<Instance>>
104
104
  ]=]
105
- function RxInstanceUtils.observeParentBrio(instance)
105
+ function RxInstanceUtils.observeParentBrio(instance: Instance)
106
106
  return RxInstanceUtils.observePropertyBrio(instance, "Parent", function(parent)
107
107
  return parent ~= nil
108
108
  end)
@@ -115,7 +115,7 @@ end
115
115
  @param className string
116
116
  @return Observable<Instance?>
117
117
  ]=]
118
- function RxInstanceUtils.observeFirstAncestor(instance, className)
118
+ function RxInstanceUtils.observeFirstAncestor(instance: Instance, className: string)
119
119
  assert(typeof(instance) == "Instance", "Bad instance")
120
120
  assert(type(className) == "string", "Bad className")
121
121
 
@@ -136,6 +136,8 @@ function RxInstanceUtils.observeFirstAncestor(instance, className)
136
136
  end)
137
137
  end
138
138
 
139
+ export type Predicate = (value: Instance) -> boolean
140
+
139
141
  --[=[
140
142
  Returns a brio of the property value
141
143
 
@@ -144,7 +146,7 @@ end
144
146
  @param predicate ((value: T) -> boolean)? -- Optional filter
145
147
  @return Observable<Brio<T>>
146
148
  ]=]
147
- function RxInstanceUtils.observePropertyBrio(instance, propertyName, predicate)
149
+ function RxInstanceUtils.observePropertyBrio(instance: Instance, propertyName: string, predicate: Predicate?)
148
150
  assert(typeof(instance) == "Instance", "Bad instance")
149
151
  assert(type(propertyName) == "string", "Bad propertyName")
150
152
  assert(type(predicate) == "function" or predicate == nil, "Bad predicate")
@@ -192,7 +194,7 @@ end
192
194
  @param name string
193
195
  @return Observable<Brio<Instance>>
194
196
  ]=]
195
- function RxInstanceUtils.observeLastNamedChildBrio(parent, className, name)
197
+ function RxInstanceUtils.observeLastNamedChildBrio(parent: Instance, className: string, name: string)
196
198
  assert(typeof(parent) == "Instance", "Bad parent")
197
199
  assert(type(className) == "string", "Bad className")
198
200
  assert(type(name) == "string", "Bad name")
@@ -246,7 +248,7 @@ end
246
248
  @param name string
247
249
  @return Observable<Brio<Instance>>
248
250
  ]=]
249
- function RxInstanceUtils.observeChildrenOfNameBrio(parent, className, name)
251
+ function RxInstanceUtils.observeChildrenOfNameBrio(parent: Instance, className: string, name: string)
250
252
  assert(typeof(parent) == "Instance", "Bad parent")
251
253
  assert(type(className) == "string", "Bad className")
252
254
  assert(type(name) == "string", "Bad name")
@@ -298,7 +300,7 @@ end
298
300
  @param className string
299
301
  @return Observable<Instance>
300
302
  ]=]
301
- function RxInstanceUtils.observeChildrenOfClassBrio(parent, className)
303
+ function RxInstanceUtils.observeChildrenOfClassBrio(parent: Instance, className: string)
302
304
  assert(typeof(parent) == "Instance", "Bad parent")
303
305
  assert(type(className) == "string", "Bad className")
304
306
 
@@ -314,7 +316,7 @@ end
314
316
  @param predicate ((value: Instance) -> boolean)? -- Optional filter
315
317
  @return Observable<Brio<Instance>>
316
318
  ]=]
317
- function RxInstanceUtils.observeChildrenBrio(parent, predicate)
319
+ function RxInstanceUtils.observeChildrenBrio(parent: Instance, predicate: Predicate?)
318
320
  assert(typeof(parent) == "Instance", "Bad parent")
319
321
  assert(type(predicate) == "function" or predicate == nil, "Bad predicate")
320
322
 
@@ -349,7 +351,7 @@ end
349
351
  @param predicate ((value: Instance) -> boolean)? -- Optional filter
350
352
  @return Observable<Instance, boolean>
351
353
  ]=]
352
- function RxInstanceUtils.observeDescendants(parent, predicate)
354
+ function RxInstanceUtils.observeDescendants(parent: Instance, predicate: Predicate?)
353
355
  assert(typeof(parent) == "Instance", "Bad parent")
354
356
  assert(type(predicate) == "function" or predicate == nil, "Bad predicate")
355
357
 
@@ -387,7 +389,7 @@ end
387
389
  @param predicate ((value: Instance) -> boolean)? -- Optional filter
388
390
  @return Observable<Brio<Instance>>
389
391
  ]=]
390
- function RxInstanceUtils.observeDescendantsBrio(parent, predicate)
392
+ function RxInstanceUtils.observeDescendantsBrio(parent: Instance, predicate: Predicate?)
391
393
  assert(typeof(parent) == "Instance", "Bad parent")
392
394
  assert(type(predicate) == "function" or predicate == nil, "Bad predicate")
393
395
 
@@ -415,7 +417,6 @@ function RxInstanceUtils.observeDescendantsBrio(parent, predicate)
415
417
  end)
416
418
  end
417
419
 
418
-
419
420
  --[=[
420
421
  Observes all descendants of a specific class
421
422
 
@@ -423,7 +424,7 @@ end
423
424
  @param className string
424
425
  @return Observable<Instance>
425
426
  ]=]
426
- function RxInstanceUtils.observeDescendantsOfClassBrio(parent, className)
427
+ function RxInstanceUtils.observeDescendantsOfClassBrio(parent: Instance, className: string)
427
428
  assert(typeof(parent) == "Instance", "Bad parent")
428
429
  assert(type(className) == "string", "Bad className")
429
430
 
@@ -432,4 +433,4 @@ function RxInstanceUtils.observeDescendantsOfClassBrio(parent, className)
432
433
  end)
433
434
  end
434
435
 
435
- return RxInstanceUtils
436
+ return RxInstanceUtils