import { parseTypeBox } from './parseTypeBox';
export function initStateAndMethod(registry, stateManager, components) {
    components.forEach(c => {
        if (stateManager.store[c.id]) {
            return false;
        }
        let state = {};
        c.traits.forEach(t => {
            const tSpec = registry.getTrait(t.parsedType.version, t.parsedType.name).spec;
            state = Object.assign(Object.assign({}, state), parseTypeBox(tSpec.state));
        });
        const cSpec = registry.getComponent(c.parsedType.version, c.parsedType.name).spec;
        state = Object.assign(Object.assign({}, state), parseTypeBox(cSpec.state));
        stateManager.store[c.id] = state;
    });
}
//# sourceMappingURL=initStateAndMethod.js.map