Options
All
  • Public
  • Public/Protected
  • All
Menu

Sv443 Joke API - v0.0.8

Index

Type aliases

Category

Category: "Programming" | "Misc" | "Dark" | "Pun" | "Spooky" | "Christmas" | "Miscellaneous" | "Coding" | "Development" | "Halloween"

Error

Error: { code: any; description: string }

Type of Error object

Type declaration

  • code: any

    Error code

  • description: string

    Description of the error

Flag

Flag: "nsfw" | "religious" | "political" | "racist" | "sexist" | "explicit"

IdRangeObject

IdRangeObject: { from: number; to: number }

Type declaration

  • from: number
  • to: number

JokeType

JokeType: "single" | "twopart"

LanguageCode

LanguageCode: "cs" | "de" | "en" | "es"

NumberObject

NumberObject<ValueType>: {}

A wrapper for "Object with number keys" type

Type parameters

  • ValueType

Type declaration

  • [key: number]: ValueType

ResponseFormat

ResponseFormat: "json" | "xml" | "yaml" | "plain"

StrObject

StrObject<ValueType>: {}

A wrapper for "Object with string keys" type

Type parameters

  • ValueType

Type declaration

  • [key: string]: ValueType

Functions

getCategories

  • Fetches available categories on the api

    Parameters

    Returns Promise<object | Response>

getFlags

  • Fetches available flags on the api

    Parameters

    Returns Promise<object | Response>

getFormats

  • Fetches available response formats on the api

    Parameters

    Returns Promise<object | Response>

getInfo

  • Fetches the basic info of the api

    Parameters

    Returns Promise<object | Response>

getJokes

  • getJokes(options?: JokesRequestOptions): Promise<object | Response>
  • Fetches jokes from the api

    Parameters

    • Default value options: JokesRequestOptions = {}

    Returns Promise<object | Response>

getLangCode

  • Fetches language code of a language

    Parameters

    Returns Promise<object | Response>

getLanguages

makeRequestToApi

  • makeRequestToApi(routeName: string, params?: object): Promise<object | Response>
  • Makes a request to the API

    Parameters

    • routeName: string

      Route of the request

    • Default value params: object = {}

      Parameters to pass in the request

    Returns Promise<object | Response>

Object literals

Const SETTINGS

SETTINGS: object

handleResponsesInternally

handleResponsesInternally: false = false

logging

logging: false = false

safeMode

safeMode: false = false

Const VALUES

VALUES: object

API_BASE

API_BASE: string = "https://jokeapi.dev/"

_AVAILABLE_CATEGORIES

_AVAILABLE_CATEGORIES: string[] = ["Programming","Misc","Dark","Pun","Spooky","Christmas","Miscellaneous","Coding","Development","Halloween"]

_AVAILABLE_FLAGS

_AVAILABLE_FLAGS: string[] = ["nsfw", "religious", "political", "racist", "sexist", "explicit"]

Generated using TypeDoc