import {ComponentScopes, ComponentType} from "../../../enum" import {IComponent} from "../../interface" import {str2SmallCamel} from '../../../util' import {ConstructorType, PojoType} from "../../type" export default class NormalComponent implements IComponent{ public packageName: string = '' public name: string public cost: ConstructorType public type: ComponentType public props: Array = [] public inited: boolean = false public isAop: boolean = false public scope: ComponentScopes = ComponentScopes.SINGLETON constructor({name = '', cost = NormalComponent, type = ComponentType.COMPONENT} = {}){ this.name = name ? name : str2SmallCamel(cost.name) this.cost = cost this.type = type } public addProperty(property: PojoType): void{ this.props.push(property) } }