cloxnu/textbox.js

The key of UserConfig will conflict if many of the same types of components are being used.

cloxnu opened this issue · 0 comments

OuterConfig should be a dynamic dictionary, it’s entrance key should be the name of component.

The new code should be

type OuterConfig = Object;
// or `Dictionary` could be defined

class ConfigConverter <T extends InnerConfig = InnerConfig> {
    name: string;
    outerConfig: OuterConfig;

    get entranceKey(): string { // or no `entranceKey` , it’s just `this.name` 
        return this.name;
    }

    get default(): OuterConfig { // should be implemented by child class
        return {};
    }
}