@tilua-types/roblox 4.2.0 → 5.0.0
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/README.md +3 -2
- package/index.d.tilua +56 -76
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @tilua-types/roblox
|
|
2
2
|
|
|
3
3
|
Luau and the whole Roblox API as tilua types: every class (921 of them), enum
|
|
4
|
-
(633), data type, service and global, plus what Luau adds to Lua —
|
|
4
|
+
(633), data type, service and global, plus what Luau adds to Lua —
|
|
5
5
|
`buffer`, `bit32`, `utf8`, `table.create`, `string.split`, `math.clamp`, ...
|
|
6
6
|
|
|
7
7
|
Luau is Roblox's language, so the two ship together. Underneath is
|
|
@@ -27,7 +27,8 @@ tree, down to `script.Parent`.
|
|
|
27
27
|
`declare class` (`Part extends FormFactorPart extends BasePart ...`). A
|
|
28
28
|
`Part` passes wherever a `BasePart` or `Instance` is expected, but a
|
|
29
29
|
`Folder` does not pass as a `Part`, and a table never passes as an
|
|
30
|
-
`Instance`. `typeof
|
|
30
|
+
`Instance`. `typeof instance` is `"Instance"`: `TypeofNames` tells the
|
|
31
|
+
language's `typeof` what each Roblox value answers.
|
|
31
32
|
- **Events with typed arguments.** In `Players.PlayerAdded:Connect(function(player) ... end)`,
|
|
32
33
|
`player` is a `Player`. Callbacks assigned to a property, such as
|
|
33
34
|
`remote.OnServerInvoke = function(player, ...)`, are typed the same way.
|
package/index.d.tilua
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
--
|
|
12
12
|
-- Every Roblox type is a `declare class`: nominal, the way the engine sees it.
|
|
13
13
|
-- A `Part` is an `Instance` because it extends one, and a table is never a
|
|
14
|
-
-- `Part`. Classes are not tables, so `typeof
|
|
14
|
+
-- `Part`. Classes are not tables, so `typeof part` is "Instance".
|
|
15
15
|
--
|
|
16
16
|
-- `inst:IsA("Model")`, `game:GetService("Players")` and `Instance.new("Part")`
|
|
17
17
|
-- are generic signatures over the maps at the end of this file: `K` infers the
|
|
18
18
|
-- string literal that was passed, and the map gives back its class.
|
|
19
19
|
--
|
|
20
|
-
-- The file opens with what Luau adds to Lua 5.1 (`
|
|
20
|
+
-- The file opens with what Luau adds to Lua 5.1 (`buffer`, `bit32`,
|
|
21
21
|
-- ...), copied from scripts/luau.d.tilua — Luau is Roblox's, so they ship
|
|
22
22
|
-- together. The Lua 5.1 standard library underneath is `@tilua-types/lua`.
|
|
23
23
|
|
|
@@ -32,28 +32,6 @@
|
|
|
32
32
|
--
|
|
33
33
|
-- Edit this file, then regenerate the Roblox definitions.
|
|
34
34
|
|
|
35
|
-
-- ============================================================
|
|
36
|
-
-- `typeof()`
|
|
37
|
-
-- ------------------------------------------------------------
|
|
38
|
-
-- Luau's own: `type()`'s answers plus the Roblox data types further down this
|
|
39
|
-
-- file, which it reports by name rather than as `userdata`. Narrowing works
|
|
40
|
-
-- exactly as it does for `type()` — see `@tilua-types/lua` for how the overloads
|
|
41
|
-
-- drive it.
|
|
42
|
-
-- ============================================================
|
|
43
|
-
|
|
44
|
-
declare function typeof(value: nil): "nil"
|
|
45
|
-
declare function typeof(value: boolean): "boolean"
|
|
46
|
-
declare function typeof(value: number): "number"
|
|
47
|
-
declare function typeof(value: string): "string"
|
|
48
|
-
declare function typeof(value: thread): "thread"
|
|
49
|
-
declare function typeof(value: buffer): "buffer"
|
|
50
|
-
declare function typeof(value: (...args: unknown[]) => unknown): "function"
|
|
51
|
-
declare function typeof(value: { [unknown]: unknown }): "table"
|
|
52
|
-
declare function typeof<T>(value: T): string
|
|
53
|
-
|
|
54
|
-
-- Luau's `type()` knows one answer Lua's does not.
|
|
55
|
-
declare function type(value: buffer): "buffer"
|
|
56
|
-
|
|
57
35
|
-- ============================================================
|
|
58
36
|
-- Base library
|
|
59
37
|
-- ============================================================
|
|
@@ -8945,7 +8923,7 @@ declare class Instance extends Object {
|
|
|
8945
8923
|
UniqueId: UniqueId,
|
|
8946
8924
|
AddTag: (self: Instance, tag: string) => nil,
|
|
8947
8925
|
ClearAllChildren: (self: Instance) => nil,
|
|
8948
|
-
Clone: (self:
|
|
8926
|
+
Clone: <T extends Instance>(self: T) => T,
|
|
8949
8927
|
Destroy: (self: Instance) => nil,
|
|
8950
8928
|
FindFirstAncestor: <T = Instance>(self: Instance, name: string) => T | nil,
|
|
8951
8929
|
FindFirstAncestorOfClass: <K extends keyof ClassMap>(self: Instance, className: K) => ClassMap[K] | nil,
|
|
@@ -19817,54 +19795,56 @@ type CreatableClassMap = {
|
|
|
19817
19795
|
WrapTextureTransfer: WrapTextureTransfer,
|
|
19818
19796
|
}
|
|
19819
19797
|
|
|
19820
|
-
-- `
|
|
19821
|
-
--
|
|
19822
|
-
-- the
|
|
19823
|
-
--
|
|
19824
|
-
|
|
19825
|
-
|
|
19826
|
-
|
|
19827
|
-
|
|
19828
|
-
|
|
19829
|
-
|
|
19830
|
-
|
|
19831
|
-
|
|
19832
|
-
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
|
|
19837
|
-
|
|
19838
|
-
|
|
19839
|
-
|
|
19840
|
-
|
|
19841
|
-
|
|
19842
|
-
|
|
19843
|
-
|
|
19844
|
-
|
|
19845
|
-
|
|
19846
|
-
|
|
19847
|
-
|
|
19848
|
-
|
|
19849
|
-
|
|
19850
|
-
|
|
19851
|
-
|
|
19852
|
-
|
|
19853
|
-
|
|
19854
|
-
|
|
19855
|
-
|
|
19856
|
-
|
|
19857
|
-
|
|
19858
|
-
|
|
19859
|
-
|
|
19860
|
-
|
|
19861
|
-
|
|
19862
|
-
|
|
19863
|
-
|
|
19864
|
-
|
|
19865
|
-
|
|
19866
|
-
|
|
19867
|
-
|
|
19868
|
-
|
|
19869
|
-
|
|
19870
|
-
|
|
19798
|
+
-- What `typeof` answers for a Roblox value: the data type's own name, or
|
|
19799
|
+
-- "Instance", "EnumItem", ... Each property is the name `typeof` gives a
|
|
19800
|
+
-- value of the property's type, and a value several of them fit — a `Part`
|
|
19801
|
+
-- is an `Instance` and an `Object` — is the first one's. A class is never a
|
|
19802
|
+
-- table, so none of these is an "array" or an "object".
|
|
19803
|
+
type TypeofNames = {
|
|
19804
|
+
Axes: Axes,
|
|
19805
|
+
BrickColor: BrickColor,
|
|
19806
|
+
CFrame: CFrame,
|
|
19807
|
+
CatalogSearchParams: CatalogSearchParams,
|
|
19808
|
+
Color3: Color3,
|
|
19809
|
+
ColorSequence: ColorSequence,
|
|
19810
|
+
ColorSequenceKeypoint: ColorSequenceKeypoint,
|
|
19811
|
+
Content: Content,
|
|
19812
|
+
DateTime: DateTime,
|
|
19813
|
+
DockWidgetPluginGuiInfo: DockWidgetPluginGuiInfo,
|
|
19814
|
+
Faces: Faces,
|
|
19815
|
+
FloatCurveKey: FloatCurveKey,
|
|
19816
|
+
Font: Font,
|
|
19817
|
+
InstanceHandle: InstanceHandle,
|
|
19818
|
+
NumberRange: NumberRange,
|
|
19819
|
+
NumberSequence: NumberSequence,
|
|
19820
|
+
NumberSequenceKeypoint: NumberSequenceKeypoint,
|
|
19821
|
+
OverlapParams: OverlapParams,
|
|
19822
|
+
Path2DControlPoint: Path2DControlPoint,
|
|
19823
|
+
PathWaypoint: PathWaypoint,
|
|
19824
|
+
PhysicalProperties: PhysicalProperties,
|
|
19825
|
+
RBXScriptConnection: RBXScriptConnection,
|
|
19826
|
+
Random: Random,
|
|
19827
|
+
Ray: Ray,
|
|
19828
|
+
RaycastParams: RaycastParams,
|
|
19829
|
+
Rect: Rect,
|
|
19830
|
+
Region3: Region3,
|
|
19831
|
+
Region3int16: Region3int16,
|
|
19832
|
+
RotationCurveKey: RotationCurveKey,
|
|
19833
|
+
Secret: Secret,
|
|
19834
|
+
SecurityCapabilities: SecurityCapabilities,
|
|
19835
|
+
SharedTable: SharedTable,
|
|
19836
|
+
TweenInfo: TweenInfo,
|
|
19837
|
+
UDim: UDim,
|
|
19838
|
+
UDim2: UDim2,
|
|
19839
|
+
User: User,
|
|
19840
|
+
ValueCurveKey: ValueCurveKey,
|
|
19841
|
+
Vector2: Vector2,
|
|
19842
|
+
Vector2int16: Vector2int16,
|
|
19843
|
+
Vector3: Vector3,
|
|
19844
|
+
Vector3int16: Vector3int16,
|
|
19845
|
+
Instance: Instance,
|
|
19846
|
+
Object: Object,
|
|
19847
|
+
EnumItem: EnumItem,
|
|
19848
|
+
Enum: Enum,
|
|
19849
|
+
Enums: Enums,
|
|
19850
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tilua-types/roblox",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Luau and the whole Roblox API as tilua types: every class, enum, data type, service and global",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@tilua/parser": "^3.1.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@tilua-types/lua": "^
|
|
21
|
+
"@tilua-types/lua": "^5.0.0"
|
|
22
22
|
},
|
|
23
23
|
"keywords": [
|
|
24
24
|
"tilua",
|