@rightcapital/phpdoc-parser
Version:
TypeScript version of PHPDoc parser with support for intersection types and generics
27 lines (26 loc) • 997 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CallableTypeParameterNode = void 0;
const type_node_1 = require("./type-node");
class CallableTypeParameterNode extends type_node_1.TypeNode {
constructor(type, isReference, isVariadic, parameterName, isOptional) {
super();
this.type = type;
this.isReference = isReference;
this.isVariadic = isVariadic;
this.parameterName = parameterName;
this.isOptional = isOptional;
}
toString() {
const type = `${this.type.toString()} `;
const isReference = this.isReference ? '&' : '';
const isVariadic = this.isVariadic ? '...' : '';
const isOptional = this.isOptional ? '=' : '';
return (`${type}${isReference}${isVariadic}${this.parameterName}`.trim() +
isOptional);
}
getNodeType() {
return 'CallableTypeParameterNode';
}
}
exports.CallableTypeParameterNode = CallableTypeParameterNode;