-
-
Notifications
You must be signed in to change notification settings - Fork 391
Open
Labels
enhancementNew feature or requestNew feature or request
Description
I'd like to be able to do inlined type annotation for parameters. It doesn't currently seem to be possible. What I mean is, instead of this:
---@param key unknown
---@param callbackFn fun(Hook, ...):any
---@param priority? number
---@param hostTableToHook? table
---@param defaultNativeBehavior? function
---@param hookedTableIsMetaTable? boolean
function Hook.basic(key, callbackFn, priority, hostTableToHook, defaultNativeBehavior, hookedTableIsMetaTable)
return Hook.add(key, callbackFn, priority, hostTableToHook, defaultNativeBehavior, hookedTableIsMetaTable, true)
endI'd like to be able to do this:
function Hook.basic(
key, ---@param unknown
callbackFn, ---@param fun(Hook, ...):any
priority, ---@param? number
hostTableToHook, ---@param? table
defaultNativeBehavior, ---@param? function
hookedTableIsMetaTable ---@param? boolean
)
return Hook.add(key, callbackFn, priority, hostTableToHook, defaultNativeBehavior, hookedTableIsMetaTable, true)
endThis would cut down on the boilerplate a bit and make the code cleaner.
sewbacca and Congee
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request