Types for Window and Page

This commit is contained in:
ClintUNI 2024-05-02 14:25:45 +02:00
parent d65d4d260f
commit fa39aaea9a

View file

@ -91,6 +91,7 @@ export type Component = typeof(setmetatable({} :: ComponentClass, {}))
export type PageClass = { export type PageClass = {
Parent: Window, Parent: Window,
Name: string, Name: string,
Weight: number,
Frame: Frame, Frame: Frame,
Container: trove.Trove, Container: trove.Trove,
@ -133,6 +134,7 @@ export type PageClass = {
Build: (self: Page, parent: Window) -> (), Build: (self: Page, parent: Window) -> (),
Open: (self: Page) -> (), Open: (self: Page) -> (),
Back: (self: Page) -> (),
Close: (self: Page) -> (), Close: (self: Page) -> (),
Clean: (self: Page) -> (), Clean: (self: Page) -> (),
@ -157,12 +159,25 @@ export type WindowClass = {
BuildPages: (self: Window) -> (), BuildPages: (self: Window) -> (),
AddPage: (self: Window, page: Page) -> (), AddPage: (self: Window, page: Page) -> (),
GetPage: (self: Window, page: string) -> (), GetPage: (self: Window, page: string) -> (),
OpenPage: (self: Window, page: string) -> (), OpenPage: (self: Window, page: string, command: "Weighted" | "Forced"?) -> (),
OpenLastPage: (self: Window) -> (),
ClosePage: (self: Window, page: string) -> (), ClosePage: (self: Window, page: string) -> (),
RemovePages: (self: Window) -> (),
--[=[
Will close and clean all open pages. \
If a middleware function is given, closing will be dependent on the returned boolean value of said middleware during an iterative process. \
An example use case may include closing pages based on their weighted value.
@param middleware function(Page) ```returns``` (boolean)
]=]
CloseAllPages: (self: Window, middleware: (Page) -> (boolean)) -> (),
RemoveAllPages: (self: Window) -> (),
CleanPages: (self: Window) -> (), CleanPages: (self: Window) -> (),
_: { _: {
RecentlyOpenedPageName: string,
LastOpenedPageName: string,
OnBuild: (self: Window) -> ()?, OnBuild: (self: Window) -> ()?,
OnOpen: (self: Window) -> ()?, OnOpen: (self: Window) -> ()?,
OnClose: (self: Window) -> ()?, OnClose: (self: Window) -> ()?,