import { ResourceComponent } from "../component/ResourceComponent" ; import { EditDialogData , SlingResourceOptions } from "../store/Sling" ; import Cache from "../store/Cache" ; export default class MockSling { constructor ( cache ? , data ? ) { this . cache = cache || new Cache ( ) ; this . data = data ; } private cache : Cache ; private data : EditDialogData ; public subscribe ( listener , path , options ? ) { let resource = this . cache . get ( path , options ? options . depth : null ) ; if ( resource ) { listener . changedResource ( path , resource ) ; } } public renderDialogScript ( ) { if ( this . data ) { return this . data ; } return { element : "div" , attributes : { className : "dialog" } } ; } public includeResource ( path , resourceType ) { return "<include resourcetype='" + resourceType + "' path='" + path + "'></include>" ; } }