UNPKG

r2-shared-js

Version:

Readium 2 'shared' for NodeJS (TypeScript)

45 lines (44 loc) 3.86 kB
/// <reference types="node" /> import { MediaOverlayNode } from "../models/media-overlay"; import { Publication } from "../models/publication"; import { Link } from "../models/publication-link"; import { IZip } from "r2-utils-js/dist/es5/src/_utils/zip/zip"; import { Rootfile } from "./epub/container-rootfile"; import { NCX } from "./epub/ncx"; import { OPF } from "./epub/opf"; import { Author } from "./epub/opf-author"; import { Manifest } from "./epub/opf-manifest"; import { Metafield } from "./epub/opf-metafield"; export declare const mediaOverlayURLPath = "media-overlay.json"; export declare const mediaOverlayURLParam = "resource"; export declare const BCP47_UNKNOWN_LANG = "und"; export declare const parseSpaceSeparatedString: (str: string | undefined | null) => string[]; export declare const isEpub3OrMore: (rootfile: Rootfile, opf: OPF) => boolean; export declare const fillPublicationDate: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF) => void; export declare const fillSubject: (publication: Publication, opf: OPF) => void; export declare const findContributorInMeta: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF) => void; export declare const addContributor: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF, cont: Author, forcedRole: string | undefined) => void; export declare const findMetaByRefineAndProperty: (opf: OPF, ID: string, property: string) => Metafield | undefined; export declare const findAllMetaByRefineAndProperty: (opf: OPF, ID: string, property: string) => Metafield[]; export declare const findInSpineByHref: (publication: Publication, href: string) => Link | undefined; type FuncType = (publication: Publication, rootfile: Rootfile | undefined, opf: OPF, zip: IZip, linkItem: Link, item: Manifest) => Promise<void>; export declare const findInManifestByID: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF, ID: string, zip: IZip, addLinkData: FuncType) => Promise<Link>; export declare const fillSpineAndResource: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF, zip: IZip, addLinkData: FuncType) => Promise<void>; export declare const addLanguage: (publication: Publication, opf: OPF) => void; export declare const addIdentifier: (publication: Publication, opf: OPF) => void; export declare const addTitle: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF) => void; export declare const setPublicationDirection: (publication: Publication, opf: OPF) => void; export declare const langStringIsRTL: (lang: string) => boolean; export declare const getNcx: (ncxManItem: Manifest, opf: OPF, zip: IZip) => Promise<NCX>; export declare const getNcx_: (ncxStr: string, ncxFilePath: string) => NCX; export declare const getOpf: (zip: IZip, rootfilePathDecoded: string, rootfilePath: string) => Promise<OPF>; export declare const getOpf_: (opfStr: string, rootfilePathDecoded: string) => OPF; export declare const addOtherMetadata: (publication: Publication, rootfile: Rootfile | undefined, opf: OPF) => void; export declare const loadFileStrFromZipPath: (linkHref: string, linkHrefDecoded: string, zip: IZip) => Promise<string | undefined>; export declare const loadFileBufferFromZipPath: (linkHref: string, linkHrefDecoded: string, zip: IZip) => Promise<Buffer | undefined>; export declare const fillTOC: (publication: Publication, opf: OPF, ncx: NCX | undefined) => void; export declare const addMediaOverlaySMIL: (link: Link, manItemSmil: Manifest, opf: OPF, zip: IZip) => Promise<void>; export declare const flattenDaisy2SmilAudioSeq: (_smilPathInZip: string, smilXmlDoc: Document) => void; export declare const lazyLoadMediaOverlays: (publication: Publication, mo: MediaOverlayNode) => Promise<undefined>; export declare const updateDurations: (dur: number | undefined, link: Link) => void; export {};