@ohos-ports/vscode-iconv-lite-umd 0.7.1-beta.1

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+
2
+ # Contributing
3
+
4
+ This project welcomes contributions and suggestions. Most contributions require you to agree to a
5
+ Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
6
+ the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
7
+
8
+ When you submit a pull request, a CLA bot will automatically determine whether you need to provide
9
+ a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
10
+ provided by the bot. You will only need to do this once across all repos using our CLA.
11
+
12
+ This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
13
+ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
14
+ contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
@@ -0,0 +1,56 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ * REQUIREMENT: This definition is dependent on the @types/node definition.
5
+ * Install with `npm install @types/node --save-dev`
6
+ *--------------------------------------------------------------------------------------------*/
7
+
8
+ declare module "@vscode/iconv-lite-umd" {
9
+ // Basic API
10
+ export function decode(
11
+ buffer: Uint8Array,
12
+ encoding: string,
13
+ options?: Options
14
+ ): string;
15
+
16
+ export function encode(
17
+ content: string,
18
+ encoding: string,
19
+ options?: Options
20
+ ): Uint8Array;
21
+
22
+ export function encodingExists(encoding: string): boolean;
23
+
24
+ // Stream API
25
+ // WARNING: Excluded because it is specific to node.
26
+ // export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
27
+
28
+ // export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream;
29
+
30
+ // Low-level stream APIs
31
+ export function getEncoder(
32
+ encoding: string,
33
+ options?: Options
34
+ ): EncoderStream;
35
+
36
+ export function getDecoder(
37
+ encoding: string,
38
+ options?: Options
39
+ ): DecoderStream;
40
+ }
41
+
42
+ export interface Options {
43
+ stripBOM?: boolean;
44
+ addBOM?: boolean;
45
+ defaultEncoding?: string;
46
+ }
47
+
48
+ export interface EncoderStream {
49
+ write(str: string): Uint8Array;
50
+ end(): Uint8Array | undefined;
51
+ }
52
+
53
+ export interface DecoderStream {
54
+ write(buf: Uint8Array): string;
55
+ end(): string | undefined;
56
+ }