@rbxts/types 1.0.792 → 1.0.794
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/include/lua.d.ts +1 -1
- package/include/roblox.d.ts +10 -0
- package/package.json +1 -1
package/include/lua.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ interface LuaMetatable<T> {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
/** Sets the metatable for the given table. If `metatable` is nil, the metatable of the given table is removed. If the original metatable has a "__metatable" field, this will raise an error. This function returns the table t, which was passed to the function. */
|
|
104
|
-
declare function setmetatable<T extends object>(object: T, metatable: LuaMetatable<T>): T;
|
|
104
|
+
declare function setmetatable<T extends object>(object: T, metatable: LuaMetatable<T> | undefined): T;
|
|
105
105
|
|
|
106
106
|
/** An object the represents a date or time. Used with `os.date` and `os.time`. */
|
|
107
107
|
interface DateTable {
|
package/include/roblox.d.ts
CHANGED
|
@@ -810,6 +810,16 @@ interface InstanceConstructor {
|
|
|
810
810
|
* You can read [this thread on the developer forum](https://devforum.roblox.com/t/psa-dont-use-instance-new-with-parent-argument/30296) for more information.
|
|
811
811
|
*/
|
|
812
812
|
new <T extends keyof CreatableInstances>(className: T, parent?: Instance): CreatableInstances[T];
|
|
813
|
+
/**
|
|
814
|
+
* Creates a new object with the same type and property values as an existing object. In most cases using `Instance:Clone()` is more appropriate, but this constructor is useful when implementing low‑level libraries or systems.
|
|
815
|
+
*
|
|
816
|
+
* There are two behavioral differences between this constructor and the `Instance:Clone()` method:
|
|
817
|
+
* - This constructor will not copy any of the descendant `Instances` parented to the existing object.
|
|
818
|
+
* - This constructor will return a new object even if the existing object had `Instance.Archivable` set to `false`.
|
|
819
|
+
*/
|
|
820
|
+
fromExisting: <T extends keyof CreatableInstances>(
|
|
821
|
+
existingInstance: CreatableInstances[T],
|
|
822
|
+
) => CreatableInstances[T];
|
|
813
823
|
}
|
|
814
824
|
|
|
815
825
|
declare const Instance: InstanceConstructor;
|