Prood
Packages

@prood/types

Unified data model — domain types, adapter interfaces, and provider contracts.

@prood/types is the shared vocabulary for all Prood packages. It contains TypeScript interfaces and types only — no runtime code, no dependencies.

Installation

pnpm add @prood/types

Already included as a dependency of @prood/commerce, @prood/platform, and @prood/ui.

Domain types

Catalog

import type {
  Product,
  ProductVariant,
  ProductOption,
  Category,
  Brand,
  SearchResult,
  SearchParams,
} from '@prood/types'

Cart & checkout

import type {
  Cart,
  CartItem,
  CartTotals,
  ShippingMethod,
  PaymentMethod,
  Address,
  CustomerInfo,
} from '@prood/types'

Orders

import type {
  Order,
  OrderItem,
  OrderStatus,
  FulfillmentStatus,
} from '@prood/types'

Store & customers

import type { StoreInfo, Customer, Country } from '@prood/types'

Adapter interfaces

import type {
  CommerceAdapter,
  CatalogAdapter,
  CartAdapter,
  CheckoutAdapter,
  OrdersAdapter,
  CustomersAdapter,
  StoreAdapter,
} from '@prood/types'

Implement these to create a custom commerce backend adapter.

Provider interfaces

import type {
  PaymentProvider,
  PaymentSession,
  CreatePaymentSessionInput,
  RefundInput,
  PaymentWebhookEvent,
  StorageProvider,
  UploadInput,
  UploadResult,
} from '@prood/types'

Error handling

import { CommerceError, toErrorResponse, priceToMajorAmount } from '@prood/types'

// Throw structured errors
throw new CommerceError('Product not found', 'NOT_FOUND', 404)

// Convert to HTTP response
const { error, code, status } = toErrorResponse(err)

// Price formatting
priceToMajorAmount(9999, 'EUR') // → 99.99

Admin types

Input/output types for dashboard and admin API operations:

import type {
  CreateProductInput,
  UpdateProductInput,
  DashboardStats,
  FulfillOrderInput,
  RefundOrderInput,
} from '@prood/types'

Specialized domains

Types for advanced commerce patterns:

import type {
  Auction, Bid,
  Rental, RentalBooking,
  PriceTier, QuoteRequest,
  GiftCard, GiftCardBalance,
  Subscription, SubscriptionPlan,
  ReturnRequest,
} from '@prood/types'

Package structure

Drag to pan · Scroll to zoom

On this page