class-registry.js 658 B

12345678910111213141516171819202122
  1. import { Registry } from './registry.js';
  2. export class ClassRegistry extends Registry {
  3. constructor() {
  4. super(c => c.name);
  5. this.classToAllowedProps = new Map();
  6. }
  7. register(value, options) {
  8. if (typeof options === 'object') {
  9. if (options.allowProps) {
  10. this.classToAllowedProps.set(value, options.allowProps);
  11. }
  12. super.register(value, options.identifier);
  13. }
  14. else {
  15. super.register(value, options);
  16. }
  17. }
  18. getAllowedProps(value) {
  19. return this.classToAllowedProps.get(value);
  20. }
  21. }
  22. //# sourceMappingURL=class-registry.js.map