Support typedef
See original GitHub issueI need a way to shorten some type define.
For example, I have two variables defined like this:
---@type fun(result_count:number, result_map:Map<number,Map<number,table>>) | nil
local entity_search_result_callback1
---@type fun(result_count:number, result_map:Map<number,Map<number,table>>) | nil
local entity_search_result_callback2
Hard to write and understand! 😭
I want to do this:
---@typedef entity_id_t number
---@typedef component_id_t number
---@typedef entity_data_t Map<component_id_t,table>
---@typedef entity_data_map_t Map<entity_id_t,entity_data_t>
---@typedef success_callback_t fun(result_count:number, result_map:entity_data_map_t) | nil
---@type success_callback_t
local entity_search_result_callback1
---@type success_callback_t
local entity_search_result_callback2
😎
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
C - typedef - Tutorialspoint
The C programming language provides a keyword called typedef, which you can use to give a type a new name. Following is an...
Read more >typedef specifier - cppreference.com
The typedef specifier, when used in a declaration, specifies that the declaration is a typedef declaration rather than a variable or function declaration....
Read more >typedef - Wikipedia
typedef is a reserved keyword in the programming languages C, C++, and Objective-C. It is used to create an additional name (alias) for...
Read more >typedef definitions - IBM
When any extended language level is in effect, typedef redeclaration supports all types, including a variably modified type. End IBM extension. For more ......
Read more >Typedef - MATLAB & Simulink - MathWorks
C Construct. typedef float float_32;. Procedure. To create a data type alias in Simulink®, use a Simulink.AliasType . The code generator creates a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
new annotation:
@alias
usage:---@alias NAME type