Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
8b0aeb89
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
8b0aeb89
编写于
9月 09, 2022
作者:
Z
zengyawen
提交者:
Gitee
9月 09, 2022
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update zh-cn/application-dev/reference/apis/js-apis-util.md.
Signed-off-by:
N
zengyawen
<
zengyawen1@huawei.com
>
上级
56421ac9
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
173 addition
and
1 deletion
+173
-1
zh-cn/application-dev/reference/apis/js-apis-util.md
zh-cn/application-dev/reference/apis/js-apis-util.md
+173
-1
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-util.md
浏览文件 @
8b0aeb89
...
...
@@ -23,12 +23,14 @@ printf(format: string, ...args: Object[]): string
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| format | string | 是 | 式样化字符串。 |
| ...args | Object[] | 否 | 待式样化数据。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 按特定格式式样化后的字符串。 |
...
...
@@ -49,11 +51,13 @@ getErrorString(errno: number): string
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| errno | number | 是 | 系统发生错误产生的错误码。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 错误码对应的详细信息。 |
...
...
@@ -81,6 +85,7 @@ callbackWrapper(original: Function): (err: Object, value: Object )=>void
| original | Function | 是 | 异步函数。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Function | 返回一个第一个参数是拒绝原因(如果
Promise
已解决,则为
null),第二个参数是已解决的回调函数。 |
...
...
@@ -111,11 +116,13 @@ promiseWrapper(original: (err: Object, value: Object) => void): Object
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| original | Function | 是 | 异步函数。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Function | 采用遵循常见的错误优先的回调风格的函数(也就是将
(err,
value)
=
>
...
回调作为最后一个参数),并返回一个返回
promise
的版本。 |
...
...
@@ -140,11 +147,13 @@ promisify(original: (err: Object, value: Object) => void): Function
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| original | Function | 是 | 异步函数。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Function | 采用遵循常见的错误优先的回调风格的函数(也就是将
(err,
value)
=
>
...
回调作为最后一个参数),并返回一个返回
promise
的函数。 |
...
...
@@ -173,11 +182,13 @@ randomUUID(entropyCache?: boolean): string
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| entropyCache | boolean | 否 | 是否使用已缓存的UUID, 默认true。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 表示此UUID的字符串。 |
...
...
@@ -199,11 +210,13 @@ randomBinaryUUID(entropyCache?: boolean): Uint8Array
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| entropyCache | boolean | 否 | 是否使用已缓存的UUID, 默认true。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Uint8Array | 表示此UUID的Uint8Array值。 |
...
...
@@ -225,11 +238,13 @@ parseUUID(uuid: string): Uint8Array
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| uuid | string | 是 | UUID字符串。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Uint8Array | 返回表示此UUID的Uint8Array,如果解析失败,则抛出SyntaxError。 |
...
...
@@ -264,6 +279,7 @@ TextDecoder的构造函数。
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| encoding | string | 否 | 编码格式。 |
...
...
@@ -291,6 +307,7 @@ decode(input: Uint8Array, options?: { stream?: false }): string
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| input | Uint8Array | 是 | 符合格式需要解码的数组。 |
...
...
@@ -303,6 +320,7 @@ decode(input: Uint8Array, options?: { stream?: false }): string
| stream | boolean | 否 | 在随后的decode()调用中是否跟随附加数据块。如果以块的形式处理数据,则设置为true;如果处理最后的数据块或数据未分块,则设置为false。默认为false。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 解码后的数据。 |
...
...
@@ -332,6 +350,7 @@ decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| input | Uint8Array | 是 | 符合格式需要解码的数组。 |
...
...
@@ -344,6 +363,7 @@ decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string
| stream | boolean | 否 | 在随后的decodeWithStream()调用中是否跟随附加数据块。如果以块的形式处理数据,则设置为true;如果处理最后的数据块或数据未分块,则设置为false。默认为false。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 解码后的数据。 |
...
...
@@ -398,11 +418,13 @@ encode(input?: string): Uint8Array
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| input | string | 是 | 需要编码的字符串。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Uint8Array | 返回编码后的文本。 |
...
...
@@ -425,12 +447,14 @@ encodeInto(input: string, dest: Uint8Array, ): { read: number; written: number }
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| input | string | 是 | 需要编码的字符串。 |
| dest | Uint8Array | 是 | Uint8Array对象实例,用于将生成的UTF-8编码文本放入其中。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Uint8Array | 返回编码后的文本。 |
...
...
@@ -456,6 +480,7 @@ RationalNumber的构造函数。
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| numerator | number | 是 | 分子,整数类型。 |
...
...
@@ -476,11 +501,13 @@ static createRationalFromString(rationalString: string): RationalNumber
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| rationalString | string | 是 | 字符串格式。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| object | 返回有理数类的对象。 |
...
...
@@ -501,11 +528,13 @@ compareTo(another: RationalNumber): number
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| another | RationalNumber | 是 | 其他的有理数对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 如果两个对象相等,则返回0;如果给定对象小于当前对象,则返回1;如果给定对象大于当前对象,则返回-1。 |
...
...
@@ -527,6 +556,7 @@ valueOf(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回整数或者浮点数的值。 |
...
...
@@ -547,11 +577,13 @@ equals(obj: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| object | Object | 是 | 其他类型对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果给定对象与当前对象相同,则返回true;否则返回false。 |
...
...
@@ -573,12 +605,14 @@ static getCommonDivisor(number1: number,number2: number): number
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| number1 | number | 是 | 整数类型。 |
| number2 | number | 是 | 整数类型。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回两个给定数字的最大公约数。 |
...
...
@@ -620,6 +654,7 @@ getDenominator(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回RationalNumber对象的分母的值。 |
...
...
@@ -640,6 +675,7 @@ isZero():boolean
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果当前对象表示的值为0,则返回true;否则返回false。 |
...
...
@@ -660,6 +696,7 @@ isNaN(): boolean
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果分母和分子都为0,则返回true;否则返回false。 |
...
...
@@ -680,6 +717,7 @@ isFinite():boolean
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果分母不为0,则返回true;否则返回false。 |
...
...
@@ -700,6 +738,7 @@ toString(): string
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回Numerator/Denominator格式的字符串,例如3/5,如果当前对象的分子和分母都为0,则返回NaN。 |
...
...
@@ -738,6 +777,7 @@ constructor(capacity?: number)
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| capacity | number | 否 | 指示要为缓冲区自定义的容量。 |
...
...
@@ -757,6 +797,7 @@ updateCapacity(newCapacity: number): void
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| newCapacity | number | 是 | 指示要为缓冲区自定义的容量。 |
...
...
@@ -777,6 +818,7 @@ toString(): string
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回对象的字符串表示形式。 |
...
...
@@ -800,6 +842,7 @@ getCapacity(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回当前缓冲区的容量。 |
...
...
@@ -837,6 +880,7 @@ getCreateCount(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回createDefault()返回值的次数。 |
...
...
@@ -858,6 +902,7 @@ getMissCount(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回查询值不匹配的次数。 |
...
...
@@ -880,6 +925,7 @@ getRemovalCount(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回从缓冲区中驱逐的次数。 |
...
...
@@ -903,6 +949,7 @@ getMatchCount(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回查询值匹配成功的次数。 |
...
...
@@ -925,6 +972,7 @@ getPutCount(): number
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| number | 返回将值添加到缓冲区的次数。 |
...
...
@@ -946,6 +994,7 @@ isEmpty(): boolean
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果当前缓冲区不包含任何值,则返回true。 |
...
...
@@ -967,11 +1016,13 @@ get(key: K): V | undefined
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | K | 是 | 要查询的键。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| V
\|
undefind | 如果指定的键存在于缓冲区中,则返回与键关联的值;否则返回undefined。 |
...
...
@@ -993,12 +1044,14 @@ put(key: K,value: V): V
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | K | 是 | 要添加的密钥。 |
| value | V | 是 | 指示与要添加的键关联的值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| V | 返回与添加的键关联的值;如果要添加的键已经存在,则返回原始值,如果键或值为空,则抛出此异常。 |
...
...
@@ -1009,7 +1062,6 @@ put(key: K,value: V): V
var
result
=
pro
.
put
(
2
,
10
);
```
### values<sup>8+</sup>
values(): V[]
...
...
@@ -1019,6 +1071,7 @@ values(): V[]
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| V
[] | 按从最近访问到最近最少访问的顺序返回当前缓冲区中所有值的列表。 |
...
...
@@ -1042,6 +1095,7 @@ keys(): K[]
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| K
[] | 按升序返回当前缓冲区中所有键的列表,从最近访问到最近最少访问。 |
...
...
@@ -1063,11 +1117,13 @@ remove(key: K): V | undefined
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | K | 是 | 要删除的密钥。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| V
\|
undefind | 返回一个包含已删除键值对的Optional对象;如果key不存在,则返回一个空的Optional对象,如果key为null,则抛出异常。 |
...
...
@@ -1089,6 +1145,7 @@ afterRemoval(isEvict: boolean,key: K,value: V,newValue: V): void
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| isEvict | boolean | 否 | 因容量不足而调用该方法时,参数值为true,其他情况为false。 |
...
...
@@ -1127,11 +1184,13 @@ contains(key: K): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | K | 是 | 表示要检查的键。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果缓冲区包含指定的键,则返回
true。 |
...
...
@@ -1153,11 +1212,13 @@ createDefault(key: K): V
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| key | K | 是 | 表示丢失的键。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| V | 返回与键关联的值。 |
...
...
@@ -1178,6 +1239,7 @@ entries(): IterableIterator<[K,V]>
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [K,
V] | 返回一个可迭代数组。 |
...
...
@@ -1199,6 +1261,7 @@ entries(): IterableIterator<[K,V]>
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| [K,
V] | 返回一个键值对形式的二维数组。 |
...
...
@@ -1260,6 +1323,7 @@ constructor(lowerObj: ScopeType, upperObj: ScopeType)
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| lowerObj |
[
ScopeType
](
#scopetype8
)
| 是 | 指定作用域实例的下限。 |
...
...
@@ -1282,6 +1346,7 @@ toString(): string
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回包含当前范围对象的字符串表示形式。 |
...
...
@@ -1304,11 +1369,13 @@ intersect(range: Scope): Scope
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| range |
[
Scope
](
#scope8
)
| 是 | 传入一个给定范围。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
Scope
](
#scope8
)
| 返回给定范围和当前范围的交集。 |
...
...
@@ -1334,12 +1401,14 @@ intersect(lowerObj:ScopeType,upperObj:ScopeType):Scope
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| lowerObj |
[
ScopeType
](
#scopetype8
)
| 是 | 给定范围的下限。 |
| upperObj |
[
ScopeType
](
#scopetype8
)
| 是 | 给定范围的上限。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
Scope
](
#scope8
)
| 返回当前范围与给定下限和上限范围的交集。 |
...
...
@@ -1387,6 +1456,7 @@ getLower(): ScopeType
**系统能力:**
SystemCapability.Utils.Lang
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
ScopeType
](
#scopetype8
)
| 返回当前范围的下限值。 |
...
...
@@ -1409,12 +1479,14 @@ expand(lowerObj: ScopeType,upperObj: ScopeType): Scope
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| lowerObj |
[
ScopeType
](
#scopetype8
)
| 是 | 给定范围的下限。 |
| upperObj |
[
ScopeType
](
#scopetype8
)
| 是 | 给定范围的上限。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
Scope
](
#scope8
)
| 返回当前范围和给定下限和上限的并集。 |
...
...
@@ -1440,11 +1512,13 @@ expand(range: Scope): Scope
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| range |
[
Scope
](
#scope8
)
| 是 | 传入一个给定范围。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
Scope
](
#scope8
)
| 返回包括当前范围和给定范围的并集。 |
...
...
@@ -1470,11 +1544,13 @@ expand(value: ScopeType): Scope
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value |
[
ScopeType
](
#scopetype8
)
| 是 | 传入一个给定值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
Scope
](
#scope8
)
| 返回包括当前范围和给定值的并集。 |
...
...
@@ -1498,11 +1574,13 @@ contains(value: ScopeType): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value |
[
ScopeType
](
#scopetype8
)
| 是 | 传入一个给定值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果给定值包含在当前范围内返回true,否则返回false。 |
...
...
@@ -1526,11 +1604,13 @@ contains(range: Scope): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| range |
[
Scope
](
#scope8
)
| 是 | 传入一个给定范围。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 如果给定范围包含在当前范围内返回true,否则返回false。 |
...
...
@@ -1556,11 +1636,13 @@ clamp(value: ScopeType): ScopeType
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value |
[
ScopeType
](
#scopetype8
)
| 是 | 传入的给定值。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
|
[
ScopeType
](
#scopetype8
)
| 如果传入的value小于下限,则返回lowerObj;如果大于上限值则返回upperObj;如果在当前范围内,则返回value。 |
...
...
@@ -1601,11 +1683,13 @@ encodeSync(src: Uint8Array): Uint8Array
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| src | Uint8Array | 是 | 编码输入Uint8数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Uint8Array | 返回编码后新分配的Uint8数组。 |
...
...
@@ -1627,11 +1711,13 @@ encodeToStringSync(src: Uint8Array): string
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| src | Uint8Array | 是 | 编码输入Uint8数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| string | 返回编码后的字符串。 |
...
...
@@ -1653,11 +1739,13 @@ decodeSync(src: Uint8Array | string): Uint8Array
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| src | Uint8Array
\|
string | 是 | 解码输入Uint8数组或者字符串。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Uint8Array | 返回解码后新分配的Uint8数组。 |
...
...
@@ -1679,11 +1767,13 @@ encode(src: Uint8Array): Promise<Uint8Array>
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| src | Uint8Array | 是 | 异步编码输入Uint8数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise
<
Uint8Array
>
| 返回异步编码后新分配的Uint8数组。 |
...
...
@@ -1710,11 +1800,13 @@ encodeToString(src: Uint8Array): Promise<string>
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| src | Uint8Array | 是 | 异步编码输入Uint8数组。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise
<
string
>
| 返回异步编码后的字符串。 |
...
...
@@ -1738,11 +1830,13 @@ decode(src: Uint8Array | string): Promise<Uint8Array>
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| src | Uint8Array
\|
string | 是 | 异步解码输入Uint8数组或者字符串。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise
<
Uint8Array
>
| 返回异步解码后新分配的Uint8数组。 |
...
...
@@ -1786,11 +1880,13 @@ isAnyArrayBuffer(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是ArrayBuffer类型为true,反之为false。 |
...
...
@@ -1813,11 +1909,13 @@ ArrayBufferView辅助类型包括:Int8Array、Int16Array、Int32Array、Uint8A
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的ArrayBufferView辅助类型为true,反之为false。 |
...
...
@@ -1838,11 +1936,13 @@ isArgumentsObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的arguments类型为true,反之为false。 |
...
...
@@ -1866,11 +1966,13 @@ isArrayBuffer(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的ArrayBuffer类型为true,反之为false。 |
...
...
@@ -1891,11 +1993,13 @@ isAsyncFunction(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的异步函数类型为true,反之为false。 |
...
...
@@ -1916,11 +2020,13 @@ isBooleanObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Boolean对象类型为true,反之为false。 |
...
...
@@ -1941,11 +2047,13 @@ isBoxedPrimitive(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Boolean或Number或String或Symbol对象类型为true,反之为false。 |
...
...
@@ -1966,11 +2074,13 @@ isDataView(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的DataView对象类型为true,反之为false。 |
...
...
@@ -1992,11 +2102,13 @@ isDate(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Date对象类型为true,反之为false。 |
...
...
@@ -2017,11 +2129,13 @@ isExternal(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含native
External类型为true,反之为false。 |
...
...
@@ -2042,11 +2156,13 @@ isFloat32Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Float32Array数组类型为true,反之为false。 |
...
...
@@ -2067,11 +2183,13 @@ isFloat64Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Float64Array数组类型为true,反之为false。 |
...
...
@@ -2092,11 +2210,13 @@ isGeneratorFunction(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的generator函数类型为true,反之为false。 |
...
...
@@ -2117,11 +2237,13 @@ isGeneratorObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的generator对象类型为true,反之为false。 |
...
...
@@ -2144,11 +2266,13 @@ isInt8Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Int8Array数组类型为true,反之为false。 |
...
...
@@ -2169,11 +2293,13 @@ isInt16Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Int16Array数组类型为true,反之为false。 |
...
...
@@ -2194,11 +2320,13 @@ isInt32Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Int32Array数组类型为true,反之为false。 |
...
...
@@ -2219,11 +2347,13 @@ isMap(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Map类型为true,反之为false。 |
...
...
@@ -2244,11 +2374,13 @@ isMapIterator(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Map的Iterator类型为true,反之为false。 |
...
...
@@ -2270,11 +2402,13 @@ isNativeError(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Error类型为true,反之为false。 |
...
...
@@ -2295,11 +2429,13 @@ isNumberObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Number对象类型为true,反之为false。 |
...
...
@@ -2320,11 +2456,13 @@ isPromise(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Promise类型为true,反之为false。 |
...
...
@@ -2345,11 +2483,13 @@ isProxy(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Proxy类型为true,反之为false。 |
...
...
@@ -2372,11 +2512,13 @@ isRegExp(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的RegExp类型为true,反之为false。 |
...
...
@@ -2397,11 +2539,13 @@ isSet(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Set类型为true,反之为false。 |
...
...
@@ -2422,11 +2566,13 @@ isSetIterator(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Set的Iterator类型为true,反之为false。 |
...
...
@@ -2448,11 +2594,13 @@ isStringObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的String对象类型为true,反之为false。 |
...
...
@@ -2473,11 +2621,13 @@ isSymbolObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Symbol对象类型为true,反之为false。 |
...
...
@@ -2501,11 +2651,13 @@ TypedArray类型的辅助类型,包括Int8Array、Int16Array、Int32Array、Ui
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的TypedArray包含的类型为true,反之为false。 |
...
...
@@ -2526,11 +2678,13 @@ isUint8Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Uint8Array数组类型为true,反之为false。 |
...
...
@@ -2551,11 +2705,13 @@ isUint8ClampedArray(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Uint8ClampedArray数组类型为true,反之为false。 |
...
...
@@ -2576,11 +2732,13 @@ isUint16Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Uint16Array数组类型为true,反之为false。 |
...
...
@@ -2601,11 +2759,13 @@ isUint32Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Uint32Array数组类型为true,反之为false。 |
...
...
@@ -2626,11 +2786,13 @@ isWeakMap(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的WeakMap类型为true,反之为false。 |
...
...
@@ -2651,11 +2813,13 @@ isWeakSet(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的WeakSet类型为true,反之为false。 |
...
...
@@ -2676,11 +2840,13 @@ isBigInt64Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的BigInt64Array类型为true,反之为false。 |
...
...
@@ -2701,11 +2867,13 @@ isBigUint64Array(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的BigUint64Array类型为true,反之为false。 |
...
...
@@ -2726,11 +2894,13 @@ isModuleNamespaceObject(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的Module Namespace Object类型为true,反之为false。 |
...
...
@@ -2752,11 +2922,13 @@ isSharedArrayBuffer(value: Object): boolean
**系统能力:**
SystemCapability.Utils.Lang
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| value | Object | 是 | 待检测对象。 |
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| boolean | 判断的结果,如果是内置包含的SharedArrayBuffer类型为true,反之为false。 |
...
...
Miykael_xxm
🚴
@xiongjiamu
mentioned in commit
caf6cf9d
·
9月 19, 2022
mentioned in commit
caf6cf9d
mentioned in commit caf6cf9da06517e5d5a20c95ddd765c653852528
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录