iracing-api
Version:
Javascript client for iracing API
67 lines (66 loc) • 2.58 kB
TypeScript
import { API } from './api';
import { GetClubHistoryParams, GetDriversParams } from '../types/lookup';
/**
* Provides methods for interacting with lookup endpoints (e.g., countries, drivers, licenses).
*/
export declare class LookupAPI extends API {
/**
* Get club history for a specific season.
*
* Note: Returns an earlier history if the requested quarter does not have a club history.
*
* @param {GetClubHistoryParams} params - Parameters for the request.
* @param {number} params.seasonYear - The year of the season.
* @param {number} params.seasonQuarter - The quarter of the season (1-4).
*
* @returns A promise resolving to the club history data, or undefined on error.
*/
getClubHistory: (params: GetClubHistoryParams) => Promise<Record<string, unknown> | undefined>;
/**
* Get a list of all countries recognized by iRacing.
*
* @returns A promise resolving to an array of country objects, or undefined on error.
*/
getCountries: () => Promise<{
countryName: string;
countryCode: string;
}[] | undefined>;
/**
* Search for drivers by customer ID or partial name.
*
* @param {GetDriversParams} params - Parameters for the search.
* @param {string} params.searchTerm - A customer ID or partial name to search for.
* @param {number} [params.leagueId] - Optional league ID to narrow the search to the league's roster.
*
* @returns A promise resolving to the driver search results, or undefined on error.
*/
getDrivers: (params: GetDriversParams) => Promise<Record<string, unknown> | undefined>;
/**
* Get a list of all iRacing licenses.
*
* @returns A promise resolving to an array of license objects, or undefined on error.
*/
getLicenses: () => Promise<{
groupName: string;
licenseGroup: number;
minNumRaces: number | null;
participationCredits: number;
minSrToFastTrack: number | null;
levels: {
color: string;
shortName: string;
licenseId: number;
licenseGroup: number;
license: string;
licenseLetter: string;
}[];
minNumTt: number | null;
}[] | undefined>;
/**
* Get various lookup data.
* This endpoint accepts query parameters in the format ?key=value&key=value
*
* @returns A promise resolving to the lookup data, or undefined on error.
*/
getLookupData: () => Promise<Record<string, unknown> | undefined>;
}