File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ /// <reference no-default-lib="true"/>
2+ /// <reference types="@rbxts/types"/>
3+
4+ /**
5+ * A WeakRef object is a reference to an object that does not prevent the object from being garbage collected.
6+ * Note that references to Roblox instances are never weak.
7+ */
8+ interface WeakRef < T extends object > {
9+ /**
10+ * **DO NOT USE!**
11+ *
12+ * This field exists to force TypeScript to recognize this as a nominal type
13+ * @hidden
14+ * @deprecated
15+ */
16+ readonly _nominal_WeakRef : unique symbol ;
17+
18+ /**
19+ * Returns the WeakRef instance's target value, or undefined if the target value has been reclaimed.
20+ */
21+ deref ( ) : T | undefined ;
22+ }
23+
24+ interface WeakRefConstructor {
25+ /**
26+ * Creates a WeakRef instance for the given target value.
27+ * @param target The target value for the WeakRef instance.
28+ */
29+ new < T extends object > ( target : T ) : WeakRef < T > ;
30+ }
31+ declare const WeakRef : WeakRefConstructor ;
You can’t perform that action at this time.
0 commit comments