This package includes response typings for the Star Citizen Wiki API. Currently types are limited to Star Systems, Ships and their respective relations.
npm: npm install --save-dev sc-api-types
yarn: yarn add --dev sc-api-types
You can include the objects relationships by passing instruction to the generic response type, like this:
import { ShipResponse } from 'sc-api-types';
// now intersects with { components: { data: ShipComponent[] } }
type ShipWithComponentsResponse = ShipResponse<{ components: true }>;
If you're using the APIs locale parameter you'll want the response types to reflect the correct description property type. You can tell the response type that you're using the locale parameter like this:
import { ShipResponse } from 'sc-api-types';
// now descriptions are of type string instead of the locales object
type ShipWithStringDescs = ShipResponse<{}, 'en_EN'>;
If you're facing issues with these typings please do not hesistate to create an issue or pull request.