import { gql as storefrontGql } from '@apollo/client'; import { useBackgroundQuery as useStorefrontBackgroundQuery, useQuery as useStorefrontQuery } from '@apollo/client/react'; import { Action, Color, IconIdentifier } from '@evlop/commons'; import { FlexboxProps, TextProps } from '@evlop/web-components'; import React$1 from 'react'; import { Animated } from 'react-native'; export interface MoneyV2 { amount: string; currencyCode: string; } export interface MetafieldIdentifier { namespace: string; key: string; } /** * Metafield values grouped by namespace, e.g. `metafields.custom.subtitle`. * `$types` mirrors the same shape and holds the Shopify metafield type of each value. */ export interface ShopifyMetafields { $types?: Record>; [namespace: string]: Record | undefined; } export interface MenuItem { id: string; icon: string; label: string; badge?: string | number; action?: { navigate?: [ string, Record? ] | string; push?: [ string, Record? ] | string; } | (() => void); } export type PriceDisplayProps = { price: MoneyV2; amount?: never; currencyCode?: never; formattedStringOnly?: boolean; } | { price?: never; amount: string; currencyCode: string; formattedStringOnly?: boolean; }; type CombinedMoneyProps = PriceDisplayProps & TextProps; export declare const PriceDisplay: React$1.FC; export interface ShopifyImage extends String { gid?: string; id?: string; url?: string; src?: string; small?: string; medium?: string; large?: string; height?: number; width?: number; aspectRatio: number; } interface VariantSelectedOption { name: string; value: string; } interface VariantActions { addToCart: Action; addToWishlist: Action; openDetailsPage: Action | null; } export interface ShopifyProductVariant { id?: string; gid?: string; title?: string; price?: MoneyV2; compareAtPrice?: MoneyV2; comparePriceDifference?: MoneyV2; selectedOptions?: VariantSelectedOption[]; availableForSale?: boolean; requiresShipping?: boolean; sku?: string; weight?: number; weightUnit?: string; image?: ShopifyImage | null; discountPrice?: MoneyV2; discountPercentage?: number; product?: any; metafields?: ShopifyMetafields; actions?: VariantActions; } interface ProductVariantPricePropsBase { variant: ShopifyProductVariant; showCompareAtPrice?: boolean; } export interface ProductVariantPriceProps extends FlexboxProps, ProductVariantPricePropsBase { priceProps?: TextProps; compareAtPriceProps?: TextProps; } export declare const ProductVariantPrice: React$1.FC; interface ProductOption { id: string; name: string; values: string[]; } interface ProductPriceRange { minVariantPrice: MoneyV2; maxVariantPrice: MoneyV2; } interface ProductActions { addToCart: Action; addToWishlist: Action; openDetailsPage: Action; } export interface ShopifyProduct { id?: string; gid?: string; title?: string; handle?: string; description?: string; descriptionHtml?: string; tags?: string[]; options?: ProductOption[]; priceRange?: ProductPriceRange; availableForSale?: boolean; requiresSellingPlan?: boolean; totalInventory?: number; productType?: string; vendor?: string; onlineStoreUrl?: string; variants?: ShopifyProductVariant[] & Record; sellingPlanGroups?: any[]; images?: ShopifyImage[]; media?: any[]; collections?: string[]; collectionIds?: string[]; collectionHandles?: string[]; thumbnail?: ShopifyImage | null; /** @deprecated use metafields instead */ metadata?: ShopifyMetafields; metafields?: ShopifyMetafields; actions?: ProductActions; } export interface ProductRatingsProps { product: ShopifyProduct; align?: "flex-start" | "flex-end" | "center" | "space-between" | "space-around" | "space-evenly"; iconSize?: number; } export declare const ProductRatings: React$1.FC; interface CombinedUnitDisplayProps extends TextProps { unit: string; value: number; hideValueIfOne?: boolean; formattedStringOnly?: boolean; } export declare const UnitDisplay: React$1.FC; export type UnitPriceDisplayProps = { price: MoneyV2; measurementReferenceValue: number; measurementReferenceUnit: string; showQuantity?: boolean; measurementQuantityValue?: number; measurementQuantityUnit?: string; formattedStringOnly?: boolean; } & TextProps; export declare const UnitPriceDisplay: React$1.FC; interface CollectionSeo { title?: string; description?: string; } interface CollectionActions { openDetailsPage: Action; } export interface ShopifyCollection { id?: string; gid?: string; title?: string; handle?: string; description?: string; descriptionHtml?: string; updatedAt?: string; image?: ShopifyImage | null; seo?: CollectionSeo; metadata?: Record; actions?: CollectionActions; } /** * Component and prop types for each custom block type - mirrors the block types declared in * web/frontend/formSchemaDefination/features/customBlocks/formSchema.js (shopify-app-builder-new). * `CustomBlock.` types the component itself (its default export); `CustomBlock.Props` * types just its props, for when the props are needed on their own (e.g. destructuring helpers). */ export declare namespace CustomBlock { interface ProductListItemProps { data: { product: ShopifyProduct; }; } type ProductListItem = React$1.ComponentType; interface CollectionListItemProps { data: { collection: ShopifyCollection; }; } type CollectionListItem = React$1.ComponentType; interface ProductStickerProps { data: { product: ShopifyProduct; variant: ShopifyProductVariant; }; } type ProductSticker = React$1.ComponentType; interface ProductInformationProps { product: ShopifyProduct; variant: ShopifyProductVariant; data: Record; } type ProductInformation = React$1.ComponentType; interface HeaderProps { data: { menuItems?: MenuItem[]; }; } type Header = React$1.ComponentType; interface FooterProps { data: { menuItems?: MenuItem[]; }; } type Footer = React$1.ComponentType; interface DrawerMenuProps { data: { menuItems?: MenuItem[]; }; } type DrawerMenu = React$1.ComponentType; interface SectionProps { data: Record; } type Section = React$1.ComponentType; interface PageProps { data: Record; } type Page = React$1.ComponentType; } interface CartAttribute { key: string; value: string; } interface LineItemVariant { id: string; gid: string; [key: string]: any; } interface LineItemProduct { id: string; gid: string; [key: string]: any; } interface DiscountAllocation { discountedAmount: MoneyV2; title?: string; description?: string; type?: string; key?: string; id?: string; value?: any; createdAt?: string; valueType?: string; allocationMethod?: string; targetSelection?: string; targetType?: string; } interface SellingPlanAllocation { priceAdjustments: any[]; price: MoneyV2; compareAtPrice?: MoneyV2; perDeliveryPrice?: MoneyV2; sellingPlan: any; } interface LineItemMerchandise { requiresShipping?: boolean; } interface ReduxActionDescriptor { reduxAction: any; } interface CartLineItemActions { setQuantity: (quantity: number) => ReduxActionDescriptor; increaseQuantityByOne: ReduxActionDescriptor; decreaseQuantityByOne: ReduxActionDescriptor; remove: ReduxActionDescriptor; } interface LineItem { id: string; gid: string; quantity: number; attributes?: CartAttribute[]; customAttributes?: CartAttribute[]; customAttributesMap?: Record; originalPosition: number; groupId?: string; parentGroupId?: string; isChildItem: boolean; isParentItem: boolean; childItemIds?: string[]; title?: string; sku?: string; variant: LineItemVariant; product: LineItemProduct; totalPrice: MoneyV2; subtotalPrice: MoneyV2; unitPrice: MoneyV2; totalInventory?: number; discountAllocations?: DiscountAllocation[]; sellingPlanAllocation?: SellingPlanAllocation; merchandise?: LineItemMerchandise; actions?: CartLineItemActions; } interface DiscountApplication { id?: string; title?: string; description?: string; type?: string; code?: string; value?: MoneyV2 & { percentage?: number; amount?: number; }; createdAt?: string; valueType?: string; allocationMethod?: string; targetSelection?: string; targetType?: string; key?: string; } export interface ShopifyCart { id?: string; gid?: string; lines?: LineItem[]; lineItems?: LineItem[]; customAttributes?: CartAttribute[]; discountApplications?: DiscountApplication[]; subtotalPrice?: MoneyV2; totalTax?: MoneyV2; totalDuty?: MoneyV2; totalPrice?: MoneyV2; lineItemsSubtotalPrice?: MoneyV2; attributes?: CartAttribute[]; updatedAt?: string; createdAt?: string; note?: string; } interface CustomerMetafield { key: string; value: string; namespace: string; id: string; type: string; } interface CustomerAddress { address1?: string; address2?: string; city?: string; company?: string; country?: string; firstName?: string; id: string; lastName?: string; phone?: string; province?: string; zip?: string; } export interface ShopifyCustomer { id: string; gid: string; email?: string; firstName?: string; lastName?: string; displayName?: string; phone?: string; acceptsMarketing?: boolean; tags?: string[]; numberOfOrders?: number; createdAt?: string; defaultAddress?: CustomerAddress | null; addresses?: CustomerAddress[]; metadata?: Record; metafields?: CustomerMetafield[]; } interface ShopifyLocationAddress { address1?: string; address2?: string; city?: string; company?: string; country?: string; countryCodeV2?: string; firstName?: string; formatted?: string[]; formattedArea?: string; lastName?: string; latitude?: number; longitude?: number; phone?: string; province?: string; provinceCode?: string; zip?: string; } interface ShopifyLocationMetafield { namespace: string; key: string; value: string; type: string; } export interface ShopifyLocation { id?: string; gid?: string; name?: string; address?: ShopifyLocationAddress; metafields?: ShopifyLocationMetafield[]; } interface WishlistItemActions { remove: Action; } interface WishlistItem { /** Loaded product instance (undefined until the products finish loading). */ product?: ShopifyProduct; /** Loaded variant instance (undefined until the products finish loading). */ variant?: ShopifyProductVariant; actions: WishlistItemActions; } export interface Wishlist { /** Wishlist entries, each carrying its loaded product/variant and a remove action. */ items: WishlistItem[]; /** The exact products data returned by the `shopify-products` data source. */ products: ShopifyProduct[]; /** Whether the given product id is in the wishlist. */ has(productId: string): boolean; } type ProductStickerDisplayContext = "pdp" | "listing"; type ProductStickerPosition = "leftTop" | "rightTop" | "leftBottom" | "rightBottom" | "aboveTitle" | "belowTitle" | "abovePrice"; interface ProductStickerBase { id: string; position?: ProductStickerPosition; schedule?: any; displayCondition?: any; } interface DefaultProductSticker extends ProductStickerBase { stickerText: string; icon?: IconIdentifier; backgroundColor?: string; textColor?: Color; } interface CustomProductSticker extends ProductStickerBase { customBlockId: string; } type ProductSticker = DefaultProductSticker | CustomProductSticker; interface UseProductStickersParams { variant?: ShopifyProductVariant; product?: ShopifyProduct; /** @default "listing" */ displayContext?: ProductStickerDisplayContext; position?: ProductStickerPosition | ProductStickerPosition[]; } export declare const useProductStickers: ({ product, variant, displayContext, position }: UseProductStickersParams) => Array; interface ProductStickersInlineProps extends UseProductStickersParams { textPaddingHorizontal?: number; textPaddingVertical?: number; fontScale?: number; align?: "left" | "right" | "center"; } interface ProductStickersProps extends UseProductStickersParams { fontScale?: number; textPadding?: number; } export declare const ProductStickers: { Inline: ({ product, variant, displayContext, position, textPaddingHorizontal, textPaddingVertical, fontScale, align }: ProductStickersInlineProps) => import("react").React$1.JSX.Element; Absolute: ({ product, variant, displayContext, position, fontScale, textPadding }: ProductStickersProps) => import("react").React$1.JSX.Element; }; /** * Returns the cart instance from the 'cart' scope (provided by the app's cart * provider, which converts the raw cart response into a ShopifyCart instance). */ export function useCart(): ShopifyCart; /** * Provides optimistic quantity and removal actions for a single cart line item. * * The line item carries its own redux action descriptors (see * `ShopifyCartLineItem.buildActions`), so this hook only orchestrates the * optimistic state and dispatches those actions. */ export function useCartLineItemActions(cartLineItem: LineItem): { quantity: number; increaseQuantityByOne: () => void; decreaseQuantityByOne: () => void; setQuantity: (targetQuantity: number) => void; remove: () => Promise; isRemoving: boolean; isUpdating: boolean; }; /** * Returns the wishlist instance from the 'wishlist' scope (provided by the app's * WishlistProvider, which converts the persisted wishlist state into a Wishlist instance). */ export function useWishlist(): Wishlist; export function useCustomer(): any; type CollectionDatasourceOptions = { collectionId: string; } | { collectionHandle: string; }; export declare function useCollection(options: CollectionDatasourceOptions): ShopifyCollection; type CollectionsDatasourceOptions = { collectionIds: string[]; }; export declare function useCollections(options?: CollectionsDatasourceOptions): ShopifyCollection[]; export type CurrencyFormatterFunction = (money: MoneyV2) => string; export declare const CurrencyFormatterContext: import("react").Context; export function useCurrencyFormatter(): CurrencyFormatterFunction; export function useForex(): (price: MoneyV2 | null | undefined) => MoneyV2 | null | undefined; export declare function useLocations(): import("@evlop/commons").Collection; interface UseMenuItemsForFooterTabsOptions { isGlobal?: boolean; } interface UseMenuItemsForFooterTabsReturn { menuItemsWithActionsUpdated: MenuItem[]; activeIndexAnimated: Animated.Value | null; } type UseMenuItemsForFooterTabsHook = (menuItems: MenuItem[], options?: UseMenuItemsForFooterTabsOptions) => UseMenuItemsForFooterTabsReturn; export declare const useMenuItemsForFooterTabs: UseMenuItemsForFooterTabsHook; type MetafieldResourceType = "product" | "collection" | "customer"; type MetafieldIdentifier$1 = { key: string; namespace: string; }; type MetafieldsDatasourceOptions = { resourceType: MetafieldResourceType; metafieldIdentifiers: MetafieldIdentifier$1[]; } & ({ resourceId: string; } | { resourceHandle: string; }); export declare function useMetafields(options: MetafieldsDatasourceOptions): any; type MetaobjectDatasourceOptions = { metaobjectId: string; } | { metaobjectHandle: string; metaobjectType: string; }; export declare function useMetaobject(options: MetaobjectDatasourceOptions): any; type MetaobjectsDatasourceOptions = { metaobjectType: string; }; export declare function useMetaobjects(options: MetaobjectsDatasourceOptions): any; type ProductDatasourceOptions = { productId: string; } | { productHandle: string; }; export declare function useProduct(options: ProductDatasourceOptions): ShopifyProduct; interface ProductRatingReturn { ratingDetails: number[]; averageRating: number; reviewsCount: number; isLoading: boolean; isEnabled: boolean; } export function useProductRating(product: ShopifyProduct | null | undefined): ProductRatingReturn; export interface ProductReview { id: string; rating: number; title?: string; body?: string; author?: string; createdAt?: string; updatedAt?: string; verified?: boolean; } export interface ProductRating { averageRating: number; reviewsCount: number; ratingDetails?: number[]; } export interface ProductReviewConfiguration { ratingsSource?: "api" | "metadata"; averageRatingMetadataPath?: string; reviewsCountMetadataPath?: string; apiEndpoint?: string; provider?: "yotpo" | "judgeme" | "ali" | "custom"; } export interface ProductReviewsContextType { isEnabled: boolean; activeProductId: string | null; setActiveProductId: (id: string | null) => void; reviews: Record; setReviews: (reviews: Record) => void; loadProductRating: (productId: string) => void; activeProductIdsForRating: string[]; setActiveProductIdsForRating: (ids: string[]) => void; setActiveProductIds: (ids: string[]) => void; ratings: Record; setRatings: (ratings: Record) => void; isReviewLoading: boolean; setIsReviewLoading: (loading: boolean) => void; activeProductIds: string[]; hasMoreReviews: boolean; setHasMoreReviews: (hasMore: boolean) => void; ViewReviewsModalComponent: React$1.ComponentType; configuration: ProductReviewConfiguration; setConfiguration: (config: ProductReviewConfiguration) => void; apiRef: Record; getApi: () => any; } export declare const ProductReviewsContext: React$1.Context; interface ProductReviewReturn { isEnabled: boolean; averageRating: string; ratingDetails: number[]; reviewsCount: number; reviews: ProductReview[]; } export function useProductReview(product: ShopifyProduct | null | undefined): ProductReviewReturn; export function useProductReviewsContext(): ProductReviewsContextType; type ProductsDatasourceOptions = { productIds: string[]; } | { collectionId: string; } | { search: string; } | { sortBy?: "best-selling" | "created-descending" | "created-ascending" | "relevence" | "price-ascending" | "price-descending" | "title-ascending" | "title-descending" | "updated-descending" | "updated-ascending"; query?: string; }; export declare function useProducts(options: ProductsDatasourceOptions): ShopifyProduct[]; interface UnitValue { value: number; unit: string; } interface UnitFormatterFunction { (unitValue: UnitValue): string; asParts: (unitValue: UnitValue) => Intl.NumberFormatPart[] | string; } export function useUnitFormatter(): UnitFormatterFunction; export declare const ProductStickersContext: React$1.Context; export declare function ProductStickersProvider({ children }: { children: any; }): React$1.JSX.Element; declare class LoadProductsManager { private metafields; private checksum; constructor(); addMetafieldIdentifiers(metafieldIdentifiers: MetafieldIdentifier[]): void; addMetafieldIdentifier(metafieldIdentifier: MetafieldIdentifier): void; removeMetafieldIdentifiers(metafieldIdentifiers: MetafieldIdentifier[]): void; removeMetafieldIdentifier(metafieldIdentifier: MetafieldIdentifier): void; getMetafieldIdentifiers(): MetafieldIdentifier[]; private calculateChecksum; getChecksum(): string; } export declare const loadProductsManager: LoadProductsManager; export { CombinedUnitDisplayProps as UnitDisplayProps, PriceDisplay as Money, PriceDisplayProps as MoneyProps, storefrontGql, useStorefrontBackgroundQuery, useStorefrontQuery, }; export {};