FB3DOM module, DOM class - Litres/FB3Reader GitHub Wiki
Class FB3DOM.DOM is used to asynchronously access document tree. DOM class relays on FB3DataProvider.IJsonLoaderFactory to physically retrieve the data and handles the logic of converting document-blocks requests into asynchronous chunks retrievals. This class is not supposed to be redefined by consumer app, perhaps you will need some minor inheritance.
You provide DOM instance with UI connectors (IAlert and ILoadProgress) and IJsonLoaderFactory as a physical data access class:
constructor(public Alert: FB3ReaderSite.IAlert,
public Progressor: FB3ReaderSite.ILoadProgress,
public DataProvider: FB3DataProvider.IJsonLoaderFactory);
After creation and before actual data access you must call Init:
Init(HyphOn: bool, URL: string, OnDone: { (FB3DOM: IFB3DOM): void; })
OnDone callback will be called when metadata information is ready and the class may start working with the text itself.