export interface Address { id: string; mask: string; } export interface AddressFields { type: string; firstName: string; lastName: string; company: string; streetNumber: string; apartments: string; zipCode: string; city: string; country: string; } export type CustomerAddressTypes = { address?: Address; fields: AddressFields; }; export type GetAddressesHook = { data: T['address'][] | null; input: {}; fetcherInput: { cartId?: string; }; swrState: { isEmpty: boolean; }; }; export type AddItemHook = { data: T['address']; input?: T['fields']; fetcherInput: T['fields']; body: { item: T['fields']; }; actionInput: T['fields']; }; export type UpdateItemHook = { data: T['address'] | null; input: { item?: T['fields']; wait?: number; }; fetcherInput: { itemId: string; item: T['fields']; }; body: { itemId: string; item: T['fields']; }; actionInput: T['fields'] & { id: string; }; }; export type RemoveItemHook = { data: T['address'] | null; input: { item?: T['address']; }; fetcherInput: { itemId: string; }; body: { itemId: string; }; actionInput: { id: string; }; }; export type CustomerAddressHooks = { getAddresses: GetAddressesHook; addItem: AddItemHook; updateItem: UpdateItemHook; removeItem: RemoveItemHook; }; export type AddressHandler = GetAddressesHook & { body: { cartId?: string; }; }; export type AddItemHandler = AddItemHook & { body: { cartId: string; }; }; export type UpdateItemHandler = UpdateItemHook & { data: T['address']; body: { cartId: string; }; }; export type RemoveItemHandler = RemoveItemHook & { body: { cartId: string; }; }; export type CustomerAddressHandlers = { getAddresses: GetAddressesHook; addItem: AddItemHandler; updateItem: UpdateItemHandler; removeItem: RemoveItemHandler; }; export type CustomerAddressSchema = { endpoint: { options: {}; handlers: CustomerAddressHandlers; }; };