---@meta

---@class MuxDomainObj
---@field attach fun(self: MuxDomainObj): nil Attempts to attach the domain. Attaching a domain will attempt to import the windows, tabs and panes from the remote system into those of the local GUI. Unlike the AttachDomain key assignment, calling domain:attach() will not implicitly spawn a new pane into the domain if the domain contains no panes. This is to provide flexibility when used in the gui-startup event. If the domain is already attached, calling this method again has no effect.
---@field detach fun(self: MuxDomainObj): nil Attempts to detach the domain. Detaching a domain causes it to disconnect and remove its set of windows, tabs and panes from the local GUI. Detaching does not cause those panes to close; if or when you later attach to the domain, they'll still be there. Not every domain supports detaching, and will log an error to the error log/debug overlay.
---@field domain_id fun(self: MuxDomainObj): number Returns the domain id.
---@field has_any_panes fun(self: MuxDomainObj): boolean Returns true if the mux has any panes that belong to this domain. This can be useful when deciding whether to spawn additional panes after attaching to a domain.
---@field is_spawnable fun(self: MuxDomainObj): boolean Returns false if this domain will never be able to spawn a new pane/tab/window, true otherwise. Serial ports are represented by a serial domain that is not spawnable.
---@field label fun(self: MuxDomainObj): string Computes a label describing the name and state of the domain. The label can change depending on the state of the domain.
---@field name fun(self: MuxDomainObj): string Returns the name of the domain. Domain names are unique; no two domains can have the same name, and the name is fixed for the lifetime of the domain.
---@field state fun(self: MuxDomainObj): "Attached" | "Detached" Returns whether the domain is attached or not.
