Package Exports
- orpc-planets-api
- orpc-planets-api/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (orpc-planets-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
orpc-planets-api
oRPC контракт для планетарного API. Этот пакет предоставляет типизированный контракт для взаимодействия с API планет.
Установка
npm install orpc-planets-api
# или
yarn add orpc-planets-api
# или
bun add orpc-planets-apiИспользование
Клиент
import { createClient } from "@orpc/client";
import type { Contract } from "orpc-planets-api";
// Создайте клиент с типом контракта
const client = createClient<Contract>({
// URL вашего API
url: "https://your-api-url.com",
});
// Использование клиента
const planets = await client.planet.list({ limit: 10 });
const planet = await client.planet.find({ id: 1 });
const newPlanet = await client.planet.create({
name: "Марс",
description: "Красная планета",
});Типы
import type { Planet } from "orpc-planets-api";
// Использование типа Planet
const mars: Planet = {
id: 1,
name: "Марс",
description: "Красная планета",
};Лицензия
MIT