@types/nodepub
TypeScript icon, indicating that this package has built-in type declarations

3.0.3 • Public • Published

Installation

npm install --save @types/nodepub

Summary

This package contains type definitions for nodepub (https://github.com/kcartlidge/nodepub).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/nodepub.

index.d.ts

export interface Link {
    itemType: "front" | "contents" | "main";
    link: string;
    title: string;
}

export type GenerateContentsCallback = (links: Link[]) => string;

export interface Metadata {
    author: string;
    cover: string;
    id: number | string;
    title: string;

    contents?: string;
    copyright?: string;
    description?: string;
    fileAs?: string;
    genre?: string;
    images?: string[];
    language?: string;
    published?: string;
    publisher?: string;
    sequence?: number;
    series?: string;
    showContents?: boolean;
    source?: string;
    tags?: string;
}

export interface File {
    compress: boolean;
    content: string;
    folder: string;
    name: string;
}

export interface Document {
    CSS: string;
    coverImage: string;
    filesForTOC: string[];
    generateContentsCallback?: GenerateContentsCallback;
    images: string[];
    metadata: Metadata;
    sections: string[];
    showContents: boolean;
    addCSS(content: string): void;
    addSection(
        title: string,
        content: string,
        excludeFromContents?: boolean,
        isFrontMatter?: string,
        overrideFilename?: string,
    ): void;
    getFilesForEPUB(): Promise<File>;
    getSectionCount(): number;
    writeEPUB(folder: string, filename: string): Promise<void>;
    writeFilesForEPUB(folder: string): Promise<void>;
}

export function document(metadata: Metadata, generateContentsCallback?: GenerateContentsCallback): Document;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Dylan Armstrong.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/nodepub

Weekly Downloads

55

Version

3.0.3

License

MIT

Unpacked Size

5.51 kB

Total Files

5

Last publish

Collaborators

  • types