mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
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:
parent
1f9a9bc93a
commit
e8238bf8b1
1 changed files with 2 additions and 21 deletions
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue