Skip to content

Instantly share code, notes, and snippets.

@EvanLovely
Created October 28, 2018 18:26
Show Gist options
  • Save EvanLovely/67d2b5dde58779bb616bc303d928265f to your computer and use it in GitHub Desktop.
Save EvanLovely/67d2b5dde58779bb616bc303d928265f to your computer and use it in GitHub Desktop.
/**
* @type {{a: boolean, b: boolean, c: number}}
*/
var x = {a: true};
/**
* @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
* @property {number=} prop3 - an optional number property of SpecialType
* @prop {number} [prop4] - an optional number property of SpecialType
* @prop {number} [prop5=42] - an optional number property of SpecialType with default
*/
/** @type {SpecialType} */
const specialTypeObject;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment