Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Notification

class
extends

{ HackerAPI.Base }

Hierarchy

Index

Constructors

constructor

  • new Notification(__namedParameters?: { category: undefined | string; contents: undefined | string; time: undefined | Date; title: undefined | string }): Notification
  • Creates a new notification instance

    constructor

    Parameters

    • Default value __namedParameters: { category: undefined | string; contents: undefined | string; time: undefined | Date; title: undefined | string } = {}
      • category: undefined | string
      • contents: undefined | string
      • time: undefined | Date
      • title: undefined | string

    Returns Notification

Properties

Optional category

category: undefined | string

Optional contents

contents: undefined | string

specialHandlers

specialHandlers: {}

Type declaration

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

        • Rest ...args: unknown[]

        Returns [string, undefined | string]

Optional time

time: Date

Optional title

title: 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 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]

Static send

  • send(notif: Notification, token?: undefined | string): Promise<null>

Generated using TypeDoc