iracing-api
Version:
Javascript client for iracing API
101 lines (100 loc) • 3.13 kB
TypeScript
import { API } from './api';
/**
* Provides methods for interacting with track-related endpoints.
*/
export declare class TrackAPI extends API {
/**
* 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.
*/
getTrackAssets: () => Promise<Record<string, {
detailCopy: string;
detailTechspecsCopy: string | null;
folder: string;
galleryImages: string | null;
galleryPrefix: string | null;
largeImage: string;
logo: string;
smallImage: string;
trackId: number;
coordinates: string;
detailVideo: null;
north: string | null;
numSvgImages: number;
trackMap: string;
trackMapLayers: {
active: string;
inactive: string;
background: string;
pitroad: string;
startFinish: string;
turns: string;
};
}> | undefined>;
/**
* Get a list of all available tracks and their configurations.
*
* @returns A promise resolving to an array of track objects, or undefined on error.
*/
getTracks: () => Promise<{
location: string;
priority: number;
created: string;
aiEnabled: boolean;
awardExempt: boolean;
firstSale: string;
freeWithSubscription: boolean;
isPsPurchasable: boolean;
packageId: number;
price: number;
retired: boolean;
searchFilters: string;
sku: number;
trackId: number;
trackName: string;
category: "dirt_oval" | "dirt_road" | "oval" | "road";
categoryId: number;
qualifyLaps: number;
trackTypes: {
trackType: "dirt_oval" | "dirt_road" | "oval" | "road";
}[];
hasOptPath: boolean;
cornersPerLap: number;
allowPitlaneCollisions: boolean;
allowRollingStart: boolean;
allowStandingStart: boolean;
closes: string;
fullyLit: boolean;
gridStalls: number;
hasShortParadeLap: boolean;
hasStartZone: boolean;
hasSvgMap: boolean;
isDirt: boolean;
isOval: boolean;
lapScoring: number;
latitude: number;
longitude: number;
maxCars: number;
nightLighting: boolean;
nominalLapTime: number;
numberPitstalls: number;
opens: string;
purchasable: boolean;
restartOnLeft: boolean;
soloLaps: number;
startOnLeft: boolean;
supportsGripCompound: boolean;
techTrack: boolean;
timeZone: string;
trackConfigLength: number;
trackDirpath: string;
configName?: string | null | undefined;
pitRoadSpeedLimit?: number | null | undefined;
priceDisplay?: string | null | undefined;
siteUrl?: string | null | undefined;
banking?: string | null | undefined;
}[] | undefined>;
}