bitwig-types-generator
Version:
Generated Types for Bitwig scripting API
34 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BitwigApiEnum = void 0;
const BitwigApiEntity_1 = require("./BitwigApiEntity");
class BitwigApiEnum extends BitwigApiEntity_1.BitwigApiEntity {
sort = 100;
types = new Set();
setStaticPublicMemberFunctions({ id, def, type }) {
/**
* @Todo
* need to overload enums
*/
// console.log(def, type);
}
setPublicMemberFunctions({ def, type }) {
/**
* @Todo
* need to overload enums
*/
// console.log(def, type);
}
setPublicAttributes({ type }) {
type = type.replace(/\s*=.+$/, "");
this.types.add(type);
}
toType() {
let body = this.description;
const types = [...this.types].map((type) => `"${type}"`).join(" | ");
body += `type ${this.declaration.value} = ${types};`;
return body;
}
}
exports.BitwigApiEnum = BitwigApiEnum;
//# sourceMappingURL=BitwigApiEnum.js.map