1.1.2 • Published 2 years ago
@simo.js/simo-api-types v1.1.2
Simo API Types
Type definitions for Simo API
- Lightweight and easy to use
- Supports all types used
Installation
The only way to install simo-api-types is via npm
npm install @simo.js/simo-api-typesUsing
The name structure of the types is divided into some parts:
- Types exported with suffix
Payloadmeans that the data comes from REST API - Types export with prefix
RESTmeans that the data comes from or is directly related to the REST API- Example:
RESTPostCreateTeamResultandRESTPostCreateTeamOptions - Types that are exported as
nevermeans that the data is a204: No Content(it's safe)
- Example:
- Types that are exported from
globals.tsfile means that the type are used in the entire API (It doesn't follow the type name structure)
Example
import { REST, Routes } from '@simo.js/rest';
import { UserPayload } from '@simo.js/simo-api-types';
const rest = new REST({ auth: 'some-api-key' });
rest.get<UserPayload>(Routes.getUser('some-user-id')).then(console.log);Util Links
Help
If you don't understand something or you are experiencing problems, please join simo Server