Refactor Instances type to use imported instances module

Removed the instance type in create and separated the instance module into the types folder.
This commit is contained in:
AeroUtilities 2026-05-09 23:14:31 +01:00 committed by GitHub
parent 1f9a9bc93a
commit e8238bf8b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,6 +4,7 @@ local Instance = game and Instance or require "../test/mock".Instance :: never
local defaults = require "./defaults" local defaults = require "./defaults"
local apply = require "./apply" local apply = require "./apply"
local flags = require "./flags" local flags = require "./flags"
local instances = require "./types/instances"
local function create_constructor_for_class(class: string): ({ [unknown]: unknown }) -> Instance local function create_constructor_for_class(class: string): ({ [unknown]: unknown }) -> Instance
local function constructor(properties: { [unknown]: unknown }): Instance local function constructor(properties: { [unknown]: unknown }): Instance
@ -52,27 +53,7 @@ local function create(class_or_instance: string|Instance, properties: { [unknown
else constructor else constructor
end end
type Instances = { type Instances = instances.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,
}
type function Properties(instance: type?) type function Properties(instance: type?)
local properties = types.newtable() local properties = types.newtable()