storenest-commerce
Version:
Complete e-commerce SDK for Storenest platform with React components, multi-language support, secure checkout, and enterprise-grade security
42 lines (41 loc) • 1.44 kB
TypeScript
import { ReactNode } from 'react';
interface StorenestContextType {
user: any;
userShopId: number | null;
isAuthenticated: boolean;
authLoading: boolean;
authError: string | null;
login: (params: any) => Promise<void>;
register: (params: any) => Promise<void>;
logout: () => void;
cart: any;
cartLoading: boolean;
cartError: string | null;
cartItemCount: number;
cartTotal: number;
addToCart: (params: any) => Promise<void>;
updateCartItem: (params: any) => Promise<void>;
removeFromCart: (params: any) => Promise<void>;
refreshCart: () => Promise<void>;
products: any[];
productsLoading: boolean;
productsError: string | null;
productsTotal: number;
productsPage: number;
productsLimit: number;
hasNextPage: boolean;
hasPreviousPage: boolean;
loadProducts: (page?: number, limit?: number) => Promise<void>;
loadProductsByCategory: (categorySlug: string, page?: number, limit?: number) => Promise<void>;
product: any;
productLoading: boolean;
productError: string | null;
loadProduct: (productId: number) => Promise<void>;
}
interface StorenestProviderProps {
children: ReactNode;
storageKey?: string;
}
export declare function StorenestProvider({ children, storageKey }: StorenestProviderProps): import("react/jsx-runtime").JSX.Element;
export declare function useStorenest(): StorenestContextType;
export {};