UNPKG

@typedefs/parser

Version:
74 lines (73 loc) 2.54 kB
/* typal types/index.xml */ /** @const */ var _typedefsParser = {} /** * The meta information about the function. * @record */ _typedefsParser.FunctionType /** * The arguments of the function. * @type {!Array<!_typedefsParser.Type>} */ _typedefsParser.FunctionType.prototype.args /** * The return type of the function. When the value is set to `null`, it means the function does not have a return. If the return was actually `null`, it would be specified as `return: { name: 'null' }`. * @type {?_typedefsParser.Type} */ _typedefsParser.FunctionType.prototype.return /** * The type of the `this` argument specified as `function(this: Type)`. * @type {(!_typedefsParser.Type)|undefined} */ _typedefsParser.FunctionType.prototype.this /** * The type of the `new` argument specified as `function(new: Type)`. * @type {(!_typedefsParser.Type)|undefined} */ _typedefsParser.FunctionType.prototype.new /** * The type of the variable arguments, e.g., `function(...Type)`. * @type {(!_typedefsParser.Type)|undefined} */ _typedefsParser.FunctionType.prototype.variableArgs /** * The representation of a type. * @record */ _typedefsParser.Type /** * Whether the type is nullable. This is defined by writing `?` before the type name to state nullability and `!` otherwise. The parser does not infer nullability from types being primitive and `Function/function`. * @type {boolean|undefined} */ _typedefsParser.Type.prototype.nullable /** * The name of the type. * @type {string|undefined} */ _typedefsParser.Type.prototype.name /** * If the type is defined as a union, e.g., `(string|number)`, contains the united types. Must include parenthesis. * @type {(!Array<!_typedefsParser.Type>)|undefined} */ _typedefsParser.Type.prototype.union /** * If the type is a record, contains its representation. If a property of the record does not have a type, it will be set to null. * @type {(!Object<string, _typedefsParser.Type>)|undefined} */ _typedefsParser.Type.prototype.record /** * The application of the type, e.g., the inner type of `Object<Application>`. * @type {(!Array<!_typedefsParser.Type>)|undefined} */ _typedefsParser.Type.prototype.application /** * The function info with args and return if the type is a function. * @type {(!_typedefsParser.FunctionType)|undefined} */ _typedefsParser.Type.prototype.function /** * If the type is returned as an optional argument of a function (`function(string=)`), this will be set to true. * @type {boolean|undefined} */ _typedefsParser.Type.prototype.optional