import { Client } from '../client'; import { BaseError } from '../errors'; import { UriHelper, HandlerQuery } from '../uri-helper'; import { ThBaseHandler } from '../base'; export interface Images { '1x'?: string; avatar?: string; } export interface Cart { id?: string; name?: string; } export interface CartsOptions { user?: string; base?: string; limit?: number; uri?: string; query?: { deleted?: boolean; active?: boolean; [key: string]: any; }; } export interface CartDeleteOptions { [key: string]: any; } export interface CartsResponse { data?: Cart[]; metadata?: Record; msg?: string; next?: () => Promise; } export interface CartResponse { data: Cart; metadata?: { count?: number; patch?: any; }; msg?: string; errors?: ErrorObject[]; } export interface ErrorObject { id: string; label: string; errorDetails: Record; } export interface CartsCreateQuery { [key: string]: any; } export interface HandlerProductsQuery extends HandlerQuery { query?: CartsCreateQuery; } export interface ProductsUpdateRequestObject { cartId: string; body: Cart; } export declare class Carts extends ThBaseHandler { static baseEndpoint: string; endpoint: string; http: Client; options: CartsOptions; uriHelper: UriHelper; constructor(options: CartsOptions, http: Client); create(cart: Cart, query?: Record): Promise; getAll(options?: CartsOptions | undefined): Promise; get(cartId: string): Promise; meta(): Promise; put(cartId: string, cart: Cart): Promise; delete(cartId: string, deleteOptions?: CartDeleteOptions): Promise; search(searchTerm: string): Promise; } export declare class CartFetchFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class CartsSearchFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class CartsDeleteFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class CartsUpdateFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class CartsMetaFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class CartsFetchFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); } export declare class CartsCreateFailed extends BaseError { message: string; name: string; constructor(message?: string, properties?: Record); }