https://github.com/vkcom/api-schema-typescript
https://github.com/vkcom/api-schema-typescript
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/vkcom/api-schema-typescript
- Owner: VKCOM
- License: mit
- Archived: true
- Created: 2020-12-16T09:33:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-08-25T00:36:09.000Z (almost 3 years ago)
- Last Synced: 2025-01-12T08:49:26.931Z (over 1 year ago)
- Language: TypeScript
- Size: 297 KB
- Stars: 10
- Watchers: 14
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# VK API Schema Typescript
This repository contains prebuilt TypeScript typings for [VK API Schema](https://github.com/VKCOM/vk-api-schema).
The generation is performed with [VKCOM/api-schema-typescript-generator](https://github.com/VKCOM/api-schema-typescript-generator).
## Current API version – **5.131**
The package versions will follow API versions. It means that for **5.131** API version the package version will be **\*.5131.\***.
## Install
```
yarn add @vkontakte/api-schema-typescript
```
```
npm i --save @vkontakte/api-schema-typescript
```
## Usage
You can import params, responses, and objects from the library.
```typescript
import {
MessagesGetByIdParams, // Method params
MessagesGetByIdExtendedResponse, // Response interface
MessagesMessage, // Any object
} from '@vkontakte/api-schema-typescript';
const params: MessagesGetByIdParams = {
message_ids: [1, 2, 3].join(','),
extended: 1,
};
apiRequest('messages.getById', params).then((response: MessagesGetByIdExtendedResponse) => {
response.items.forEach((message) => {
if (message.out) {
}
});
});
```