Class CurseForgeClient

The main class to interact with the CurseForge Core API.

Hierarchy

  • CurseForgeClient

Constructors

Properties

#apiHost: string = 'https://api.curseforge.com'
#apiKey: string
#fetch: ((...args: any[]) => Promise<any>)

Type declaration

    • (...args: any[]): Promise<any>
    • Parameters

      • Rest ...args: any[]

      Returns Promise<any>

#dateRegex: RegExp = ...

Methods

  • Creates an array of the given class.

    Returns

    An array of CurseForgeType objects

    Type Parameters

    • T

    Parameters

    • CurseForgeType: CurseForgeClass

      The class of objects to create

    • data: Record<string, any>

      The raw API response array data

    Returns T[]

  • Get the changelog of a file in HTML format.

    Returns

    The HTML changelog

    Throws

    CurseForgeResponseError when the request fails

    Parameters

    • modId: number

      The mod id the file belongs to

    • fileId: number

      The file id

    Returns Promise<string>

  • Get a download URL for a specific file.

    Returns

    The URL

    Throws

    CurseForgeResponseError when the request fails

    Parameters

    • modId: number

      The mod id the file belongs to

    • fileId: number

      The file id

    Returns Promise<string>

  • Does an in place conversion of date string values into Date objects.

    Returns

    The object

    Parameters

    • object: any

      The object to convert

    Returns any

Generated using TypeDoc