-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathindex.d.ts
More file actions
98 lines (84 loc) · 2.63 KB
/
index.d.ts
File metadata and controls
98 lines (84 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/// <reference types="node" />
import stream = require("stream");
export = FeedParser;
declare class FeedParser extends stream.Transform {
constructor(options?: FeedParser.Options);
meta: FeedParser.Meta;
options: FeedParser.Options;
read(): FeedParser.Item | null;
resumeSaxError(): void;
on(event: 'meta', listener: (meta: FeedParser.Meta) => void): this;
on(event: 'readable', listener: (this: FeedParser) => void): this;
on(event: 'error', listener: (error: Error) => void): this;
on(event: string, listener: (...args: any[]) => void): this;
addListener(event: 'meta', listener: (meta: FeedParser.Meta) => void): this;
addListener(event: 'readable', listener: (this: FeedParser) => void): this;
addListener(event: 'error', listener: (error: Error) => void): this;
addListener(event: string, listener: (...args: any[]) => void): this;
once(event: 'meta', listener: (meta: FeedParser.Meta) => void): this;
once(event: 'readable', listener: (this: FeedParser) => void): this;
once(event: 'error', listener: (error: Error) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
}
declare namespace FeedParser {
type Type = "atom" | "rss" | "rdf";
interface Options {
strict?: boolean;
normalize?: boolean;
addmeta?: boolean;
feedurl?: string;
resume_saxerror?: boolean;
MAX_BUFFER_LENGTH?: number;
}
interface Image {
url: string;
title: string;
}
interface Meta {
"#ns": Array<{ [key: string]: string }>;
"#type": Type;
"#version": string;
"@": { [key: string]: any };
title: string;
description: string;
date: Date | null;
pubdate: Date | null;
link: string;
xmlurl: string;
author: string;
language: string;
image: Image;
favicon: string;
copyright: string;
generator: string;
categories: string[];
[key: string]: any;
}
interface Enclosure {
url: string;
type?: string;
length?: string;
}
interface Source {
title: string;
url: string;
}
interface Item {
title: string;
description: string;
summary: string;
date: Date | null;
pubdate: Date | null;
link: string;
origlink: string;
author: string;
guid: string;
comments: string;
image: { url: string };
categories: string[];
source: Source;
enclosures: Enclosure[];
meta: Meta;
[key: string]: any;
}
}