import { QueryObject } from 'ufo'; import { BusinessProfile, EventAvailability, EventProfile, ProductAvailability, QueryOptions, ServiceProfile, StoreProfile } from '../models'; export type Enumerable = T | T[]; export type ResourceId = string | number; type ListResultMeta = { count: number; total: number; offset: number; limit: number; page: number; pages: number; }; export interface Client { currency: string; user: string | undefined; get(path: Enumerable, options?: { data?: any; params?: QueryObject; }): Promise; post(path: Enumerable, options?: { data?: any; params?: QueryObject; }): Promise; put(path: Enumerable, options?: { data?: any; params?: QueryObject; }): Promise; delete(path: Enumerable): Promise; retrieve(path: Enumerable, fields?: Enumerable): Promise>; list(path: Enumerable, options?: QueryOptions): Promise>; profiles(type: "store" | "business" | "event" | "service", handle: string, options?: { fields?: Enumerable; params?: QueryObject; with?: Enumerable; }): Promise; availability(type: "products" | "events", id: ResourceId): Promise; updateClient(config: Partial): OrieConfig; urls: { carts(...urls: string[]): string; checkouts(...urls: string[]): string; }; } export type RetrieveResult = { data: T; }; export type ListResult = { data: T; } & ListResultMeta; export interface OrieConfig { publishableKey: string; baseUrl?: string; currency?: string; locale?: string; maxRetries?: number; user?: string; debug?: boolean; } export interface Logger { info: (message: string, ...params: any[]) => void; log: (message: string, ...params: any[]) => void; debug: (message: string, ...params: any[]) => void; error: (message: string, ...params: any[]) => void; } export type LazyStoreProfileField = keyof Pick; export type LazyBusinessProfileField = keyof Pick; export type LazyEventProfileField = keyof Pick; export type LazyServiceProfileField = keyof Pick; export {};