Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PostImageService

Post image services.

Hierarchy

Constructors

constructor

Properties

Readonly dbm

dbm: default

Methods

createPostImage

  • createPostImage(postID: string, imageData: Buffer): Promise<string>
  • Create a new image and associate it with a post.

    Parameters

    • postID: string

      A post's ID.

    • imageData: Buffer

      The binary data of the new image.

    Returns Promise<string>

    The new image's ID.

createPostImages

  • createPostImages(postID: string, imageData: Buffer[]): Promise<string[]>
  • Create new images and associate them with a post.

    Parameters

    • postID: string

      A post's ID.

    • imageData: Buffer[]

      The binary data of the new images.

    Returns Promise<string[]>

    The IDs of the new images.

deletePostImage

  • deletePostImage(postID: string, index: number): Promise<boolean>
  • Delete a specific image from a post.

    Parameters

    • postID: string

      A post's ID.

    • index: number

      The index of the post's image.

    Returns Promise<boolean>

    Whether or not the deletion succeeded.

deletePostImages

  • deletePostImages(postID: string): Promise<void>
  • Delete all images associated with a post.

    Parameters

    • postID: string

      A post's ID.

    Returns Promise<void>

getPostImages

  • getPostImages(postID: string): Promise<Image[]>
  • Get all images associated with a post.

    Parameters

    • postID: string

      A post's ID.

    Returns Promise<Image[]>

    The images associated with the post.

numImages

  • numImages(postID: string): Promise<number>
  • Get the number of images associated with a post.

    Parameters

    • postID: string

      A post's ID.

    Returns Promise<number>

    The number of images associated with the post.

setPostImage

  • setPostImage(postID: string, imageID: string): Promise<void>
  • Associate an image with a post.

    Parameters

    • postID: string

      A post's ID.

    • imageID: string

      An image's ID.

    Returns Promise<void>

Generated using TypeDoc