UNPKG

iracing-api

Version:

Javascript client for iracing API

100 lines (99 loc) 3.7 kB
import { API } from './api'; /** * Provides methods for interacting with car-related endpoints. */ export declare class CarAPI extends API { /** * 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. */ getCarAssets: () => Promise<Record<string, { carId: number; carRules?: any[] | undefined; detailCopy?: string | null | undefined; detailScreenShotImages?: string | null | undefined; detailTechspecsCopy?: string | null | undefined; folder?: string | null | undefined; galleryImages?: string | null | undefined; galleryPrefix?: string | null | undefined; groupImage?: string | null | undefined; groupName?: string | null | undefined; largeImage?: string | null | undefined; logo?: string | null | undefined; smallImage?: string | null | undefined; sponsorLogo?: string | null | undefined; templatePath?: string | null | undefined; }> | undefined>; /** * Get a list of all available cars. * * @returns A promise resolving to an array of car objects, or undefined on error. */ getCars: () => Promise<{ created: string; aiEnabled: boolean; allowNumberColors: boolean; allowNumberFont: boolean; allowSponsor1: boolean; allowSponsor2: boolean; allowWheelColor: boolean; awardExempt: boolean; carDirpath: string; carId: number; carName: string; carNameAbbreviated: string; carTypes: { carType: string; }[]; carWeight: number; categories: ("dirt_oval" | "dirt_road" | "formula_car" | "oval" | "sports_car")[]; firstSale: string; freeWithSubscription: boolean; hasHeadlights: boolean; hasMultipleDryTireTypes: boolean; hasRainCapableTireTypes: boolean; hp: number; isPsPurchasable: boolean; maxPowerAdjustPct: number; maxWeightPenaltyKg: number; minPowerAdjustPct: number; packageId: number; patterns: number; price: number; rainEnabled: boolean; retired: boolean; searchFilters: string; sku: number; carMake?: string | null | undefined; carModel?: string | null | undefined; forumUrl?: string | null | undefined; paintRules?: ({ restrictCustomPaint?: boolean | null | undefined; } & Record<string, { color1: string; color2: string; color3: string; paintCarAvailable: boolean; rulesExplanation: string; sponsor1: string; sponsor1Available: boolean; sponsor2: string; sponsor2Available: boolean; allowNumberColorChanges?: boolean | null | undefined; allowNumberFontChanges?: boolean | null | undefined; numberColor1?: string | null | undefined; numberColor2?: string | null | undefined; numberColor3?: string | null | undefined; numberFont?: string | null | undefined; paintWheelAvailable?: boolean | null | undefined; rimType?: string | null | undefined; rimTypeAvailable?: boolean | null | undefined; wheelColor?: string | null | undefined; }>) | null | undefined; priceDisplay?: string | null | undefined; siteUrl?: string | null | undefined; }[] | undefined>; }