From d9fdb6d4c81b61c8f4e368f5a2c9b192e3c95cec Mon Sep 17 00:00:00 2001 From: lifansheng Date: Wed, 1 Dec 2021 19:40:07 +0800 Subject: [PATCH 1/3] Signed-off-by: lifansheng On branch master Your branch is up to date with 'origin/master'. --- LICENSE | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 3 ++ README_zh.md | 3 ++ 3 files changed, 94 insertions(+) diff --git a/LICENSE b/LICENSE index f433b1a..c5c2cbf 100755 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,91 @@ +In the jsapi / workers directory, the definitions of some interfaces refer to their definitions in the webapi. +The following is a reference to the defined interface: + +declare namespace util { + + class TextDecoder { + /** + * the source encoding's name, lowercased. + * @since 7 + * @sysCap SystemCapability.CCRuntime + */ + readonly encoding: string; + + /** + * Returns `true` if error mode is "fatal", and `false` otherwise. + * @since 7 + * @sysCap SystemCapability.CCRuntime + */ + readonly fatal: boolean; + + /** + * Returns `true` if ignore BOM flag is set, and `false` otherwise. + * @since 7 + * @sysCap SystemCapability.CCRuntime + */ + readonly ignoreBOM = false; + + /** + * the textEncoder constructor. + * @param 7 + * @sysCap SystemCapability.CCRuntime + * @param encoding decoding format + */ + constructor( + encoding?: string, + options?: { fatal?: boolean; ignoreBOM?: boolean }, + ); + + /** + * Returns the result of running encoding's decoder. + * @since 7 + * @sysCap SystemCapability.CCRuntime + * @param input decoded numbers in accordance with the format + * @return return decoded text + */ + decode(input: Uint8Array, options?: { stream?: false }): string; + } + + class TextEncoder { + /** + * Encoding format. + * @since 7 + * @sysCap SystemCapability.CCRuntime + */ + readonly encoding = "utf-8"; + + /** + * the textEncoder constructor. + * @since 7 + * @sysCap SystemCapability.CCRuntime + */ + constructor(); + + /** + * Returns the result of encoder. + * @since 7 + * @sysCap SystemCapability.CCRuntime + * @param The string to be encoded. + * @return returns the encoded text. + */ + encode(input?: string): Uint8Array; + + /** + * encode string, write the result to dest array. + * @since 7 + * @sysCap SystemCapability.CCRuntime + * @param input The string to be encoded. + * @param dest decoded numbers in accordance with the format + * @return returns Returns the object, where read represents + * the number of characters that have been encoded, and written + * represents the number of bytes occupied by the encoded characters. + */ + encodeInto( + input: string, + dest: Uint8Array, + ): { read: number; written: number }; + } +} Apache License Version 2.0, January 2004 diff --git a/README.md b/README.md index 2c766ff..63d53a8 100755 --- a/README.md +++ b/README.md @@ -1019,3 +1019,6 @@ var result = proc.isWeakSet(new WeakSet()); [base/compileruntime/js_util_module/](base/compileruntime/js_util_module-readme.md) +### License + +Util is available under [Mozilla license](https://www.mozilla.org/en-US/MPL/), and the documentation is detailed in [documentation](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE_docs). See [LICENSE](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE) for the full license text. \ No newline at end of file diff --git a/README_zh.md b/README_zh.md index d010d05..8c38fbe 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1020,3 +1020,6 @@ var result = proc.isWeakSet(new WeakSet()); [base/compileruntime/js_util_module/](base/compileruntime/js_util_module-readme.md) +## 许可证 + +Util在[Mozilla许可证](https://www.mozilla.org/en-US/MPL/)下可用,说明文档详见[说明文档](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE_docs)。有关完整的许可证文本,有关完整的许可证文本,请参见[许可证](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE) \ No newline at end of file -- Gitee From 1b7a06d99b4045cde1d0b33f0f22a5070e0ea912 Mon Sep 17 00:00:00 2001 From: lifansheng Date: Wed, 1 Dec 2021 19:42:53 +0800 Subject: [PATCH 2/3] Signed-off-by: lifansheng On branch master Your branch is up to date with 'origin/master'. --- README_zh.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_zh.md b/README_zh.md index 8c38fbe..c659e13 100644 --- a/README_zh.md +++ b/README_zh.md @@ -1022,4 +1022,4 @@ var result = proc.isWeakSet(new WeakSet()); ## 许可证 -Util在[Mozilla许可证](https://www.mozilla.org/en-US/MPL/)下可用,说明文档详见[说明文档](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE_docs)。有关完整的许可证文本,有关完整的许可证文本,请参见[许可证](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE) \ No newline at end of file +Util在[Mozilla许可证](https://www.mozilla.org/en-US/MPL/)下可用,说明文档详见[说明文档](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE_docs)。有关完整的许可证文本,请参见[许可证](https://gitee.com/openharmony/js_util_module/blob/master/LICENSE) \ No newline at end of file -- Gitee From c24ac27ddbd51dc2c8130b9f8b7061e3c6720a42 Mon Sep 17 00:00:00 2001 From: lifansheng Date: Wed, 1 Dec 2021 20:03:18 +0800 Subject: [PATCH 3/3] Signed-off-by: lifansheng On branch master Your branch is up to date with 'origin/master'. --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index c5c2cbf..4a2cb1b 100755 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -In the jsapi / workers directory, the definitions of some interfaces refer to their definitions in the webapi. +In the jsapi / util directory, the definitions of some interfaces refer to their definitions in the webapi. The following is a reference to the defined interface: declare namespace util { -- Gitee