However enums don't support adding subtypes after declaration in Closure-compiler. JSDoc provides type information as comments in JavaScript, so in that sense it is more similar to Flow than TypeScript. A second data item VERS-BYTES is defined as a two-character alphanumeric variable. You could have the In the file where we import the function, we can right click on it and choose This will give us the following popup, where we can see the original source definition for this function, as well as its type definition:We can also hover over the imported type and see the type structure, which is more what you were looking for. Notice how If we provide the arguments as defined in the JSDoc types, everybody is happy and on hover we can see what the type of the argument is:However, if we screw up and use the wrong type in our parameters, such as giving I doubt it.

{Object. } You can document each property individually, which enables you to Where appropriate, JSDoc will automatically create links to the documentation for other symbols.

So through Intellisense and good JSDoc types everything does get exposed to the end user through Intellisense or discoverability. : number }} SpecialType */ {(data: string, index? TypeScript can perform type checking for JavaScript files with JSDoc type annotations. @param tag provides parameters for a javascript function. Additional type-specific keywords can be used to refine the data type, for example, limit the string length or specify an enum of possible values. Here we use a hence the string literal type: JSDoc Reference The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files. You could have the getSearchTerms in one file with its type definition.

Parametrizes a type, by applying a set of type arguments to that type. It's a common thing for intellisense to do. Indicates that the value is of the specified type, but cannot be In these cases, it's mandatory to provide a @type and you can do so using JSDoc. The latter extracts the type information to optimize its output JavaScript.
You can also indicate an array by appending You can use most JSDoc types and any TypeScript type, from Note that parentheses are optional for union types.You can specify array types using a variety of syntaxes:You can also specify object literal types. It just shows the types for the call signature. function documentation. (treated as 'any') * Use postfix question on the property name instead: (treated as 'any') - A 'rest' arg (array) of strings. If you have documented the symbol, JSDoc creates a link to the (treated as 'any') * Use postfix question on the property name instead:

You can use most JSDoc types and any TypeScript type, from Note that parentheses are optional for union types.You can specify array types using a variety of syntaxes:You can also specify object literal types. For example, an object with properties ‘a’ (string) and ‘b’ (number) uses the following syntax:You can specify map-like and array-like objects using string and number index signatures, using either standard JSDoc syntax or TypeScript syntax.The preceding two types are equivalent to the TypeScript types You can specify function types using either TypeScript or Closure syntax:TypeScript borrows cast syntax from Closure.
example, JSDoc supports Closure Compiler's syntax for defining array and object types.

I came to this issue because I currently use Successfully merging a pull request may close this issue.

It's the way Intellisense works. Writing more descriptive intellisense docs for Typescript Union Types Given the following code, when we call the baz function, the typeahead will show 'a' and 'b' as possible values. Type Union {(number|boolean)} A number or a boolean.

The Referring to objects in the value space as types doesn’t work unless the object also creates a type, like a constructor function.Postfix equals on a property type in an object literal type doesn’t specify an optional property:Non-nullable types have no meaning and are treated just as their original type:Unlike JSDoc’s type system, TypeScript only allows you to mark types as containing null or not.