Skip to content

Update JSDoc-support-in-JavaScript.md #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions JSDoc-support-in-JavaScript.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
The below code outlines which constructs are currently supported or not supported
when using JsDoc annotations to provide type information in JavaScript files.

Note any tags which are not explicitly listed below (such as `@typedef`, or `@constructor`)
Note any tags which are not explicitly listed below (such as `@constructor`)
are not yet supported.

```javascript
// === Supported ===

// You can use the "@type" tag and reference a type name (either primitive,
// or defined in a TypeScript declaration)
// defined in a TypeScript declaration, or in a JSDoc "@typedef" tag)
/**
* @type {string}
*/
Expand Down Expand Up @@ -57,11 +57,19 @@ var var7;
var var8;


// An object specification may also be using within the braces
// An object specification may also be used within the braces
// For example, an object with properties 'a' (string) and 'b' (number)
/** @type {{a: string, b: number}} */
var var9;

// "@typedef" maybe used to define complex types
/**
* @typedef {Object} SpecialType - creates a new type named 'SpecialType'
* @property {string} prop1 - a string property of SpecialType
* @property {number} prop2 - a number property of SpecialType
*/
/** @type {SpecialType} */
var specialTypeObject;

// Parameters may be declared in a variety of syntactic forms

Expand Down