-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add a bunch of type hints #10227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Add a bunch of type hints #10227
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,9 +30,17 @@ local m_min = math.min | |
| local m_max = math.max | ||
| local m_floor = math.floor | ||
|
|
||
| ---@class ListControl: Control, ControlHost | ||
| ---@class ListControl<T>: Control, ControlHost | ||
| ---@field list T[] | ||
| local ListClass = newClass("ListControl", "Control", "ControlHost") | ||
|
|
||
| ---@param anchor Anchor? | ||
| ---@param rect Rect? | ||
| ---@param rowHeight number | ||
| ---@param scroll "HORIZONTAL"|"VERTICAL"|nil | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Codex found that the implementation treats any truthy value other than |
||
| ---@param isMutable boolean? | ||
| ---@param list any[]? | ||
| ---@param forceTooltip any | ||
| function ListClass:ListControl(anchor, rect, rowHeight, scroll, isMutable, list, forceTooltip) | ||
| self:Control(anchor, rect) | ||
| self:ControlHost() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codex found that
listis populated by name (self.uniqueDB.list[newItem.name]andself.rareDB.list[newItem.name]), while the annotation describes an array. Both loaders also assignniltoloading. Wouldtable<string, Item>andboolean?describe the runtime shape more accurately?