onix-gen-funstory
Version:
onix generator
48 lines (47 loc) • 1.57 kB
TypeScript
export declare type TCurrencyCode = 'USD' | 'CAD' | 'GBP';
export declare type TCountriesIncluded = 'CA' | 'GB' | 'AT' | 'BE' | 'CY' | 'DE' | 'EE' | 'ES' | 'FI' | 'FR' | 'GR' | 'IE' | 'IT' | 'LT' | 'LU' | 'LV' | 'MT' | 'NL' | 'PT' | 'SI' | 'SK';
export declare type TTranslator = 'Babel Novel' | 'Lemon Novel' | 'Fancy Novel';
export declare interface IBookPrice {
currencyCode: TCurrencyCode;
priceAmount: number;
countriesIncluded: TCountriesIncluded[] | ['WORLD'];
}
export declare interface IBookOnixInfo {
bookName: string;
description: string;
author: string;
volume: number;
translator: TTranslator;
isbn: string;
subjectCode: string;
price: IBookPrice[];
keywords: string[];
subTitle?: string;
publicationDate?: string;
preOrderDate?: string;
salesRestriction?: 'ALL' | 'TOP_FIVE' | 'KINDLE_ONLY';
pageCount?: number;
takedown?: boolean;
}
export declare interface IBookChapter {
title: string;
content: string[];
}
export declare interface IinitOption {
senderName: string;
contactName: string;
emailAddress: string;
cityOfPublication: string;
countryOfManufacture: TCountriesIncluded | 'CN';
publisherName: string;
websiteLink: string;
}
export declare const xml2jsParser: (text: string) => Promise<any>;
export declare class ONIXGenerator {
private initOption;
private tempObj;
constructor(initOption: IinitOption);
init(initOption?: IinitOption): Promise<void>;
getTemp(): any;
genONIX(bookinfo: IBookOnixInfo): string;
}