//
//  MoleculeDelegateProtocol.swift
//  MVMCoreUI
//
//  Created by Suresh, Kamlesh on 11/26/19.
//  Copyright © 2019 Verizon Wireless. All rights reserved.
//


public protocol MoleculeDelegateProtocol: AnyObject {
    
    func getRootMolecules() -> [MoleculeModelProtocol]
    
    /// returns a module for the corresponding module name.
    func getModuleWithName(_ name: String?) -> [AnyHashable: Any]?
    
    func getModuleWithName(_ moleculeName: String) -> MoleculeModelProtocol?
    
    /// Notifies the delegate that the molecule layout update. Should be called when the layout may change due to an async method. Mainly used for list or collections.
    func moleculeLayoutUpdated(_ molecule: MoleculeViewProtocol) //optional
}

extension MoleculeDelegateProtocol {
    
    public func moleculeLayoutUpdated(_ molecule: MoleculeViewProtocol) { }
}
