@rbxts/types 1.0.689 → 1.0.690
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/roblox.d.ts +74 -1
- package/package.json +1 -1
package/include/roblox.d.ts
CHANGED
|
@@ -1875,6 +1875,8 @@ type RotationCurveKeyConstructor = new (
|
|
|
1875
1875
|
) => RotationCurveKey;
|
|
1876
1876
|
declare const RotationCurveKey: RotationCurveKeyConstructor;
|
|
1877
1877
|
|
|
1878
|
+
declare const SharedTableNominal: unique symbol;
|
|
1879
|
+
type SharedTableValue = boolean | number | Vector3 | string | SharedTable | Instance | typeof SharedTableNominal;
|
|
1878
1880
|
// SharedTable
|
|
1879
1881
|
interface SharedTable {
|
|
1880
1882
|
/**
|
|
@@ -1884,9 +1886,80 @@ interface SharedTable {
|
|
|
1884
1886
|
* @hidden
|
|
1885
1887
|
* @deprecated
|
|
1886
1888
|
*/
|
|
1887
|
-
readonly _nominal_SharedTable:
|
|
1889
|
+
readonly _nominal_SharedTable: typeof SharedTableNominal;
|
|
1890
|
+
[K: string | number]: SharedTableValue;
|
|
1888
1891
|
}
|
|
1889
1892
|
|
|
1893
|
+
interface SharedTableConstructor {
|
|
1894
|
+
/** Returns a new, empty SharedTable. */
|
|
1895
|
+
new (): SharedTable;
|
|
1896
|
+
/** Returns a new SharedTable containing elements equivalent to those in the provided object. */
|
|
1897
|
+
new (t: object): SharedTable;
|
|
1898
|
+
/** Removes all of the elements from the SharedTable. */
|
|
1899
|
+
clear: (st: SharedTable) => void;
|
|
1900
|
+
/**
|
|
1901
|
+
* Creates a clone of a SharedTable and returns the clone.
|
|
1902
|
+
*
|
|
1903
|
+
* If the optional deep argument is not present, or if it is present and its value is false, then a shallow clone is created.
|
|
1904
|
+
* A shallow clone copies only the top-level SharedTable object. If any value in the SharedTable itself is a SharedTable, then both the original SharedTable and the clone SharedTable will refer to the same SharedTable.
|
|
1905
|
+
*
|
|
1906
|
+
* The shallow clone operation is atomic, so the clone SharedTable will contain a consistent snapshot of the state in the original SharedTable, even if it is being modified concurrently from other scripts.
|
|
1907
|
+
*
|
|
1908
|
+
* If the optional deep argument is present and its value is true, then a deep clone is created.
|
|
1909
|
+
* A deep clone recursively copies a structure of SharedTable objects, such that there is no state shared between the original SharedTable and the clone.
|
|
1910
|
+
*
|
|
1911
|
+
* The clone of each SharedTable within the graph of SharedTable objects is atomic, but the deep clone as a whole is not atomic.
|
|
1912
|
+
* Thus, the clone of each SharedTable within the graph will contain a consistent snapshot of the state of the original SharedTable object from which it was cloned, but the states of different SharedTable objects may be inconsistent if the graph is being modified concurrently from other scripts.
|
|
1913
|
+
*
|
|
1914
|
+
* The SharedTable object(s) being cloned may be frozen (read-only) or not.
|
|
1915
|
+
* Regardless, the newly created clones are not frozen (and are thus modifiable).
|
|
1916
|
+
* To create frozen clones, use the SharedTable.cloneAndFreeze function.
|
|
1917
|
+
*/
|
|
1918
|
+
clone: (st: SharedTable, deep?: boolean) => SharedTable;
|
|
1919
|
+
/**
|
|
1920
|
+
* Creates a frozen (read-only) clone of a SharedTable and returns the clone.
|
|
1921
|
+
* The behavior of this function is the same as the behavior of clone, except that the clone is frozen.
|
|
1922
|
+
*
|
|
1923
|
+
* If a deep clone is requested, then all of the cloned SharedTable objects are frozen.
|
|
1924
|
+
*/
|
|
1925
|
+
cloneAndFreeze: (st: SharedTable, deep?: boolean) => SharedTable;
|
|
1926
|
+
/**
|
|
1927
|
+
* Atomically increments the value of an element.
|
|
1928
|
+
* An element with the specified key must exist in the SharedTable, and it must be of type number.
|
|
1929
|
+
* The specified delta is added to the value, and the original value is returned.
|
|
1930
|
+
*
|
|
1931
|
+
* The SharedTable.update function can also be used for this purpose; this increment function exists for convenience and performance.
|
|
1932
|
+
* In general, increment is much faster than update, so it should be preferred where possible.
|
|
1933
|
+
*/
|
|
1934
|
+
increment: (st: SharedTable, k: string | number, delta: number) => number;
|
|
1935
|
+
/** Returns true if the SharedTable is frozen (read-only). */
|
|
1936
|
+
isFrozen: (st: SharedTable) => boolean;
|
|
1937
|
+
/**
|
|
1938
|
+
* Returns the number of elements stored in the SharedTable.
|
|
1939
|
+
* Note that if other scripts are concurrently modifying the SharedTable, the returned size may no longer be correct after it is returned, since other scripts may have added or removed elements from the SharedTable.
|
|
1940
|
+
*/
|
|
1941
|
+
size: (st: SharedTable) => number;
|
|
1942
|
+
/**
|
|
1943
|
+
* Atomically updates the value of an element.
|
|
1944
|
+
*
|
|
1945
|
+
* When a SharedTable is accessed concurrently from scripts running in different execution contexts, it is possible for their accesses to interleave unpredictably.
|
|
1946
|
+
* Because of this, code like the following is generally incorrect, because the value may have changed between the read on the first line and the update on the second line:
|
|
1947
|
+
* ```ts
|
|
1948
|
+
* const oldValue = st["x"];
|
|
1949
|
+
* st["x"] = oldValue + ",x";
|
|
1950
|
+
* ```
|
|
1951
|
+
* The update function makes it possible to perform an atomic update to an element.
|
|
1952
|
+
* It takes a function that it will call with the current value of the element.
|
|
1953
|
+
* The function can then compute and return the new value.
|
|
1954
|
+
* Note that the function may be called multiple times if the SharedTable is being concurrently modified from other scripts.
|
|
1955
|
+
*
|
|
1956
|
+
* If the SharedTable is frozen, the operation fails and an error will be raised.
|
|
1957
|
+
*/
|
|
1958
|
+
update: (st: SharedTable, k: string | number, f: (v: SharedTableValue) => SharedTableValue) => void;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
declare const SharedTable: SharedTableConstructor;
|
|
1962
|
+
|
|
1890
1963
|
// TextChatMessage
|
|
1891
1964
|
interface TextChatMessage {
|
|
1892
1965
|
/**
|