@shopperlabs/shopper-types package provides comprehensive TypeScript type definitions for all Shopper models and entities. These types are useful when building storefronts, mobile apps, or any TypeScript application that interacts with the Shopper API.
Installation
As of v2.9 the package ships as ECMAScript Modules (
"type": "module" with an exports map). Use import rather than CommonJS require(). ESM-first projects need no changes.Usage
Import types directly from the package:Available Types
The package exports types for all Shopper models:Enums
The package also exports enums for type-safe status checks:Available Enums
Common Interfaces
Entity
All models extend the baseEntity interface:
DateEntity
Dates are returned with both raw and human-readable formats:Price
Pricing information for products and variants:ShippingFields
Physical dimensions for shippable products:Example: Storefront Product List
Example: Order Details
Source Code
The types are open source and available on GitHub:GitHub Repository
View the source code and contribute to the types package.