Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Comment

Represents a single comment on an image

export
class

Comment

Hierarchy

  • Comment

Index

Properties

Private _image

_image: number = 0

The internal ID of the image this comment was posted on

readonly
type

{number}

memberof

Comment

authorAvatar

authorAvatar: string = ""

A URI representing the user's avatar

May be a data URI or a link to an image

type

{string}

memberof

Comment

Optional authorId

authorId: undefined | number = undefined

The ID of the user who posted this comment

type

{number}

memberof

Comment

authorName

authorName: string = ""

The name of the user who posted this comment

Use this instead of (await author()).name to save an HTTP request and make the Derpi admins happy

readonly
type

{string}

memberof

Comment

body

body: string = ""

The body of the comment

readonly
type

{string}

memberof

Comment

Optional editReason

editReason: undefined | string = undefined

Why the comment was edited

type

{string}

memberof

Comment

Optional edited

edited: Date = undefined

The date the comment was last edited on

type

{Date}

memberof

Comment

id

id: number = 0

The ID of the comment

readonly
type

{number}

memberof

Comment

posted

posted: Date = Consts.DEFAULT_DATE

The date the comment was posted on

readonly
type

{Date}

memberof

Comment

updated

updated: Date = Consts.DEFAULT_DATE

The date the comment was last updated on

readonly
type

{Date}

memberof

Comment

Methods

author

  • author(): Promise<User | null>
  • Gets the author of this comment

    memberof

    Comment

    Returns Promise<User | null>

    A Promise wrapping the user that posted this comment

image

  • image(): Promise<Image>
  • Gets the image this comment belongs to

    memberof

    Comment

    Returns Promise<Image>

    A Promise wrapping the image this comment was posted on

Generated using TypeDoc