Ai
46 Star 180 Fork 4.8K

OpenHarmony/interface_sdk-js
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
@ohos.util.LightWeightMap.d.ts 37.19 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
/*
* Copyright (c) 2021-2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file
* @kit ArkTS
*/
/**
* LightWeightMap stores key-value (KV) pairs. Each key must be unique and have only one value.
*
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* LightWeightMap stores key-value (KV) pairs. Each key must be unique and have only one value.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* LightWeightMap stores key-value (KV) pairs. Each key must be unique and have only one value.
*
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
declare class LightWeightMap<K, V> {
/**
* A constructor used to create a LightWeightMap object.
*
* @throws { BusinessError } 10200012 - The LightWeightMap's constructor cannot be directly invoked.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* A constructor used to create a LightWeightMap object.
*
* @throws { BusinessError } 10200012 - The LightWeightMap's constructor cannot be directly invoked.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* A constructor used to create a LightWeightMap object.
*
* @throws { BusinessError } 10200012 - The LightWeightMap's constructor cannot be directly invoked.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
constructor();
/**
* Gets the element number of the LightWeightMap.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Gets the element number of the LightWeightMap.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Gets the element number of the LightWeightMap.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
length: number;
/**
* Gets the element number of the LightWeightMap.
*
* @type { number }
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
get length(): number;
/**
* Returns whether this map has all the object in a specified map
*
* @param { LightWeightMap<K, V> } map - map map the Map object to compare
* @returns { boolean } the boolean type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The hasAll method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns whether this map has all the object in a specified map
*
* @param { LightWeightMap<K, V> } map - map map the Map object to compare
* @returns { boolean } the boolean type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The hasAll method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns whether this map has all the object in a specified map
*
* @param { LightWeightMap<K, V> } map - map map the Map object to compare
* @returns { boolean } the boolean type
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @throws { BusinessError } 10200011 - The hasAll method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
hasAll(map: LightWeightMap<K, V>): boolean;
/**
* Returns whether a key is contained in this map
*
* @param { K } key - key key need to determine whether to include the key
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The hasKey method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns whether a key is contained in this map
*
* @param { K } key - key key need to determine whether to include the key
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The hasKey method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns whether a key is contained in this map
*
* @param { K } key - key key need to determine whether to include the key
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The hasKey method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
hasKey(key: K): boolean;
/**
* Returns whether a value is contained in this map
*
* @param { V } value - value value need to determine whether to include the value
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The hasValue method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns whether a value is contained in this map
*
* @param { V } value - value value need to determine whether to include the value
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The hasValue method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns whether a value is contained in this map
*
* @param { V } value - value value need to determine whether to include the value
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The hasValue method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
hasValue(value: V): boolean;
/**
* Ensures that the capacity of an LightWeightMap container is greater than or equal to a specified value,
* and that the container has all the original objects after capacity expansion
*
* @param { number } minimumCapacity - minimumCapacity minimumCapacity Minimum capacity to be reserved
* @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Ensures that the capacity of an LightWeightMap container is greater than or equal to a specified value,
* and that the container has all the original objects after capacity expansion
*
* @param { number } minimumCapacity - minimumCapacity minimumCapacity Minimum capacity to be reserved
* @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Ensures that the capacity of an LightWeightMap container is greater than or equal to a specified value,
* and that the container has all the original objects after capacity expansion
*
* @param { number } minimumCapacity - minimumCapacity minimumCapacity Minimum capacity to be reserved
* @throws { BusinessError } 10200011 - The increaseCapacityTo method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
increaseCapacityTo(minimumCapacity: number): void;
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order
*
* @returns { IterableIterator<[K, V]> }
* @throws { BusinessError } 10200011 - The entries method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order
*
* @returns { IterableIterator<[K, V]> }
* @throws { BusinessError } 10200011 - The entries method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns a new Iterator object that contains the [key, value] pairs for each element in the Map object in insertion order
*
* @returns { IterableIterator<[K, V]> }
* @throws { BusinessError } 10200011 - The entries method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
entries(): IterableIterator<[K, V]>;
/**
* Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key
*
* @param { K } key - key key the index in LightWeightMap
* @returns { V } value or undefined
* @throws { BusinessError } 10200011 - The get method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key
*
* @param { K } key - key key the index in LightWeightMap
* @returns { V } value or undefined
* @throws { BusinessError } 10200011 - The get method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key
*
* @param { K } key - key key the index in LightWeightMap
* @returns { V } value or undefined
* @throws { BusinessError } 10200011 - The get method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
get(key: K): V;
/**
* Returns the value to which the specified key is mapped, or undefined if this map contains no mapping for the key
*
* @param { K } key - key key the index in LightWeightMap
* @returns { V | undefined } value if associated with key presents, undefined otherwise
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
get(key: K): V | undefined;
/**
* Obtains the index of the key equal to a specified key in an LightWeightMap container
*
* @param { K } key - key key Looking for goals
* @returns { number } Subscript corresponding to target
* @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Obtains the index of the key equal to a specified key in an LightWeightMap container
*
* @param { K } key - key key Looking for goals
* @returns { number } Subscript corresponding to target
* @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the index of the key equal to a specified key in an LightWeightMap container
*
* @param { K } key - key key Looking for goals
* @returns { number } Subscript corresponding to target
* @throws { BusinessError } 10200011 - The getIndexOfKey method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
getIndexOfKey(key: K): number;
/**
* Obtains the index of the value equal to a specified value in an LightWeightMap container
*
* @param { V } value - value value Looking for goals
* @returns { number } Subscript corresponding to target
* @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Obtains the index of the value equal to a specified value in an LightWeightMap container
*
* @param { V } value - value value Looking for goals
* @returns { number } Subscript corresponding to target
* @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the index of the value equal to a specified value in an LightWeightMap container
*
* @param { V } value - value value Looking for goals
* @returns { number } Subscript corresponding to target
* @throws { BusinessError } 10200011 - The getIndexOfValue method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
getIndexOfValue(value: V): number;
/**
* Returns whether the Map object contains elements
*
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns whether the Map object contains elements
*
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns whether the Map object contains elements
*
* @returns { boolean } the boolean type
* @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
isEmpty(): boolean;
/**
* Obtains the key at the location identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { K } the key of key-value pairs
* @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Obtains the key at the location identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { K } the key of key-value pairs
* @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the key at the location identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { K } the key of key-value pairs
* @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getKeyAt(index: number): K;
/**
* Obtains the key at the location identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { K | undefined } the key of key-value pairs
* @throws { BusinessError } 10200011 - The getKeyAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
getKeyAt(index: number): K | undefined;
/**
* Obtains a ES6 iterator that contains all the keys of an LightWeightMap container
*
* @returns { IterableIterator<K> }
* @throws { BusinessError } 10200011 - The keys method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Obtains a ES6 iterator that contains all the keys of an LightWeightMap container
*
* @returns { IterableIterator<K> }
* @throws { BusinessError } 10200011 - The keys method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains a ES6 iterator that contains all the keys of an LightWeightMap container
*
* @returns { IterableIterator<K> }
* @throws { BusinessError } 10200011 - The keys method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
keys(): IterableIterator<K>;
/**
* Adds all element groups in one map to another map
*
* @param { LightWeightMap<K, V> } map - map map the Map object to add members
* @throws { BusinessError } 10200011 - The setAll method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Adds all element groups in one map to another map
*
* @param { LightWeightMap<K, V> } map - map map the Map object to add members
* @throws { BusinessError } 10200011 - The setAll method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Adds all element groups in one map to another map
*
* @param { LightWeightMap<K, V> } map - map map the Map object to add members
* @throws { BusinessError } 10200011 - The setAll method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
setAll(map: LightWeightMap<K, V>): void;
/**
* Adds or updates a(new) key-value pair with a key and value specified for the Map object
*
* @param { K } key - key key Added or updated targets
* @param { V } value - value Added or updated value
* @returns { Object } the map object after set
* @throws { BusinessError } 10200011 - The set method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Adds or updates a(new) key-value pair with a key and value specified for the Map object
*
* @param { K } key - key key Added or updated targets
* @param { V } value - value Added or updated value
* @returns { Object } the map object after set
* @throws { BusinessError } 10200011 - The set method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Adds or updates a(new) key-value pair with a key and value specified for the Map object
*
* @param { K } key - key key Added or updated targets
* @param { V } value - value Added or updated value
* @returns { Object } the map object after set
* @throws { BusinessError } 10200011 - The set method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
set(key: K, value: V): Object;
/**
* Remove the mapping for this key from this map if present
*
* @param { K } key - key key Target to be deleted
* @returns { V } Target mapped value
* @throws { BusinessError } 10200011 - The remove method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Remove the mapping for this key from this map if present
*
* @param { K } key - key key Target to be deleted
* @returns { V } Target mapped value
* @throws { BusinessError } 10200011 - The remove method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Remove the mapping for this key from this map if present
*
* @param { K } key - key key Target to be deleted
* @returns { V } Target mapped value
* @throws { BusinessError } 10200011 - The remove method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
remove(key: K): V;
/**
* Remove the mapping for this key from this map if present
*
* @param { K } key - key key Target to be deleted
* @returns { V | undefined } the value associated with the key if it was removed, undefined otherwise
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
remove(key: K): V | undefined;
/**
* Deletes a key-value pair at the location identified by index from an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { boolean } the boolean type(Is there a delete value)
* @throws { BusinessError } 10200011 - The removeAt method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Deletes a key-value pair at the location identified by index from an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { boolean } the boolean type(Is there a delete value)
* @throws { BusinessError } 10200011 - The removeAt method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Deletes a key-value pair at the location identified by index from an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { boolean } the boolean type(Is there a delete value)
* @throws { BusinessError } 10200011 - The removeAt method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
removeAt(index: number): boolean;
/**
* Removes all of the mapping from this map
* The map will be empty after this call returns
*
* @throws { BusinessError } 10200011 - The clear method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Removes all of the mapping from this map
* The map will be empty after this call returns
*
* @throws { BusinessError } 10200011 - The clear method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Removes all of the mapping from this map
* The map will be empty after this call returns
*
* @throws { BusinessError } 10200011 - The clear method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
clear(): void;
/**
* Sets the value identified by index in an LightWeightMap container to a specified value
*
* @param { number } index - index index Target subscript for search
* @param { V } newValue - newValue value Updated the target mapped value
* @returns { boolean } the boolean type(Is there a value corresponding to the subscript)
* @throws { BusinessError } 10200011 - The setValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Sets the value identified by index in an LightWeightMap container to a specified value
*
* @param { number } index - index index Target subscript for search
* @param { V } newValue - newValue value Updated the target mapped value
* @returns { boolean } the boolean type(Is there a value corresponding to the subscript)
* @throws { BusinessError } 10200011 - The setValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Sets the value identified by index in an LightWeightMap container to a specified value
*
* @param { number } index - index index Target subscript for search
* @param { V } newValue - newValue value Updated the target mapped value
* @returns { boolean } the boolean type(Is there a value corresponding to the subscript)
* @throws { BusinessError } 10200011 - The setValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
setValueAt(index: number, newValue: V): boolean;
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The forEach method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The forEach method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Executes the given callback function once for each real key in the map.
* It does not perform functions on deleted keys.
*
* @param { function } callbackFn - callbackFn
* callbackFn (required) A function that accepts up to three arguments.
* The function to be called for each element.
* @param { Object } [thisArg] - thisArg
* thisArg (Optional) The value to be used as this value for when callbackFn is called.
* If thisArg is omitted, undefined is used as the this value.
* @throws { BusinessError } 10200011 - The forEach method cannot be bound.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
forEach(callbackFn: (value?: V, key?: K, map?: LightWeightMap<K, V>) => void, thisArg?: Object): void;
/**
* Iterates over all key-value pairs in the LightWeightMap and executes a callback function for each entry.
*
* @param { LightWeightMapCbFn<K, V> } callbackFn - A callback function that will be executed for each key-value pair.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
forEach(callbackFn: LightWeightMapCbFn<K, V>): void;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<[K, V]> }
* @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<[K, V]> }
* @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<[K, V]> }
* @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
[Symbol.iterator](): IterableIterator<[K, V]>;
/**
* returns an ES6 iterator.Each item of the iterator is a Javascript Object
*
* @returns { IterableIterator<[K, V]> } an iterator for the LightWeightMap
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
$_iterator(): IterableIterator<[K, V]>;
/**
* Obtains a string that contains all the keys and values in an LightWeightMap container
*
* @returns { String }
* @throws { BusinessError } 10200011 - The toString method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Obtains a string that contains all the keys and values in an LightWeightMap container
*
* @returns { String }
* @throws { BusinessError } 10200011 - The toString method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains a string that contains all the keys and values in an LightWeightMap container
*
* @returns { String }
* @throws { BusinessError } 10200011 - The toString method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
toString(): String;
/**
* Obtains the value identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { V } the value of key-value pairs
* @throws { BusinessError } 10200011 - The getValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Obtains the value identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { V } the value of key-value pairs
* @throws { BusinessError } 10200011 - The getValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Obtains the value identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { V } the value of key-value pairs
* @throws { BusinessError } 10200011 - The getValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 12
*/
getValueAt(index: number): V;
/**
* Obtains the value identified by index in an LightWeightMap container
*
* @param { number } index - index index Target subscript for search
* @returns { V | undefined } the value of key-value pairs
* @throws { BusinessError } 10200011 - The getValueAt method cannot be bound.
* @throws { BusinessError } 10200001 - The value of index is out of range.
* @throws { BusinessError } 401 - Parameter error. Possible causes:
* 1.Mandatory parameters are left unspecified;
* 2.Incorrect parameter types;
* 3.Parameter verification failed.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since 20
* @arkts 1.2
*/
getValueAt(index: number): V | undefined;
/**
* Returns an iterator of the values contained in this map
*
* @returns { IterableIterator<V> }
* @throws { BusinessError } 10200011 - The values method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @since 8
*/
/**
* Returns an iterator of the values contained in this map
*
* @returns { IterableIterator<V> }
* @throws { BusinessError } 10200011 - The values method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 10
*/
/**
* Returns an iterator of the values contained in this map
*
* @returns { IterableIterator<V> }
* @throws { BusinessError } 10200011 - The values method cannot be bound.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @atomicservice
* @since arkts {'1.1':'12', '1.2':'20'}
* @arkts 1.1&1.2
*/
values(): IterableIterator<V>;
}
/**
* The type of LightWeightMap callback function.
*
* @typedef { function } LightWeightMapCbFn
* @param { V } value - The value of the current entry
* @param { K } key - The key of the current entry
* @param { LightWeightMap<K, V> } map - The LightWeightMap instance being traversed
* @returns { void } This callback does not return a value
* @syscap SystemCapability.Utils.Lang
* @atomicservice
* @since 20
* @arkts 1.2
*/
type LightWeightMapCbFn<K, V> = (value: V, key: K, map: LightWeightMap<K, V>) => void;
export default LightWeightMap;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openharmony/interface_sdk-js.git
git@gitee.com:openharmony/interface_sdk-js.git
openharmony
interface_sdk-js
interface_sdk-js
master

搜索帮助