UNPKG

@cd-z/epub-constructor

Version:

This is a react library that creates an epub structure. This library only provides the file structure. To get a valid epub file it is needed to to create files from the provided data and compress them to a epub file.

51 lines (50 loc) 1.78 kB
/** * Generates an XML element string representing a chapter in a manifest. * * @param id - The ID of the chapter. * @param href - The href of the chapter. * @returns The XML element string representing the chapter. */ export declare function manifestChapter(id: string, href: string): string; /** * Generates an XML element representing a navigation item in a manifest file. * The XML element has the following attributes: * - properties: "nav" * - id: "toc" * - href: "toc.xhtml" * - media-type: "application/xhtml+xml" * * @returns {string} The XML element as a string. */ export declare function manifestNav(): string; /** * Returns an XML element representing a table of contents (TOC) item in a manifest. * * @returns {string} The XML element for the TOC item. */ export declare function manifestToc(): string; /** * Generates an XML element for a CSS file in a manifest. * * @returns {string} The XML element representing the CSS file. */ export declare function manifestStyle(): string; /** * Returns an XML element representing a cover image in a manifest file. * * @returns {string} The XML element for the cover image. */ export declare function manifestCover(fileFormat: string): string; /** * Generates an XML element string for an image in a manifest file. * * @param uri - The URI (Uniform Resource Identifier) of the image. * @returns The XML element string representing the image in the manifest file. * * @example * const imageUri = "https://example.com/image.jpg"; * const imageElement = manifestImage(imageUri); * console.log(imageElement); * // Output: <item id="image.jpg" href="https://example.com/image.jpg" media-type="image/jpeg" /> */ export declare function manifestImage(uri: string, fileFormat: string): string;