@@ -13,6 +13,9 @@ declare namespace Binder {
1313}
1414
1515interface Binder < T extends Binder . BinderClass = Binder . BinderClass > {
16+ /** ClassName of Binder */
17+ readonly ClassName : string ;
18+
1619 /** Listens for new instances and connects to the GetInstanceAddedSignal() and removed signal! */
1720 Start ( ) : void ;
1821
@@ -22,6 +25,15 @@ interface Binder<T extends Binder.BinderClass = Binder.BinderClass> {
2225 /** Returns whatever was set for the construtor. Used for meta-analysis of the binder, such as extracting new */
2326 GetConstructor ( ) : Binder . BinderClassConstructor < T > ;
2427
28+ /** `Binder.ObserveInstance()` with Promise returned */
29+ Promise ( inst : Instance ) : Promise < T > ;
30+
31+ /**
32+ * Sets descendants whitelist to only binds object if that object is descendant of whitelisted one
33+ * @param descendants Whilelisted descendants
34+ */
35+ SetDescendantsWhitelist ( descendants : Instance [ ] ) : void ;
36+
2537 /**
2638 * Fired when added, and then after removal, but before destroy!
2739 * @param inst Instance
@@ -36,7 +48,7 @@ interface Binder<T extends Binder.BinderClass = Binder.BinderClass> {
3648 * const birdBinder = new Binder("Bird", require(path.to.Bird) as typeof Bird);
3749 * birdBinder.GetClassAddedSignal().Connect(bird => {
3850 * // Make the bird squack when it's first spawned
39- * bird.Squack();
51+ * bird.Squack();
4052 * });
4153 *
4254 * // Load all birds
@@ -62,10 +74,6 @@ interface Binder<T extends Binder.BinderClass = Binder.BinderClass> {
6274 */
6375 GetAll ( ) : T [ ] ;
6476
65- /**
66- * for (const [classObj] of thatBinder.GetAllSet()) {}
67- */
68-
6977 /**
7078 * Faster method to get all items in a binder
7179 *
@@ -83,7 +91,7 @@ interface Binder<T extends Binder.BinderClass = Binder.BinderClass> {
8391 *
8492 * birdBinder.Init()
8593 */
86- GetAllSet ( ) : Array < [ T , boolean ] > ;
94+ GetAllSet ( ) : Map < T , true > ;
8795
8896 /**
8997 * Binds an instance to this binder using collection service and attempts
@@ -101,6 +109,7 @@ interface Binder<T extends Binder.BinderClass = Binder.BinderClass> {
101109 * See ``.Bind()``
102110 *
103111 * Acknowledges the risk of doing this on the client.
112+ *
104113 * Using this acknowledges that we're intentionally binding on a safe client object,
105114 * i.e. one without replication. If another tag is changed on this instance, this tag will be lost/changed.
106115 */
@@ -141,7 +150,7 @@ interface BinderConstructor {
141150 * @param value
142151 * @returns boolean
143152 */
144- isBinder : < T extends Binder . BinderClass > ( object : unknown ) => object is Binder < T > ;
153+ isBinder : < T extends Binder . BinderClass = Binder . BinderClass > ( object : unknown ) => object is Binder < T > ;
145154}
146155
147156/**
0 commit comments