Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MailEvent

Data container for mail events with static methods for interfacing with hackerapi

class

Hierarchy

Index

Constructors

constructor

Properties

payload

payload: Payload

specialHandlers

specialHandlers: {}

Type declaration

  • [key: string]: (...args: unknown[]) => [string, undefined | string]
      • (...args: unknown[]): [string, undefined | string]
      • Parameters

        • Rest ...args: unknown[]

        Returns [string, undefined | string]

Methods

toHackerAPIFormat

  • toHackerAPIFormat(method?: undefined | string): {}

Static dateHandler

  • dateHandler(key: string, date: string | Date): string[]
  • Converts a Javascript date (where only day, month and year are relevant) to a format understood by hackerapi

    Parameters

    • key: string
    • date: string | Date

      Doesn't do anything if string

    Returns string[]

    key: [0], value: [1]

Static dateTimeHandler

  • dateTimeHandler(key: string, datetime: string | Date): string[]
  • Converts Javascript date to a format understood by hackerapi

    Parameters

    • key: string
    • datetime: string | Date

    Returns string[]

    key: [0], value: [1]

Static doNotSendHandler

  • doNotSendHandler(key: string, _: any): (undefined | string)[]
  • Does not send the field to hackerapi

    Parameters

    • key: string
    • _: any

    Returns (undefined | string)[]

    key: [0], value: [1]

Static fetchAll

  • fetchAll(__namedParameters?: { id: string | number }, token?: undefined | string): Promise<MailEvent[]>
  • Fetches all the email events for a user

    Parameters

    • Default value __namedParameters: { id: string | number } = { id: "me" }
      • id: string | number
    • Optional token: undefined | string

    Returns Promise<MailEvent[]>

Static renameHandler

  • renameHandler(renamedKey: string): (Anonymous function)
  • HOC for renaming a field before sending it to hackerapi

    Parameters

    • renamedKey: string

      The string to rename the key to

    Returns (Anonymous function)

    key: [0], value: [1]

Generated using TypeDoc