react-rss
Version:
React component capable of reading and rendering any RSS feed
15 lines (14 loc) • 1.41 kB
TypeScript
import React from 'react';
import { InjectionRSSProps, InjectionRSSUrlProps, Standard2RSSFormatItem, Standard2RSSFormatHeader } from '../types';
/**
* Higher-order component enhancer for rss feed
* @param Component Component to enhance
* @param url Static url from which to draw
* @param requestEnhancer You can use this to statically enhance requests by setting request headers, method etc.
* @param headerEnhancer Use this function to add properties to resulting rss object. You can use standard media queries on rssElement to do so.
* @param itemEnhacer Use this to enhance individual news from feed. You can use standard media queries on item to do so.
*/
export declare const rssEnhancer: <T, E extends string | null = null>(Component: ((props: T & InjectionRSSProps<{}, {}>) => JSX.Element | null) | (new (props: T & InjectionRSSProps<{}, {}>) => React.Component<T & InjectionRSSProps<{}, {}>, {}, any>), url?: E, requestEnhancer?: ((url: string) => ({
input: RequestInfo;
init?: RequestInit;
})) | undefined, headerEnhancer?: (<F extends Standard2RSSFormatHeader>(header: any, standard: Standard2RSSFormatHeader) => Standard2RSSFormatHeader | F) | undefined, itemEnhancer?: (<K extends Standard2RSSFormatItem>(item: any, standard: Standard2RSSFormatItem) => Standard2RSSFormatItem | K) | undefined) => (props: Pick<T, Exclude<keyof T, "rss">> & InjectionRSSUrlProps) => JSX.Element;