提交学习笔记专用
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.

21 lines
658 B

  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