import { Signal } from "@preact/signals-core"; /** * Which collection of saved items a consumer is looking at. * * - `all`: every saved item, regardless of list (the built-in "Saves" grid). * - `user`: a list the customer created, identified by `listId`. * - `smart`: a server-computed feed ("recently-viewed" or "saved-from-cart"). * - `shared`: another customer's public list, identified by its public id. */ export type ListContextType = "all" | "user" | "smart" | "shared"; export interface ListContext { listId?: string; listType: ListContextType; } export type ListContextInput = Partial; export type ListContextSignal = Signal & { dispose: () => void; }; /** Reserved ids of the smart lists the storefront can read. */ export declare const SMART_LIST_IDS: readonly ["recently-viewed", "saved-from-cart"]; export type SmartListId = (typeof SMART_LIST_IDS)[number]; export declare const isSmartListId: (id: string) => id is SmartListId; /** * Normalises a partial context into a full one. A missing `listType` is * inferred from the id (reserved smart-list ids become `smart`, anything else * `user`). A non-`all` type without an id has nothing to fetch, so it * collapses to `all`. */ export declare const listContextFromInput: (input?: ListContextInput) => ListContext; /** * Reads the list a wishlist-page URL points at. Uses the same query params the * built-in page and `buildShareListUrl` use: `public-list-id` for a shared * list, `list-id` for the customer's own (user or smart) list. */ export declare const parseListLocation: (href: string) => ListContext; export declare const listContextSignal: () => (source: HTMLElement | Location) => ListContextSignal;