@myparcel-dev/pdk-common 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,42 @@
1
+ import {type PackageTypeName} from '@myparcel-dev/constants';
2
+ import {type TriState} from '../data';
3
+
4
+ export type LabelFormat = 'a4' | 'a6';
5
+
6
+ export type LabelOutput = 'open' | 'download';
7
+
8
+ type LabelPositionNumber = 1 | 2 | 3 | 4;
9
+
10
+ export type LabelPosition = LabelPositionNumber | `${LabelPositionNumber}`;
11
+
12
+ /**
13
+ * @see 'allowedShippingMethodsKeys' in pdk config
14
+ */
15
+ export type ShippingMethodType =
16
+ | TriState.Off
17
+ | TriState.Inherit
18
+ | PackageTypeName.Package
19
+ | PackageTypeName.PackageSmall
20
+ | PackageTypeName.Mailbox
21
+ | PackageTypeName.DigitalStamp
22
+ | PackageTypeName.Letter;
23
+
24
+ export type ShippingMethodId = string;
25
+
26
+ /**
27
+ * Shipping method types as keys and an array of shipping method IDs as values. Each shipping method ID can only be in one array.
28
+ *
29
+ * Example:
30
+ * ```json
31
+ * {
32
+ * "off": [ "method_5" ],
33
+ * "inherit": [ "method_1", "method_2" ],
34
+ * "package": [ "method_3" ],
35
+ * "package_small": [],
36
+ * "mailbox": [ "method_4" ],
37
+ * "digital_stamp": [],
38
+ * "letter": []
39
+ * }
40
+ * ```
41
+ */
42
+ export type ShippingMethodTypeMap = Record<ShippingMethodType, ShippingMethodId[]>;