Skip to content

Expanded all 315 instances type into a separate module#74

Open
AeroUtilities wants to merge 2 commits into
centau:mainfrom
AeroUtilities:main
Open

Expanded all 315 instances type into a separate module#74
AeroUtilities wants to merge 2 commits into
centau:mainfrom
AeroUtilities:main

Conversation

@AeroUtilities

@AeroUtilities AeroUtilities commented May 9, 2026

Copy link
Copy Markdown

The Instances type in create.luau only had 19 instance types written.

I decided to create a types folder and the types/instances.luau module covering all the built in instances in Roblox Studio that were sourced from the Roblox API dump. That way the autocompletion for any of the missing instances works in IDE's.

All of the instances may not be used with vide but you can definitely make cool projects even with creating plugins with the instances!

Changes:

  • Added src/types/instances.luau
  • Required src/types/instances.luau into src/create.luau
  • Refactored the type Instances to use the instances.luau module

Hope this is helpful!

Created all of the current component types that are built in Roblox Studio.
Removed the instance type in create and separated the instance module into the types folder.
@notrealaz

Copy link
Copy Markdown

a lot of these are unnecessary. this is a UI library

@AeroUtilities

AeroUtilities commented May 10, 2026

Copy link
Copy Markdown
Author

a lot of these are unnecessary. this is a UI library

Understandable. I did mention that not all instance may be used, but I wanted to keep the scope wide so nothing is left out.

I also noticed there's a defaults.luau that includes a part table with default properties and the part instance isn't really a UI instance. It might have not been included in the Instances type table but it removes the type errors at least having a full scope of instances.

There are some missing UI instances in the list like UIStroke and many others hence why I decided to source all the instances from the Roblox API Dump.

Commit 19eaeb4:

src/create.luau

type Instances = {
    Folder: Folder,
    BillboardGui: BillboardGui,
    CanvasGroup: CanvasGroup,
    Frame: Frame,
    ImageButton: ImageButton,
    ImageLabel: ImageLabel,
    ScreenGui: ScreenGui,
    ScrollingFrame: ScrollingFrame,
    SurfaceGui: SurfaceGui,
    TextBox: TextBox,
    TextButton: TextButton,
    TextLabel: TextLabel,
    UIAspectRatioConstraint: UIAspectRatioConstraint,
    UICorner: UICorner,
    UIGradient: UIGradient,
    UIGridLayout: UIGridLayout,
    UIListLayout: UIListLayout,
    Camera: Camera,
    WorldModel: WorldModel,
}

src/defaults.luau

return {
    Part = {
        Material = Enum.Material.SmoothPlastic,
        Size = vector.create(1, 1, 1),
        Anchored = true
    },
}

@ewd3v

ewd3v commented May 30, 2026

Copy link
Copy Markdown
Contributor

No idea how luau actually decides this, but on my end it just gave up typechecking because "type too complex" when I had too many entries in the Instances type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants