UNPKG

@shaggytools/nhtsa-api-wrapper

Version:

Universal javascript wrapper for the NHTSA.dot.gov VPIC 'vehicles' API, useful for VIN decoding, etc.

53 lines 2.28 kB
/** * @module api/endpoints/GetAllManufacturers * @category API Endpoints */ import type { NhtsaResponse } from '../../types'; /** * ::: tip :bulb: More Information * See: [GetAllManufacturers Documentation](/api/endpoints/get-all-manufacturers) * ::: * * `GetAllManufacturers` provides a list of all the Manufacturers available in the vPIC Dataset. * * `params.manufacturerType` is optional but allows the user to filter the list based on * manufacturer type. Types include 'Incomplete Vehicles', 'Completed Vehicle Manufacturer', * 'Incomplete Vehicle Manufacturer', 'Intermediate Manufacturer', 'Final-Stage Manufacturer', * 'Alterer', or any partial match of those strings. * * `params.page` is optional and used to specify (n)th page of results. Results are provided in * pages of 100 items. * * @param [params] - Object of Query Search names and values to append to the URL as a query string. * @param {string} [params.manufacturerType] - See function description * @param {(string|number)} [params.page] - Specify page number (results returned 100 at a time) * @param {boolean} [doFetch=true] - Whether to fetch the data or just return the URL * (default: `true`) * @returns {(Promise<NhtsaResponse<GetAllManufacturersResults> | string>)} - Api Response `object` * -or- url `string` if `doFetch = false` */ declare function GetAllManufacturers(doFetch: true, _dummy?: undefined): Promise<NhtsaResponse<GetAllManufacturersResults>>; declare function GetAllManufacturers(doFetch?: false, _dummy?: undefined): Promise<string>; declare function GetAllManufacturers(params: { manufacturerType?: string; page?: string | number; }, doFetch: false): Promise<string>; declare function GetAllManufacturers(params?: { manufacturerType?: string; page?: string | number; }, doFetch?: true): Promise<NhtsaResponse<GetAllManufacturersResults>>; export { GetAllManufacturers }; /** * Objects found in the `Results` array of `GetAllManufacturers` endpoint response. */ export type GetAllManufacturersResults = { Country: string; Mfr_CommonName: string | null; Mfr_ID: number; Mfr_Name: string; VehicleTypes: Array<{ IsPrimary?: boolean; Name?: string; }>; }; //# sourceMappingURL=GetAllManufacturers.d.ts.map