-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
24 lines (21 loc) · 1.09 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export type NewsItemDetails = {
id: number; // The item's unique id.
deleted?: boolean; // true if the item is deleted.
type: "job" | "story" | "comment" | "poll" | "pollopt"; // The type of item. One of "job", "story", "comment", "poll", or "pollopt".
by: string; // The username of the item's author.
time: number; // Creation date of the item, in Unix Time.
text?: string; // The comment, story or poll text. HTML.
dead?: boolean; // true if the item is dead.
parent?: number[]; // The comment's parent: either another comment or the relevant story.
poll?: string; // The pollopt's associated poll.
kids: number[]; // The ids of the item's comments, in ranked display order.
url: string; // The URL of the story.
score: number; // The story's score, or the votes for a pollopt.
title: string; // The title of the story, poll or job. HTML.
parts?: []; // A list of related pollopts, in display order.
descendants: number; // In the case of stories or polls, the total comment count.
}
export type NewsItemComments = {
newsItem: NewsItemDetails;
comments: NewsItemDetails[];
}