UNPKG

iracing-api

Version:

Javascript client for iracing API

28 lines (27 loc) 868 B
import { API } from './api'; /** * Provides methods for interacting with car-related endpoints. */ export class CarAPI extends API { constructor() { super(...arguments); /** * Get car assets, including images and details. * * Note: Image paths in the response are relative to `https://images-static.iracing.com/`. * * @returns A promise resolving to the car assets data, or undefined on error. */ this.getCarAssets = async () => { return await this._getData('data/car/assets'); }; /** * Get a list of all available cars. * * @returns A promise resolving to an array of car objects, or undefined on error. */ this.getCars = async () => { return await this._getData('data/car/get'); }; } }