diff --git a/src/Shared/Modules/Managers/UIManager/Types.lua b/src/Shared/Modules/Managers/UIManager/Types.lua index 4b625b2..d6885e6 100644 --- a/src/Shared/Modules/Managers/UIManager/Types.lua +++ b/src/Shared/Modules/Managers/UIManager/Types.lua @@ -14,6 +14,8 @@ export type DraggableClass = { DragEvent: signal.Signal, _: { + Status: "Stored" | "Built", + IsDragging: boolean, DragStartTime: number, @@ -36,32 +38,96 @@ export type DraggableClass = { export type Draggable = typeof(setmetatable({} :: DraggableClass, {})) +--[[ == Template == ]] + +export type TemplateClass = { + Files: { + [string]: (self: Object, parameters: {}?) -> () + }, + Create: ((self: Template, method: MethodOptions, callback: (self: Object, parameters: Parameters?) -> ()) -> ()), + Fire: ((self: Template, method: MethodOptions, object: Object, parameters: Parameters?) -> ()), +} + +export type Template = typeof(setmetatable({} :: TemplateClass, {})) + +--[[ == ObjectList == ]] + +export type ListableObject = (Button | Component | Page) + +export type ObjectListClass = { + Parent: P, + + Opened: { [string]: boolean }, + Built: { [string]: LO }, + Stored: { [string]: LO }, + + RecentlyOpenedName: string, + LastOpenedName: string, + + Add: (self: ObjectList, object: LO) -> (), + Get: (self: ObjectList, name: string) -> (LO?), + Remove: (self: ObjectList, name: string) -> (), + RemoveAll: (self: ObjectList) -> (), + Build: (self: ObjectList, name: string) -> (), + BuildAll: (self: ObjectList) -> (), + Open: (self: ObjectList, name: string, mode: ("Weighted" | "Forced")?) -> (), + OpenAll: (self: ObjectList) -> (), + OpenPrevious: (self: ObjectList) -> (), + Close: (self: ObjectList, name: string) -> (), + CloseAll: (self: ObjectList) -> (), + Clean: (self: ObjectList, name: string) -> (), + CleanAll: (self: ObjectList) -> (), +} + +export type ObjectList = typeof(setmetatable({} :: ObjectListClass, {})) + + +--[[ == Interfaces == ]] + +type BuildableObject = { + Parent: Parent, + + _: { + Status: "Stored" | "Built", + + OnBuild: (self: Self) -> ()?, + }, + + OnBuild: (self: Self, callback: (self: Self) -> ()) -> (), + Build: (self: Self, parent: Parent) -> (), + + GetStatus: (self: Self) -> ("Stored" | "Built"), + StatusIs: (self: Self, status: "Stored" | "Built") -> (boolean), +} + +type RenderableObject = { + _: { + OnOpen: (self: Self) -> ()?, + OnClose: (self: Self) -> ()?, + }, + + OnOpen: (self: Self, callback: (self: Self) -> ()) -> (), + OnClose: (self: Self, callback: (self: Self) -> ()) -> (), + + Open: (self: Self) -> (), + Close: (self: Self) -> (), +} + -- +export type ButtonEvents = "Pressed" | "Released" | "Hovered" | "HoverLeft" + export type ButtonClass = { - Parent: Page | Component, Name: string, ButtonGui: GuiButton, _: { - OnBuild: (self: Button) -> ()?, - OnOpen: (self: Button) -> ()?, - OnClose: (self: Button) -> ()?, - OnPressed: (self: Button) -> ()?, OnReleased: (self: Button) -> ()?, OnHovered: (self: Button) -> ()?, OnHoverLeft: (self: Button) -> ()?, }, - OnBuild: (self: Button, callback: (self: Button) -> ()) -> (), - OnOpen: (self: Button, callback: (self: Button) -> ()) -> (), - OnClose: (self: Button, callback: (self: Button) -> ()) -> (), - - Build: (self: Button, parent: Page | Component) -> (), - Open: (self: Button) -> (), - Close: (self: Button) -> (), - OnPressed: (self: Button, callback: (self: Button) -> ()) -> (), OnReleased: (self: Button, callback: (self: Button) -> ()) -> (), OnHovered: (self: Button, callback: (self: Button) -> ()) -> (), @@ -73,23 +139,19 @@ export type ButtonClass = { HoverLeft: (self: Button) -> (), Remove: (self: Button) -> (), -} +} & BuildableObject & RenderableObject