-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
112 lines (93 loc) · 1.95 KB
/
index.d.ts
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* Users are identified by case-sensitive ids, and live under `/v0/user/`.
* Only users that have public activity (comments or story submissions) on the site are
* available through the API.
*/
export interface IUser {
/**
* The user's unique username. Case-sensitive. Required.
*/
id: string;
/**
* Creation date of the user, in Unix Time.
*/
created: number;
/**
* The user's karma.
*/
karma: number;
/**
* The user's optional self-description. HTML.
*/
about?: string;
/**
* List of the user's stories, polls and comments.
*/
submitted?: number[];
}
/**
* Stories, comments, jobs, Ask HNs and even polls are just items. They're identified by their ids,
* which are unique integers, and live under `/v0/item/<id>`.
*/
export interface IItem {
/**
* The item's unique id.
*/
id: number;
/**
* `true` if the item is deleted.
*/
deleted?: boolean;
/**
* The type of item. One of `job`, `story`, `comment`, `poll`, or `pollopt`.
*/
type?: string;
/**
* The username of the item's author.
*/
by?: string;
/**
* Creation date of the item, in Unix Time.
*/
time?: number;
/**
* The comment, story or poll text. HTML.
*/
text?: string;
/**
* `true` if the item is dead.
*/
dead?: boolean;
/**
* The comment's parent: either another comment or the relevant story.
*/
parent?: number;
/**
* The pollopt's associated poll.
*/
poll?: number;
/**
* The ids of the item's comments, in ranked display order.
*/
kids?: number[];
/**
* The URL of the story.
*/
url?: string;
/**
* The story's score, or the votes for a pollopt.
*/
score?: number;
/**
* The title of the story, poll or job. HTML.
*/
title?: string;
/**
* A list of related pollopts, in display order.
*/
parts?: number[];
/**
* In the case of stories or polls, the total comment count.
*/
descendants?: number;
}