From 01f60eba857eb174a900a96a68cd0ae786775a1d Mon Sep 17 00:00:00 2001 From: invalid w Date: Sat, 9 Dec 2023 10:01:30 +0800 Subject: [PATCH] =?UTF-8?q?=20chore(wanb):=20=E7=B1=BB=E5=9E=8B=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E5=88=B0=20namespace=20=E9=87=8C=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/forty-teachers-cheat.md | 5 +++ packages/wanb/package.json | 2 +- packages/wanb/src/state.ts | 65 ++++++++++++++++-------------- 3 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 .changeset/forty-teachers-cheat.md diff --git a/.changeset/forty-teachers-cheat.md b/.changeset/forty-teachers-cheat.md new file mode 100644 index 0000000..3c225be --- /dev/null +++ b/.changeset/forty-teachers-cheat.md @@ -0,0 +1,5 @@ +--- +'@cn-international-express-sdk/wanb': major +--- + +chore: 类型调整到 namespace 里头 diff --git a/packages/wanb/package.json b/packages/wanb/package.json index f0f1c38..566e94c 100644 --- a/packages/wanb/package.json +++ b/packages/wanb/package.json @@ -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", diff --git a/packages/wanb/src/state.ts b/packages/wanb/src/state.ts index e233142..51ef798 100644 --- a/packages/wanb/src/state.ts +++ b/packages/wanb/src/state.ts @@ -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; + }; }; - }; +}