51 lines
2.5 KiB
TypeScript
51 lines
2.5 KiB
TypeScript
/**
|
|
* Represents a comment from the r/Drama platform, containing details about the comment's author,
|
|
* content, status, and other metadata.
|
|
* @typedef {Object} Comment
|
|
* @property {number} author_id - The unique identifier for the author of the comment.
|
|
* @property {string} author_name - The display name of the author.
|
|
* @property {string} body - The raw text content of the comment.
|
|
* @property {string} body_html - The HTML-rendered version of the comment text.
|
|
* @property {number} created_utc - The UTC timestamp when the comment was created.
|
|
* @property {number} deleted_utc - The UTC timestamp when the comment was deleted, if applicable.
|
|
* @property {boolean} distinguished - Flag indicating if the comment is distinguished by the platform (e.g., admin posts).
|
|
* @property {number} downvotes - The number of downvotes the comment has received.
|
|
* @property {number} edited_utc - The UTC timestamp when the comment was last edited, if ever.
|
|
* @property {number} id - The unique identifier for the comment.
|
|
* @property {boolean} is_banned - Flag indicating if the author was banned at the time of the comment.
|
|
* @property {boolean} is_bot - Flag indicating if the comment was made by a bot.
|
|
* @property {boolean} is_nsfw - Flag indicating if the comment is marked as NSFW (Not Safe For Work).
|
|
* @property {number} level - The nesting level of the comment in the conversation thread.
|
|
* @property {string} permalink - The permanent link to the comment.
|
|
* @property {string} pinned - The name of the user who pinned the comment, if any.
|
|
* @property {number} post_id - The unique identifier of the post to which the comment belongs.
|
|
* @property {number[]} replies - An array of comment IDs representing the direct replies to this comment.
|
|
* @property {Record<string, unknown>} reports - An object containing any reports made on the comment.
|
|
* @property {number} score - The total score of the comment (upvotes - downvotes).
|
|
* @property {number} upvotes - The number of upvotes the comment has received.
|
|
*/
|
|
export type Comment = {
|
|
author_id: number;
|
|
author_name: string;
|
|
body: string;
|
|
body_html: string;
|
|
created_utc: number;
|
|
deleted_utc: number;
|
|
distinguished: boolean;
|
|
downvotes: number;
|
|
edited_utc: number;
|
|
id: number;
|
|
is_banned: boolean;
|
|
is_bot: boolean;
|
|
is_nsfw: boolean;
|
|
level: number;
|
|
permalink: string;
|
|
pinned: string | null;
|
|
parent_comment_id?: number | null;
|
|
post_id: number;
|
|
replies: number[];
|
|
reports: Record<string, unknown>;
|
|
score: number;
|
|
upvotes: number;
|
|
};
|