type AvailabilityRequest = J extends { variantId: string; } | { productHandle: string; } ? J : never; /** * Returns the availability of a product or variant. * * Use this when rendering buttons on PDPs etc to decide what the correct behavior is for an item. * * @param request The product or variant to check the availability of. * @param inStockCallback A callback to check if the product is in stock. * @returns The in stock/preorder/out of stock state of the product or variant. */ export declare function availability(request: AvailabilityRequest, inStockCallback?: (request: AvailabilityRequest, getPreorderState: () => Promise) => Promise): Promise>; interface PurpleDotWaitlist { id: string; selling_plan_id?: string; display_dispatch_date: string; units_left: number; compatible_checkouts: ("purple_dot" | "native")[]; } export interface PurpleDotOnPreorder { state: "ON_PREORDER"; waitlist: PurpleDotWaitlist; } export interface PurpleDotAvailableInStock { state: "AVAILABLE_IN_STOCK"; available?: I; waitlist?: PurpleDotWaitlist; } export interface PurpleDotSoldOut { state: "SOLD_OUT"; } export type PurpleDotAvailability = PurpleDotOnPreorder | PurpleDotAvailableInStock | PurpleDotSoldOut; export {};