iracing-api
Version:
Javascript client for iracing API
24 lines (23 loc) • 846 B
JavaScript
import { API } from './api';
/**
* Provides methods for interacting with track-related endpoints.
*/
export class TrackAPI extends API {
constructor() {
super(...arguments);
/**
* Get assets for all tracks (logos, images, map layers, etc.).
*
* Note: Image paths are relative to `https://images-static.iracing.com/`.
*
* @returns A promise resolving to the track assets data, or undefined on error.
*/
this.getTrackAssets = async () => await this._getData('data/track/assets');
/**
* Get a list of all available tracks and their configurations.
*
* @returns A promise resolving to an array of track objects, or undefined on error.
*/
this.getTracks = async () => await this._getData('data/track/get');
}
}