Skip to content

Commit

Permalink
- Update TypeScript types for new functions and class
Browse files Browse the repository at this point in the history
  • Loading branch information
nwithan8 committed Jul 11, 2024
1 parent 551c1bf commit d175ab8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
10 changes: 9 additions & 1 deletion types/Shipment/Shipment.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,14 +320,22 @@ export declare class Shipment implements IShipment {
static generateForm(id: string, formType: string, formOptions?: object): Promise<Shipment>;

/**
* Retrieves the estimated delivery date of each Rate via SmartRate.
* Retrieve the estimated delivery date of each Rate via SmartRate.
*
* @param id shipment id (begins with "shp_").
* @param plannedShipDate The planned ship date in format YYYY-MM-DD
* @returns {Promise<Array<Object>>} The array of estimated delivery dates and rates.
*/
static retrieveEstimatedDeliveryDate(id: string, plannedShipDate: string): Promise<Array<Object>>;

/**
* Retrieve a recommended ship date for a {@link Shipment shipment} via the Precision Shipping API, based on a specific desired delivery date.
* @param id - The ID of the shipment to retrieve the recommended ship date for.
* @param desiredDeliveryDate - The desired delivery date for the shipment.
* @returns {Array} - An array of the recommended ship date and rates.
*/
static recommendShipDate(id: string, desiredDeliveryDate: string): Promise<Array<Object>>;

/**
* Retrieve the next page of {@link Shipment shipments}.
*
Expand Down
20 changes: 20 additions & 0 deletions types/SmartRate/SmartRate.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/**
* The SmartRate class interacts with the SmartRate API to provide optimized shipping rates and estimates.
*
* @see https://www.easypost.com/smartrate
*/
export declare class SmartRate {
/**
* Retrieve the estimated delivery date of each carrier-service level combination via the Smart Deliver By API, based on a specific ship date and origin-destination postal code pair.
* @param params - The parameters to estimate the delivery date with.
* @returns {Object} - Estimates and related metadata.
*/
static estimateDeliveryDate(params: object): object;

/**
* Retrieve a recommended ship date for each carrier-service level combination via the Smart Deliver On API, based on a specific delivery date and origin-destination postal code pair.
* @param params - The parameters to recommend the ship date with.
* @returns {Object} - Recommendation and related metadata.
*/
static recommendShipDate(params: object): object;
}

0 comments on commit d175ab8

Please sign in to comment.