1.1.2 • Published 5 months 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-types
Using
The name structure of the types is divided into some parts:
- Types exported with suffix
Payload
means that the data comes from REST API - Types export with prefix
REST
means that the data comes from or is directly related to the REST API- Example:
RESTPostCreateTeamResult
andRESTPostCreateTeamOptions
- Types that are exported as
never
means that the data is a204: No Content
(it's safe)
- Example:
- Types that are exported from
globals.ts
file 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