mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* feat(@types/react-native-rss-parser): Create types * feat(@types/react-native-rss-parser): Add itunes prop
19 lines
552 B
TypeScript
19 lines
552 B
TypeScript
import { parse } from 'react-native-rss-parser';
|
|
|
|
// -- Globals --
|
|
declare const fetch: (url: string) => Promise<any>;
|
|
declare const console: any;
|
|
|
|
fetch('http://rss-url.com')
|
|
.then(response => response.text())
|
|
.then(parse)
|
|
.then(feed => {
|
|
feed.authors[0].name; // $ExpectError
|
|
feed.image.title.toUpperCase(); // $ExpectType string
|
|
feed.image.height.toUpperCase(); // $ExpectError
|
|
|
|
feed.items[0].id; // $ExpectType string
|
|
feed.items[0].authors.name; // $ExpectError
|
|
})
|
|
.catch(console.error);
|