3.0.3 • Published 6 months ago

@types/nodepub v3.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for nodepub 3.0
// Project: https://github.com/kcartlidge/nodepub
// Definitions by: Dylan Armstrong <https://github.com/dylanarmstrong>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

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: Thu, 06 Jan 2022 18:01:29 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Dylan Armstrong.

3.0.3

6 months ago

3.0.2

7 months ago

3.0.1

8 months ago

3.0.0

2 years ago