FB3ReaderSite - Litres/FB3Reader GitHub Wiki

FB3ReaderSite contents is more of the example than of the real code. It defines interfaces consumer application should provide and gives some example classes, implementing this interfaces.

Interfaces

Defined in Site/FB3ReaderSiteHead.ts file

Interface Definition Quick description
IFB3ReaderSite
interface IFB3ReaderSite {
	Progressor: ILoadProgress;
	Canvas: HTMLElement;
	NotePopup: INotePopup;
	Alert: IAlert;
}
The site for the reader, master interface for this module. Provides all the necessary interfaces for the reader to interact with a user.
ILoadProgress
interface ILoadProgress {
	HourglassOn(Owner: any, LockUI?: boolean, Message?: string): void;
	Progress(Owner: any, Progress: number): void;
	HourglassOff(Owner: any): void;
	Tick(Owner: any): void;
	Alert: IAlert;
}
The way for internal reader mechanics to work with "hourglass", "progress" ans other such stuff.
IAlert
export interface IAlert {
	(Message: string): void;
}
The way for internal reader mechanics to alert a user in case of some serious error (clone of window.alert())
INotePopup
export interface INotePopup {
	(NoteBody: FB3DOM.InnerHTML): void;
}
When the Reader will want to show the footnote in the poup-up window, it will call this

Classes

Defined in Site/FB3ReaderSite.ts file

Class Implements Quick description
ExampleSite IFB3ReaderSite The very basic site for FB3 reader.
ExampleProgressor ILoadProgress "Hourglass coursor on" implementation
⚠️ **GitHub.com Fallback** ⚠️