WIP: awesomerc.tl
should work #85
|
@ -1,21 +1,7 @@
|
|||
local type Node = require("awesomewmdtl.types.Node")
|
||||
|
||||
-- Teal doesn't have a `keyof` operator yet, so we have to do this manually.
|
||||
-- Some keys shouldn't be changed, so we don't include them here.
|
||||
local enum Node_Key
|
||||
"token"
|
||||
"name"
|
||||
-- "children"
|
||||
"types"
|
||||
"parameters"
|
||||
"return_types"
|
||||
-- "module_path"
|
||||
-- "dependencies"
|
||||
-- "global"
|
||||
end
|
||||
-- Teal can't define nested Map types yet, so we have to define a type for the nested map.
|
||||
local type New_Node = { Node_Key : any }
|
||||
local type New_Node_By_Name = { string : New_Node }
|
||||
local type New_Node_By_Name = { string : Node }
|
||||
|
||||
-- This is a map of module paths to a map of node names to a map of node keys to new values.
|
||||
-- This is used to fix nodes where either
|
||||
|
@ -27,20 +13,19 @@ local type New_Node_By_Name = { string : New_Node }
|
|||
-- EVERYTHING IN HERE IS TEMPORARY AND SHOULD BE REMOVED!
|
||||
|
||||
local node_fixer <const>: { string : New_Node_By_Name } = {
|
||||
-- ["gears.color"] = {
|
||||
-- ["to_rgba_string"] = {
|
||||
-- parameters = {
|
||||
-- { token = "variable", name = "color", types = { "string" } },
|
||||
-- { token = "variable", name = "fallback", types = { "string" } },
|
||||
-- },
|
||||
-- },
|
||||
-- ["change_opacity"] = {
|
||||
-- parameters = {
|
||||
-- { token = "variable", name = "input", types = { "string" } },
|
||||
-- { token = "variable", name = "opacity", types = { "number" } },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
["awful.titlebar"] = {
|
||||
new = {
|
||||
return_types = { { "Titlebar" } }, -- The Awesome APIDoc have to updated
|
||||
},
|
||||
},
|
||||
["awful.widget.prompt"] = {
|
||||
set_shape = {
|
||||
parameters = {
|
||||
{ token = "variable", name = "self", types = { "Prompt" } },
|
||||
{ token = "variable", name = "shape", types = { "Gears_Shape_Function" } }, -- cannot discriminate a union between multiple function types: Gears_Shape_Function | function(...: <any type>): <any type>...
|
||||
},
|
||||
},
|
||||
},
|
||||
["gears.surface"] = {
|
||||
apply_shape_bounding = {
|
||||
parameters = {
|
||||
|
|
|
@ -10,10 +10,13 @@ local type_map <const>: { string : string } = {
|
|||
client = "Client",
|
||||
["gears.shape"] = "Gears_Shape_Function",
|
||||
["gears.surface"] = "Cairo_Surface",
|
||||
["Gio.InputStream"] = "any", -- We'll probably never have better support for this one, since it's a GI bindings
|
||||
image = "Image",
|
||||
int = "integer",
|
||||
Integer = "integer",
|
||||
layout = "Layout",
|
||||
["lgi.Pango.FontDescription"] = "any", -- We'll probably never have better support for this one, since it's a GI bindings
|
||||
["Pango.FontDescription"] = "any", -- We'll probably never have better support for this one, since it's a GI bindings
|
||||
placement = "Awful_Placement_Function",
|
||||
raw_surface = "Cairo_Surface",
|
||||
screen = "Screen",
|
||||
|
|
Loading…
Reference in New Issue