Replies: 1 comment 2 replies
-
Try declaring two classes in the annotations: ---@class GMUI.Layout
---@field private New fun(): GMUI.LayoutInstance
---@field GetOnLayoutInitializeCallback function
---@field SetOnLayoutInitializeCallback function
---@class GMUI.LayoutInstance: GMUI.Layout
---@field Destroy function
---@field DoesExist function
--- ... You can mark all the functions on the base |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Say I have a class module that has a ".New()" constructor, as well as some other methods that set global settings for this class. I also have some instance-specific methods, meaning these functions should only be used on the resulting object created by the ".New" constructor.
I wouldn't want these functions to appear before I have created a class object; because they aren't applicable yet. In the following example, when I am first typing "Layout" (my class) I would only want

.New
andGet/Set OnLayoutInitializeCallback
to show, as the other methods aren't applicable until I've created an object:However, I DO want these methods to show on a variable after it has been assigned to a new class object using the

.New()
constructor, which is not the case if I mark these methods as private or protected:Vice versa; we wouldn't want SetOnLayoutInitalizedCallback" showing here as it's a global class setting, not specific to this instance.
Is this possible? What annotations would I need to use to make it happen?
Beta Was this translation helpful? Give feedback.
All reactions