/** * A model element factory. * */ export default class Factory { /** * @param model * @param properties */ constructor(model: Moddle, properties: Properties); /** * @param descriptor * @return */ createType>(descriptor: EffectiveDescriptor): ModdleElementType; } type Namespace = import("./ns.js").Namespace; type Moddle = import("./moddle.js").default; type Properties = import("./properties.js").default; type EffectiveDescriptor = import("./registry.js").EffectiveDescriptor; type BaseElement = import("./base.js").default; type AnyTypeDescriptor = import("./descriptor-builder.js").AnyTypeDescriptor; export type ModdleElementType> = { new (attrs?: Partial): ModdleElement; prototype: ModdleElement; readonly $model: Moddle; readonly $descriptor: EffectiveDescriptor; }; export type ModdleElement> = BaseElement & T & { readonly $model: Moddle; readonly $descriptor: EffectiveDescriptor; readonly $type: Namespace["name"]; readonly $attrs: Record; $parent?: ModdleElement | AnyModdleElement; hasType: Moddle["hasType"]; $instanceOf: Moddle["hasType"]; }; export type AnyModdleElement> = BaseElement & T & { $type: string; $instanceOf: (type: string) => boolean; $parent?: ModdleElement | AnyModdleElement; readonly $model: Moddle; readonly $descriptor: AnyTypeDescriptor; };