1.1.4 • Published 3 years ago

sc-api-types v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

sc-api-types

This package includes response typings for the Star Citizen Wiki API. Currently types are limited to Star Systems, Ships and their respective relations.

Installation

npm: npm install --save-dev sc-api-types

yarn: yarn add --dev sc-api-types

Usage

Include Relationships

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 }>;

Correct Locale Typing

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'>;

Issues

If you're facing issues with these typings please do not hesistate to create an issue or pull request.

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago