@tailor-platform/function-types 0.3.0 → 0.4.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/tailor.d.ts +50 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/function-types",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "TypeScript types for Tailor Platform Function service",
5
5
  "repository": {
6
6
  "type": "git",
package/tailor.d.ts CHANGED
@@ -51,4 +51,53 @@ declare namespace tailor.secretmanager {
51
51
  vault: string,
52
52
  name: string
53
53
  ): Promise<string | undefined>;
54
- }
54
+ }
55
+
56
+ declare namespace tailor.iconv {
57
+ /**
58
+ * Convert string from one encoding to another
59
+ */
60
+ function convert<T extends string>(
61
+ str: string | Uint8Array | ArrayBuffer,
62
+ fromEncoding: string,
63
+ toEncoding: T
64
+ ): T extends 'UTF8' | 'UTF-8' ? string : Uint8Array;
65
+
66
+ /**
67
+ * Convert buffer from one encoding to another
68
+ */
69
+ function convertBuffer<T extends string>(
70
+ buffer: Uint8Array | ArrayBuffer,
71
+ fromEncoding: string,
72
+ toEncoding: T
73
+ ): T extends 'UTF8' | 'UTF-8' ? string : Uint8Array;
74
+
75
+ /**
76
+ * Decode buffer to string
77
+ */
78
+ function decode<T extends string>(
79
+ buffer: Uint8Array | ArrayBuffer,
80
+ encoding: T
81
+ ): T extends 'UTF8' | 'UTF-8' ? string : Uint8Array;
82
+
83
+ /**
84
+ * Encode string to buffer
85
+ */
86
+ function encode<T extends string>(
87
+ str: string,
88
+ encoding: T
89
+ ): T extends 'UTF8' | 'UTF-8' ? string : Uint8Array;
90
+
91
+ /**
92
+ * Get list of supported encodings
93
+ */
94
+ function encodings(): string[];
95
+
96
+ /**
97
+ * Iconv class for compatibility with node-iconv
98
+ */
99
+ class Iconv {
100
+ constructor(fromEncoding: string, toEncoding: string);
101
+ convert(input: string | Uint8Array | ArrayBuffer): string | Uint8Array;
102
+ }
103
+ }