Skip to content

Commit 6021c46

Browse files
committed
Overload pen.make and pen.parse
1 parent 524ccd1 commit 6021c46

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

dist/library/common.lua

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
-- Ideally this file would not be needed, here we put any methods/consts that
2+
-- need to be manually overloaded outside of base classes/types.
13
---@meta _
24

35
---@class df
46
df = {}
57

8+
-- Core methods
9+
610
---@param message string
711
function dfhack.print(message) end
812

@@ -13,3 +17,22 @@ function dfhack.printerr(message) end
1317
---@param level? integer
1418
---@param verbose? boolean
1519
function dfhack.error(message, level, verbose) end
20+
21+
-- Pen methods
22+
23+
-- Creates a new `dfhack.pen` object.
24+
---@param base dfhack.pen|dfhack.color
25+
---@param pen_or_fg? dfhack.pen|dfhack.color
26+
---@param bg? dfhack.color
27+
---@param bold? boolean
28+
---@return dfhack.pen
29+
function dfhack.pen.make(base, pen_or_fg, bg, bold) end
30+
31+
-- Returns `base` or `pen_or_fg` directly if they are already a valid
32+
-- `dfhack.pen` object.
33+
---@param base dfhack.pen|dfhack.color
34+
---@param pen_or_fg? dfhack.pen|dfhack.color
35+
---@param bg? dfhack.color
36+
---@param bold? boolean
37+
---@return dfhack.pen
38+
function dfhack.pen.parse(base, pen_or_fg, bg, bold) end

0 commit comments

Comments
 (0)