Skip to content

typeforge-luau/typebrick

Repository files navigation

Typebrick

A Type Function utility library for Roblox.

wally: https://wally.run/package/cameronpcampbell/typebrick

Tip

Check out Typeforge, a type function utility library for Luau.

Docs

PropertiesOf(input: type) -> type

Returns a table of properties for the given Roblox instance.

type Result = PropertiesOf<Part>

--[[
type Result = {
    Anchored: boolean,
    ... *TRUNCATED*
]]

MethodsOf(input: type) -> type

Returns a table of methods for the given Roblox instance.

type Result = MethodsOf<Part>

--[[
type Result = {
    AddTag: (Instance, string) -> nil,
    ... *TRUNCATED*
]]

EventsOf(input: type) -> type

Returns a table of events for the given Roblox instance.

type Result = EventsOf<Part>

--[[
type Result = {
    AncestryChanged: {
        Connect: t1,
        ConnectParallel: (t2, (Instance, Instance?) -> ()) -> RBXScriptConnection,
        Once: (t2, (Instance, Instance?) -> ()) -> RBXScriptConnection,
        Wait: (t2) -> (Instance, Instance?)
    },
    ... *TRUNCATED*
]]

ChildrenOf(input: type) -> type

Returns a table of children for the given Roblox instance.

type Result = ChildrenOf<typeof(workspace.Part)>

--[[
type Result = {
    1: Attachment
}
]]

DescendantsOf(input: type) -> type

Returns a table of children for the given Roblox instance.

type Result = DescendantsOf<typeof(workspace)>

--[[
type Result = {
    1: Part,
    2: Camera,
    3: Terrain,
    4: Attachment
}
]]