提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
820 B

  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.ClassRegistry = void 0;
  4. const registry_js_1 = require("./registry.cjs");
  5. class ClassRegistry extends registry_js_1.Registry {
  6. constructor() {
  7. super(c => c.name);
  8. this.classToAllowedProps = new Map();
  9. }
  10. register(value, options) {
  11. if (typeof options === 'object') {
  12. if (options.allowProps) {
  13. this.classToAllowedProps.set(value, options.allowProps);
  14. }
  15. super.register(value, options.identifier);
  16. }
  17. else {
  18. super.register(value, options);
  19. }
  20. }
  21. getAllowedProps(value) {
  22. return this.classToAllowedProps.get(value);
  23. }
  24. }
  25. exports.ClassRegistry = ClassRegistry;
  26. //# sourceMappingURL=class-registry.js.map