UNPKG

@bliztek/feed-generator

Version:

A simple and lightweight Node.js library for generating RSS 2.0, Atom, and JSON Feed formats.

115 lines (114 loc) 2.56 kB
export type FeedAuthor = { name: string; url?: string; email?: string; avatar?: string; }; export type FeedCategory = { name: string; domain?: string; label?: string; }; export type FeedEnclosure = { url: string; type: string; length?: number; title?: string; duration?: number; }; export type FeedImage = { url: string; title?: string; link?: string; width?: number; height?: number; }; export type PodcastFeed = { type?: "episodic" | "serial"; explicit?: boolean; owner?: { name: string; email: string; }; category?: string | { name: string; subcategory?: string; }[]; image?: string; newFeedUrl?: string; block?: boolean; complete?: boolean; }; export type PodcastItem = { duration?: number | string; explicit?: boolean; episode?: number; season?: number; episodeType?: "full" | "trailer" | "bonus"; image?: string; block?: boolean; }; export type FeedItemExtensions = { xmlElements?: import("./xml.js").XmlNode[]; jsonProperties?: Record<string, unknown>; }; export type FeedItem = { id: string; title?: string; link?: string; content?: string; contentText?: string; summary?: string; date?: string | Date; updated?: string | Date; authors?: FeedAuthor[]; categories?: FeedCategory[]; image?: string; enclosures?: FeedEnclosure[]; language?: string; podcast?: PodcastItem; extensions?: FeedItemExtensions; }; export type FeedExtensions = { xmlNamespaces?: Record<string, string>; xmlElements?: import("./xml.js").XmlNode[]; jsonProperties?: Record<string, unknown>; }; export type Feed = { title: string; link: string; description?: string; id?: string; language?: string; copyright?: string; updated?: string | Date; generator?: string; image?: FeedImage; favicon?: string; authors?: FeedAuthor[]; categories?: FeedCategory[]; items: FeedItem[]; ttl?: number; skipHours?: number[]; skipDays?: string[]; nextUrl?: string; podcast?: PodcastFeed; feedLinks?: { rss?: string; atom?: string; json?: string; hub?: string; }; extensions?: FeedExtensions; }; export type FeedFormat = "rss" | "atom" | "json"; export type FeedOptions = { sanitize?: boolean; pretty?: boolean; stylesheet?: string; }; export type FeedOutput = { rss: string; atom: string; json: string; };