import { Parcel, Shipment } from '@commercelayer/sdk'; import { SetNonNullable } from 'type-fest'; import { z } from 'zod'; import { AvatarProps } from '../ui/atoms/Avatar'; export declare function getAvatarSrcFromRate(rate: Rate): AvatarProps["src"]; /** * Get tracking details descending sorted from a parcel. */ export declare function getParcelTrackingDetails(parcel?: Parcel): TrackingDetail[]; /** * Get latest tracking details from a parcel. */ export declare function getParcelTrackingDetail(parcel?: Parcel): TrackingDetail | undefined; /** * Get all available rates. */ export declare function getShipmentRates(shipment: Shipment): Rate[]; /** * Get selected shipment rate if any. */ export declare function getShipmentRate(shipment: Shipment): Rate | undefined; /** * Check whether the `shipment` has just one tracking number. * @param shipment Shipment */ export declare function hasSingleTracking(shipment: Shipment): boolean; /** * Check whether the `shipment` has been purchased. * @param shipment Shipment */ export declare function hasBeenPurchased(shipment: Shipment): boolean; /** * @docs https://www.easypost.com/docs/api#tracking-detail-object */ declare const trackingDetailSchema: z.ZodObject<{ /** "TrackingDetail" */ object: z.ZodLiteral<"TrackingDetail">; /** Description of the scan event */ message: z.ZodNullable; /** Status of the package at the time of the scan event, possible values are "unknown", "pre_transit", "in_transit", "out_for_delivery", "delivered", "available_for_pickup", "return_to_sender", "failure", "cancelled" or "error" */ status: z.ZodNullable; /** Additional details about the current status, possible values are "unknown", "status_update", "departed_facility", "arrived_at_facility", "out_for_delivery", "arrived_at_destination" */ status_detail: z.ZodNullable; /** The timestamp when the tracking scan occurred */ datetime: z.ZodNullable; /** The original source of the information for this scan event, usually the carrier */ source: z.ZodNullable; /** The location associated with the scan event */ tracking_location: z.ZodEffects; /** The city where the scan event occurred (if available) */ city: z.ZodNullable; /** The state where the scan event occurred (if available) */ state: z.ZodNullable; /** The country where the scan event occurred (if available) */ country: z.ZodNullable; /** The postal code where the scan event occurred (if available) */ zip: z.ZodNullable; }, "strip", z.ZodTypeAny, { object: "TrackingLocation"; city: string | null; country: string | null; state: string | null; zip: string | null; }, { object: "TrackingLocation"; city: string | null; country: string | null; state: string | null; zip: string | null; }>, SetNonNullable<{ object: "TrackingLocation"; city: string | null; country: string | null; state: string | null; zip: string | null; }, "city"> | null, { object: "TrackingLocation"; city: string | null; country: string | null; state: string | null; zip: string | null; }>; description: z.ZodNullable; carrier_code: z.ZodNullable; }, "strip", z.ZodTypeAny, { object: "TrackingDetail"; source: string | null; status: string | null; description: string | null; message: string | null; status_detail: string | null; datetime: string | null; tracking_location: SetNonNullable<{ object: "TrackingLocation"; city: string | null; country: string | null; state: string | null; zip: string | null; }, "city"> | null; carrier_code: string | null; }, { object: "TrackingDetail"; source: string | null; status: string | null; description: string | null; message: string | null; status_detail: string | null; datetime: string | null; tracking_location: { object: "TrackingLocation"; city: string | null; country: string | null; state: string | null; zip: string | null; }; carrier_code: string | null; }>; /** * @docs https://www.easypost.com/docs/api#rates */ declare const rateSchema: z.ZodObject<{ /** unique, begins with 'rate_' */ id: z.ZodString; /** "test" or "production" */ mode: z.ZodUnion<[z.ZodLiteral<"test">, z.ZodLiteral<"production">]>; /** service level/name @docs https://www.easypost.com/docs/api#service-levels */ service: z.ZodString; /** name of carrier */ carrier: z.ZodString; /** ID of the CarrierAccount record used to generate this rate */ carrier_account_id: z.ZodString; /** ID of the Shipment this rate belongs to */ shipment_id: z.ZodString; /** the actual rate quote for this service */ rate: z.ZodNumber; /** currency for the rate */ currency: z.ZodString; /** delivery days for this service */ delivery_days: z.ZodOptional; /** date for delivery */ delivery_date: z.ZodOptional; /** *This field is deprecated and should be ignored. @deprecated */ est_delivery_days: z.ZodOptional; /** formatted date for delivery */ formatted_delivery_date: z.ZodOptional; /** the actual formatted rate quote for this service */ formatted_rate: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; mode: "test" | "production"; currency: string; rate: number; service: string; carrier: string; carrier_account_id: string; shipment_id: string; formatted_rate: string; delivery_days?: number | undefined; delivery_date?: string | undefined; est_delivery_days?: number | undefined; formatted_delivery_date?: string | undefined; }, { id: string; mode: "test" | "production"; currency: string; rate: number; service: string; carrier: string; carrier_account_id: string; shipment_id: string; formatted_rate: string; delivery_days?: number | undefined; delivery_date?: string | undefined; est_delivery_days?: number | undefined; formatted_delivery_date?: string | undefined; }>; export type TrackingDetail = z.infer; export type Rate = z.infer; export {};