@typedef and @struct were originally designed to mimic their C counterparts. However, as we convert more of our source base to --no-implicit-any, the mismatch between C-style and TypeScript-style type annotation is causing confusion. We also lack the ability to declare a function type (#105).
I'd like to switch @typedef and @struct to the following:
@type AnimationCallback = function(completed: BOOL): void;
@type Point = { x: Number, y: Number };
@type FooArray = Array<Foo>;
Which could be extended in the future to allow more complex types:
@typedef
and@struct
were originally designed to mimic their C counterparts. However, as we convert more of our source base to--no-implicit-any
, the mismatch between C-style and TypeScript-style type annotation is causing confusion. We also lack the ability to declare a function type (#105).I'd like to switch
@typedef
and@struct
to the following:Which could be extended in the future to allow more complex types:
@typedef
and@struct
would likely be deprecated in favor of the new syntax (this is requires-major if so).