/** * Created by user on 2017/12/16/016. */ import EpubMaker from 'epub-maker2'; import { IMdconfMeta } from 'node-novel-info'; import { console } from './log'; import { EnumEpubConfigVertical } from 'epub-maker2/src/config'; import { IEpubRuntimeReturn } from './epub'; import Bluebird from 'bluebird'; import moment from 'moment'; import * as novelGlobby from 'node-novel-globby/g'; import { EpubStore } from './store'; export { console }; export interface IOptions { /** * 小說 txt 的主資料夾路徑 * @type {string} */ inputPath: string; outputPath: string; /** * 小說名稱ID */ novelID?: string; filename?: string; novelConf?: unknown; epubTemplate?: unknown; epubLanguage?: string; padEndDate?: boolean; globbyOptions?: novelGlobby.IOptions; useTitle?: boolean; filenameLocal?: boolean | string[] | string; noLog?: boolean; /** * 是否直排 */ vertical?: boolean | EnumEpubConfigVertical; /** * 下載網路資源 */ downloadRemoteFile?: boolean; iconv?: string | 'cn' | 'tw' | 'chs' | 'cht' | 'zhs' | 'zht'; /** * 允許指定 epub 內的檔案更新日期 */ epubContextDate?: moment.MomentInput | Date | moment.Moment | true; beforeMakeEpub?(runtime: { TXT_PATH: string; epub: EpubMaker; processReturn: IEpubRuntimeReturn; options: IOptions; }): void; } export declare const defaultOptions: Partial; export declare function getNovelConf(options: IOptions, cache?: {}): Bluebird; export declare function makeOptions(options: IOptions): IOptions; export interface INovelEpubReturnInfo { file: string; filename: string; epub: EpubMaker; outputPath: string; basename: string; ext: string; stat: { volume: number; chapter: number; image: number; }; store: EpubStore; } export declare function create(options: IOptions, cache?: {}): Bluebird; export declare function makeFilename(options: IOptions, epub: EpubMaker, meta: IMdconfMeta): { file: string; ext: string; filename: string; options: IOptions; now: moment.Moment; basename: string; epub: EpubMaker; meta: IMdconfMeta; }; export default create;