Skip to content

Commit

Permalink
chore(wanb): 类型调整到 namespace 里头
Browse files Browse the repository at this point in the history
  • Loading branch information
wangjue666 committed Dec 9, 2023
1 parent 3813cfb commit 01f60eb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 32 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-teachers-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@cn-international-express-sdk/wanb': major
---

chore: 类型调整到 namespace 里头
2 changes: 1 addition & 1 deletion packages/wanb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cn-international-express-sdk/wanb",
"version": "1.0.1",
"version": "1.0.2",
"types": "./dist/types/index.d.ts",
"main": "./dist/lib/index.js",
"module": "./dist/es/index.js",
Expand Down
65 changes: 34 additions & 31 deletions packages/wanb/src/state.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
/* eslint-disable @typescript-eslint/no-namespace */
export interface WanbConfig {
app_token: string;
user_id: string;
base_url?: string;
}

export interface WanbGetShippingMethodsRes {
Data: {
ShippingMethods: {
Code: string;
Name: string;
IsTracking: boolean;
IsVolumeWeight: boolean;
MaxVolumeWeightInCm: number;
Region: string;
}[];
};
}
export namespace WanbTypes {
export interface GetShippingMethodsRes {
Data: {
ShippingMethods: {
Code: string;
Name: string;
IsTracking: boolean;
IsVolumeWeight: boolean;
MaxVolumeWeightInCm: number;
Region: string;
}[];
};
}

export type WanbAddOrderRes =
| {
Succeeded: false;
Error: {
Message: string;
};
}
| {
Succeeded: true;
Data: {
ProcessCode: string;
IndexNumber: string;
ReferenceId: string;
TrackingNumber: string;
IsVirtualTrackingNumber: boolean;
SortCode: string;
IsRemoteArea: boolean;
Status: string;
export type AddOrderRes =
| {
Succeeded: false;
Error: {
Message: string;
};
}
| {
Succeeded: true;
Data: {
ProcessCode: string;
IndexNumber: string;
ReferenceId: string;
TrackingNumber: string;
IsVirtualTrackingNumber: boolean;
SortCode: string;
IsRemoteArea: boolean;
Status: string;
};
};
};
}

0 comments on commit 01f60eb

Please sign in to comment.