queecom-core
v0.5.5
Published
Headless ecommerce core package with shared types, utilities, and domain models.
Maintainers
Readme
Queecom Core
A TypeScript-first headless ecommerce core package for shared models, utilities, and domain logic.
Getting started
npm install queecom-coreUsage
Full import (all exports)
import { useGetCategories, type AuthResponse } from 'queecom-core';Subpath imports (tree-shakeable)
Import only what you need:
// Types only
import type { AuthResponse } from 'queecom-core/types/response/auth-response';
import type { User } from 'queecom-core/types/response/auth-response';
// Hooks
import { useGetCategories, useGetSubCategories } from 'queecom-core/hooks/use-category';
// Services
import { CategoryService } from 'queecom-core/services/category-service';
// Constants
import { API } from 'queecom-core/constants/app-api';
// Enums
import { OrderStatusEnum } from 'queecom-core/enum/order-status-enum';
// Utils
import { AuthHelper } from 'queecom-core/utils/auth-helper';Structure
src/index.ts– public exportssrc/types/– domain typessrc/hooks/– react-query hookssrc/services/– api servicessrc/constants/– app constantssrc/enum/– enumssrc/utils/– small helpers
Example
import { createMoney, type Money, type Product } from 'queecom-core';
const money: Money = createMoney(1999, 'USD');
const product: Product = {
id: 'prod_123',
name: 'Wireless Headphones',
slug: 'wireless-headphones',
description: 'Noise-cancelling headphones',
price: money,
currency: 'USD',
stock: 42,
active: true,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
};