import type { PublicProduct } from '../../blocks/products/shared';
export type CommerceCartItem = Readonly<{
    key: string;
    kind: 'product';
    productId: string;
    variantId?: string;
    title: string;
    variantTitle?: string | null;
    quantity: number;
    unitPriceCents: number;
    currency: string;
    imageUrl?: string | null;
    soldOut?: boolean;
}> | Readonly<{
    key: string;
    kind: 'pass';
    passId: string;
    title: string;
    quantity: 1;
    unitPriceCents: number;
    currency: string;
}>;
export type CommerceCartState = Readonly<{
    items: CommerceCartItem[];
}>;
export type CommerceCheckoutState = Readonly<{
    kind: 'empty';
}> | Readonly<{
    kind: 'blocked';
    reason: 'mixed_currency';
}> | Readonly<{
    kind: 'ready';
    currency: string;
    subtotalCents: number;
    items: CommerceCartItem[];
}>;
export type CommerceCartAction = Readonly<{
    type: 'add_product';
    item: Extract<CommerceCartItem, {
        kind: 'product';
    }>;
}> | Readonly<{
    type: 'add_pass';
    item: Extract<CommerceCartItem, {
        kind: 'pass';
    }>;
}> | Readonly<{
    type: 'update_quantity';
    itemKey: string;
    quantity: number;
}> | Readonly<{
    type: 'remove_item';
    itemKey: string;
}> | Readonly<{
    type: 'clear';
}>;
export declare const EMPTY_COMMERCE_CART_STATE: CommerceCartState;
export declare function productItemKey(productId: string, variantId?: string | null): string;
export declare function passItemKey(passId: string): string;
export declare function parseStoredCommerceCartState(raw: string | null): CommerceCartState;
export declare function buildProductCartItem(input: Readonly<{
    product: PublicProduct;
    variantId?: string | null;
    quantity?: number;
}>): Extract<CommerceCartItem, {
    kind: 'product';
}>;
export declare function buildPassCartItem(input: Readonly<{
    passId: string;
    title: string;
    unitPriceCents: number;
    currency: string;
}>): Extract<CommerceCartItem, {
    kind: 'pass';
}>;
export declare function reduceCommerceCart(state: CommerceCartState, action: CommerceCartAction): CommerceCartState;
export declare function deriveCommerceCheckoutState(state: CommerceCartState): CommerceCheckoutState;
export declare function resolveSelectedProduct(products: readonly PublicProduct[], contentEntry: {
    id?: string | null;
    slug?: string | null;
} | null | undefined, productSlug: string | null | undefined): PublicProduct | null;
