interface_sdk-js/api/@ohos.util.d.ts
liu_wei 7c68108e75 Add util,worker interface for ArkUI-X since API 10
Signed-off-by: liu_wei <liuwei742@huawei.com>
2023-04-24 11:20:16 +08:00

1813 lines
73 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 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.
*/
/**
* TextDecoder support full encoding in ICU data utf-8 utf-16 iso8859 must support in all device, TextEncoder takes a
* stream of code points as input and emits a stream of UTF-8 bytes, and system help function.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
*/
declare namespace util {
/**
* %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented
* with an n and Objects that have no user defined toString function are inspected using util.inspect() with
* options { depth: 0, colors: false, compact: 3 }.
* %d: Number will be used to convert all values except BigInt and Symbol.
* %i: parseInt(value, 10) is used for all values except BigInt and Symbol.
* %f: parseFloat(value) is used for all values except Bigint and Symbol.
* %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references.
* %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to
* util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including
* non-enumerable properties and proxies.
* %O: Object. A string representation of an object with generic JavaScript object formatting.
* %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to
* util.inspect() without options. This will show the full object not including non-enumerable properties and
* proxies.
* %c: CSS. This specifier is ignored and will skip any CSS passed in.
* %%: single percent sign ('%'). This does not consume an argument.Returns: <string> The formatted string.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.format
* @syscap SystemCapability.Utils.Lang
* @param format Styled string
* @param args Data to be formatted
* @returns Return the character string formatted in a specific format
*/
function printf(format: string, ...args: Object[]): string;
/**
* %s: String will be used to convert all values except BigInt, Object and -0. BigInt values will be represented
* with an n and Objects that have no user defined toString function are inspected using util.inspect() with
* options { depth: 0, colors: false, compact: 3 }.
* %d: Number will be used to convert all values except BigInt and Symbol.
* %i: parseInt(value, 10) is used for all values except BigInt and Symbol.
* %f: parseFloat(value) is used for all values except Bigint and Symbol.
* %j: JSON. Replaced with the string '[Circular]' if the argument contains circular references.
* %o: Object. A string representation of an object with generic JavaScript object formatting.Similar to
* util.inspect() with options { showHidden: true, showProxy: true}. This will show the full object including
* non-enumerable properties and proxies.
* %O: Object. A string representation of an object with generic JavaScript object formatting.
* %O: Object. A string representation of an object with generic JavaScript object formatting.Similar to
* util.inspect() without options. This will show the full object not including non-enumerable properties and
* proxies.
* %c: CSS. This specifier is ignored and will skip any CSS passed in.
* %%: single percent sign ('%'). This does not consume an argument.Returns: <string> The formatted string.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param format Styled string
* @param args Data to be formatted
* @returns Return the character string formatted in a specific format
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
function format(format: string, ...args: Object[]): string;
/**
* Get the string name of the system errno.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.errnoToString
* @syscap SystemCapability.Utils.Lang
* @param errno The error code generated by an error in the system
* @returns Return the string name of a system errno
*/
function getErrorString(errno: number): string;
/**
* Get the string name of the system errno.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param errno The error code generated by an error in the system
* @returns Return the string name of a system errno
* @throws {BusinessError} 401 - The type of errno must be number.
*/
function errnoToString(errno: number): string;
/**
* Takes an async function (or a function that returns a Promise) and returns a function following the
* error-first callback style.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
* @param original Asynchronous function
* @throws {BusinessError} 401 - The type of original must be Function.
*/
function callbackWrapper(original: Function): (err: Object, value: Object) => void;
/**
* Takes a function following the common error-first callback style, i.e taking an (err, value) =>
* callback as the last argument, and return a function that returns promises.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param original Asynchronous function
* @returns Return a function that returns promises
* @throws {BusinessError} 401 - The type of original must be Function.
*/
function promisify(original: (err: Object, value: Object) => void): Function;
/**
* Takes a function following the common error-first callback style, i.e taking an (err, value) =>
* callback as the last argument, and return a version that returns promises.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.promisify
* @syscap SystemCapability.Utils.Lang
* @param original Asynchronous function
* @returns Return a version that returns promises
*/
function promiseWrapper(original: (err: Object, value: Object) => void): Object;
/**
* Generate a random RFC 4122 version 4 UUID using a cryptographically secure random number generator.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param entropyCache Whether to generate the UUID with using the cache. Default: true.
* @returns Return a string representing this UUID.
* @throws {BusinessError} 401 - The type of entropyCache must be boolean.
*/
function generateRandomUUID(entropyCache?: boolean): string;
/**
* Generate a random RFC 4122 version 4 binary UUID using a cryptographically secure random number generator.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param entropyCache Whether to generate the UUID with using the cache. Default: true.
* @returns Return a Uint8Array representing this UUID.
* @throws {BusinessError} 401 - The type of entropyCache must be boolean.
*/
function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array;
/**
* Parse a UUID from the string standard representation as described in the RFC 4122 version 4.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param uuid String that specifies a UUID
* @returns Return a Uint8Array representing this UUID. Throw SyntaxError if parsing fails.
* @throws {BusinessError} 401 - The type of uuid must be string.
*/
function parseUUID(uuid: string): Uint8Array;
/**
* The TextEncoder represents a text encoder that accepts a string as input,
* encodes it in UTF-8 format, and outputs UTF-8 byte stream.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 7
*/
class TextDecoder {
/**
* The source encoding's name, lowercased.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
*/
readonly encoding: string;
/**
* Returns `true` if error mode is "fatal", and `false` otherwise.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
*/
readonly fatal: boolean;
/**
* Returns `true` if ignore BOM flag is set, and `false` otherwise.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
*/
readonly ignoreBOM = false;
/**
* The textEncoder constructor.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.TextDecoder.create
* @syscap SystemCapability.Utils.Lang
* @param encoding Decoding format
*/
constructor(
encoding?: string,
options?: { fatal?: boolean; ignoreBOM?: boolean },
);
/**
* The textEncoder constructor.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
constructor();
/**
* Replaces the original constructor to process arguments and return a textDecoder object.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param encoding Decoding format
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
static create(
encoding?: string,
options?: { fatal?: boolean; ignoreBOM?: boolean }
): TextDecoder;
/**
* Returns the result of running encoding's decoder.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.decodeWithStream
* @syscap SystemCapability.Utils.Lang
* @param input Decoded numbers in accordance with the format
* @returns Return decoded text
*/
decode(input: Uint8Array, options?: { stream?: false }): string;
/**
* Decodes the input and returns a string. If options.stream is true, any incomplete byte sequences occurring
* at the end of the input are buffered internally and emitted after the next call to textDecoder.decode().
* If textDecoder.fatal is true, decoding errors that occur will result in a TypeError being thrown.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param input Decoded numbers in accordance with the format
* @returns Return decoded text
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
decodeWithStream(input: Uint8Array, options?: { stream?: boolean }): string;
}
/**
* The TextDecoder interface represents a text decoder.
* The decoder takes the byte stream as the input and outputs the String string.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 7
*/
class TextEncoder {
/**
* Encoding format.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
*/
readonly encoding = "utf-8";
/**
* The textEncoder constructor.
* @crossplatform
* @since 7
* @syscap SystemCapability.Utils.Lang
*/
constructor();
/**
* The textEncoder constructor.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param encoding The string for encoding format.
* @throws {BusinessError} 401 - The type of encoding must be string.
*/
constructor(encoding?: string);
/**
* Returns the result of encoder.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.encodeInto
* @syscap SystemCapability.Utils.Lang
* @param input The string to be encoded.
* @returns Returns the encoded text.
*/
encode(input?: string): Uint8Array;
/**
* UTF-8 encodes the input string and returns a Uint8Array containing the encoded bytes.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param input The string to be encoded.
* @returns Returns the encoded text.
* @throws {BusinessError} 401 - The type of input must be string.
*/
encodeInto(input?: string): Uint8Array;
/**
* Encode string, write the result to dest array.
* @since 7
* @deprecated since 9
* @useinstead ohos.util.encodeIntoUint8Array
* @syscap SystemCapability.Utils.Lang
* @param input The string to be encoded.
* @param dest Decoded numbers in accordance with the format
* @returns 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 };
/**
* Encode string, write the result to dest array.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param input The string to be encoded.
* @param dest Decoded numbers in accordance with the format
* @returns 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.
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
encodeIntoUint8Array(
input: string,
dest: Uint8Array,
): { read: number; written: number };
}
/**
* The rational number is mainly to compare rational numbers and obtain the numerator and denominator.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 8
*/
class RationalNumber {
/**
* A constructor used to create a RationalNumber instance with a given numerator and denominator.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.RationalNumber.parseRationalNumber
* @syscap SystemCapability.Utils.Lang
* @param numerator An integer number
* @param denominator An integer number
*/
constructor(numerator: number, denominator: number);
/**
* A constructor used to create a RationalNumber instance with a given numerator and denominator.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
constructor();
/**
* Used to create a RationalNumber instance with a given numerator and denominator.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param numerator An integer number
* @param denominator An integer number
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
static parseRationalNumber(numerator: number, denominator: number): RationalNumber;
/**
* Creates a RationalNumber object based on a given string.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param rationalString String Expression of Rational Numbers
* @returns Returns a RationalNumber object generated based on the given string.
* @throws {BusinessError} 401 - The type of rationalString must be string.
*/
static createRationalFromString(rationalString: string): RationalNumber;
/**
* Compares the current RationalNumber object to the given object.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.compare
* @syscap SystemCapability.Utils.Lang
* @param another An object of other rational numbers
* @returns Returns 0 or 1, or -1, depending on the comparison.
*/
compareTo(another :RationalNumber): number;
/**
* Compares the current RationalNumber object to the given object.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param another An object of other rational numbers
* @returns Returns 0 or 1, or -1, depending on the comparison.
* @throws {BusinessError} 401 - The type of another must be RationalNumber.
*/
compare(another :RationalNumber): number;
/**
* Compares two objects for equality.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param obj An object
* @returns Returns true if the given object is the same as the current object; Otherwise, false is returned.
*/
equals(obj: Object): boolean;
/**
* Gets integer and floating-point values of a rational number object.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns Returns the integer and floating-point values of a rational number object.
*/
valueOf(): number;
/**
* Get the greatest common divisor of two integers.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.getCommonFactor
* @syscap SystemCapability.Utils.Lang
* @param number1 Is an integer.
* @param number2 Is an integer.
* @returns Returns the greatest common divisor of two integers, integer type.
*/
static getCommonDivisor(number1: number, number2: number): number;
/**
* Get the greatest common factor of two integers.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param number1 Is an integer.
* @param number2 Is an integer.
* @returns Returns the greatest common factor of two integers, integer type.
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
static getCommonFactor(number1: number, number2: number): number;
/**
* Gets the denominator of the current object.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns Returns the denominator of the current object.
*/
getDenominator(): number;
/**
* Gets the numerator of the current object.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns Returns the numerator of the current object.
*/
getNumerator(): number;
/**
* Checks whether the current RationalNumber object represents an infinite value.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns If the denominator is not 0, true is returned. Otherwise, false is returned.
*/
isFinite(): boolean;
/**
* Checks whether the current RationalNumber object represents a Not-a-Number (NaN) value.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns If both the denominator and numerator are 0, true is returned. Otherwise, false is returned.
*/
isNaN(): boolean;
/**
* Checks whether the current RationalNumber object represents the value 0.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns If the value represented by the current object is 0, true is returned. Otherwise, false is returned.
*/
isZero(): boolean;
/**
* Obtains a string representation of the current RationalNumber object.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns Returns a string representation of the current RationalNumber object.
*/
toString(): string;
}
/**
* The LruBuffer algorithm replaces the least used data with new data when the buffer space is insufficient.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache
*/
class LruBuffer<K, V> {
/**
* Default constructor used to create a new LruBuffer instance with the default capacity of 64.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.constructor
* @syscap SystemCapability.Utils.Lang
* @param capacity Indicates the capacity to customize for the buffer.
*/
constructor(capacity?: number);
/**
* Updates the buffer capacity to a specified capacity.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.updateCapacity
* @syscap SystemCapability.Utils.Lang
* @param newCapacity Indicates the new capacity to set.
*/
updateCapacity(newCapacity: number):void
/**
* Returns a string representation of the object.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.toString
* @syscap SystemCapability.Utils.Lang
* @returns Returns the string representation of the object and outputs the string representation of the object.
*/
toString(): string
/**
* Obtains a list of all values in the current buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.length
* @syscap SystemCapability.Utils.Lang
* @returns Returns the total number of values in the current buffer.
*/
length: number
/**
* Obtains the capacity of the current buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.getCapacity
* @syscap SystemCapability.Utils.Lang
* @returns Returns the capacity of the current buffer.
*/
getCapacity(): number;
/**
* Clears key-value pairs from the current buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.clear
* @syscap SystemCapability.Utils.Lang
*/
clear(): void;
/**
* Obtains the number of times createDefault(Object) returned a value.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.getCreateCount
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times createDefault(java.lang.Object) returned a value.
*/
getCreateCount(): number;
/**
* Obtains the number of times that the queried values are not matched.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.getMissCount
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that the queried values are not matched.
*/
getMissCount(): number;
/**
* Obtains the number of times that values are evicted from the buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.getRemovalCount
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that values are evicted from the buffer.
*/
getRemovalCount(): number;
/**
* Obtains the number of times that the queried values are successfully matched.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.getMatchCount
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that the queried values are successfully matched.
*/
getMatchCount(): number;
/**
* Obtains the number of times that values are added to the buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.getPutCount
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that values are added to the buffer.
*/
getPutCount(): number;
/**
* Checks whether the current buffer is empty.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.isEmpty
* @syscap SystemCapability.Utils.Lang
* @returns Returns true if the current buffer contains no value.
*/
isEmpty(): boolean;
/**
* Obtains the value associated with a specified key.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.get
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to query.
* @returns Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise.
*/
get(key: K): V | undefined;
/**
* Adds a key-value pair to the buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.put
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to add.
* @param value Indicates the value associated with the key to add.
* @returns Returns the value associated with the added key; returns the original value if the key to add already exists.
*/
put(key: K, value: V): V;
/**
* Obtains a list of all values in the current buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.values
* @syscap SystemCapability.Utils.Lang
* @returns Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed.
*/
values(): V[];
/**
* Obtains a list of keys for the values in the current buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.keys
* @syscap SystemCapability.Utils.Lang
* @returns Returns a list of keys sorted from most recently accessed to least recently accessed.
*/
keys(): K[];
/**
* Deletes a specified key and its associated value from the current buffer.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.remove
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to delete.
* @returns Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist.
*/
remove(key: K): V | undefined;
/**
* Executes subsequent operations after a value is deleted.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.afterRemoval
* @syscap SystemCapability.Utils.Lang
* @param isEvict The parameter value is true if this method is called due to insufficient capacity, and the parameter value is false in other cases.
* @param key Indicates the deleted key.
* @param value Indicates the deleted value.
* @param newValue The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) method is called and the key to add already exists. The parameter value is null in other cases.
*/
afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void;
/**
* Checks whether the current buffer contains a specified key.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.contains
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to check.
* @returns Returns true if the buffer contains the specified key.
*/
contains(key: K): boolean;
/**
* Called after a cache miss to compute a value for the corresponding key.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.createDefault
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the missed key.
* @returns Returns the value associated with the key.
*/
createDefault(key: K): V;
/**
* Returns an array of key-value pairs of enumeratable properties of a given object.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.entries
* @syscap SystemCapability.Utils.Lang
* @returns Returns an array of key-value pairs for the enumeratable properties of the given object itself.
*/
entries(): IterableIterator<[K, V]>;
/**
* Specifies the default iterator for an object.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.LRUCache.[Symbol.iterator]
* @syscap SystemCapability.Utils.Lang
* @returns Returns a two - dimensional array in the form of key - value pairs.
*/
[Symbol.iterator](): IterableIterator<[K, V]>;
}
/**
* The LRUCache algorithm replaces the least used data with new data when the buffer space is insufficient.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 9
*/
class LRUCache<K, V> {
/**
* Default constructor used to create a new LruBuffer instance with the default capacity of 64.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param capacity Indicates the capacity to customize for the buffer.
*/
constructor(capacity?: number);
/**
* Updates the buffer capacity to a specified capacity.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param newCapacity Indicates the new capacity to set.
* @throws {BusinessError} 401 - The type of newCapacity must be number.
*/
updateCapacity(newCapacity: number):void
/**
* Returns a string representation of the object.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the string representation of the object and outputs the string representation of the object.
*/
toString(): string
/**
* Obtains a list of all values in the current buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the total number of values in the current buffer.
*/
length: number
/**
* Obtains the capacity of the current buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the capacity of the current buffer.
*/
getCapacity(): number;
/**
* Clears key-value pairs from the current buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
*/
clear(): void;
/**
* Obtains the number of times createDefault(Object) returned a value.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times createDefault(java.lang.Object) returned a value.
*/
getCreateCount(): number;
/**
* Obtains the number of times that the queried values are not matched.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that the queried values are not matched.
*/
getMissCount(): number;
/**
* Obtains the number of times that values are evicted from the buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that values are evicted from the buffer.
*/
getRemovalCount(): number;
/**
* Obtains the number of times that the queried values are successfully matched.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that the queried values are successfully matched.
*/
getMatchCount(): number;
/**
* Obtains the number of times that values are added to the buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the number of times that values are added to the buffer.
*/
getPutCount(): number;
/**
* Checks whether the current buffer is empty.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns true if the current buffer contains no value.
*/
isEmpty(): boolean;
/**
* Obtains the value associated with a specified key.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to query.
* @returns Returns the value associated with the key if the specified key is present in the buffer; returns null otherwise.
* @throws {BusinessError} 401 - The type of key must be object.
*/
get(key: K): V | undefined;
/**
* Adds a key-value pair to the buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to add.
* @param value Indicates the value associated with the key to add.
* @returns Returns the value associated with the added key; returns the original value if the key to add already exists.
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
put(key: K, value: V): V;
/**
* Obtains a list of all values in the current buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the list of all values in the current buffer in ascending order, from the most recently accessed to least recently accessed.
*/
values(): V[];
/**
* Obtains a list of keys for the values in the current buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns a list of keys sorted from most recently accessed to least recently accessed.
*/
keys(): K[];
/**
* Deletes a specified key and its associated value from the current buffer.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to delete.
* @returns Returns an Optional object containing the deleted key-value pair; returns an empty Optional object if the key does not exist.
* @throws {BusinessError} 401 - The type of key must be object.
*/
remove(key: K): V | undefined;
/**
* Executes subsequent operations after a value is deleted.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param isEvict The parameter value is true if this method is called due to insufficient capacity, and the parameter value is false in other cases.
* @param key Indicates the deleted key.
* @param value Indicates the deleted value.
* @param newValue The parameter value is the new value associated if the put(java.lang.Object,java.lang.Object) method is called and the key to add already exists. The parameter value is null in other cases.
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void;
/**
* Checks whether the current buffer contains a specified key.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the key to check.
* @returns Returns true if the buffer contains the specified key.
* @throws {BusinessError} 401 - The type of key must be object.
*/
contains(key: K): boolean;
/**
* Executes subsequent operations if miss to compute a value for the specific key.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param key Indicates the missed key.
* @returns Returns the value associated with the key.
* @throws {BusinessError} 401 - The type of key must be object.
*/
createDefault(key: K): V;
/**
* Returns an array of key-value pairs of enumeratable properties of a given object.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns an array of key-value pairs for the enumeratable properties of the given object itself.
*/
entries(): IterableIterator<[K, V]>;
/**
* Specifies the default iterator for an object.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns a two - dimensional array in the form of key - value pairs.
*/
[Symbol.iterator](): IterableIterator<[K, V]>;
}
interface ScopeComparable {
/**
* The comparison function is used by the scope.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @returns Returns whether the current object is greater than or equal to the input object.
*/
compareTo(other: ScopeComparable): boolean;
}
/**
* A type used to denote ScopeComparable or number.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
*/
type ScopeType = ScopeComparable | number;
/**
* The Scope interface is used to describe the valid range of a field.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper
*/
class Scope {
/**
* A constructor used to create a Scope instance with the lower and upper bounds specified.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.constructor
* @syscap SystemCapability.Utils.Lang
* @param lowerObj A ScopeType value
* @param upperObj A ScopeType value
*/
constructor(lowerObj: ScopeType, upperObj: ScopeType);
/**
* Obtains a string representation of the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.toString
* @syscap SystemCapability.Utils.Lang
* @returns Returns a string representation of the current range object.
*/
toString(): string;
/**
* Returns the intersection of a given range and the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.intersect
* @syscap SystemCapability.Utils.Lang
* @param range A Scope range object
* @returns Returns the intersection of a given range and the current range.
*/
intersect(range: Scope): Scope;
/**
* Returns the intersection of the current range and the range specified by the given lower and upper bounds.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.intersect
* @syscap SystemCapability.Utils.Lang
* @param lowerObj A ScopeType value
* @param upperObj A ScopeType value
* @returns Returns the intersection of the current range and the range specified by the given lower and upper bounds.
*/
intersect(lowerObj: ScopeType, upperObj: ScopeType): Scope;
/**
* Obtains the upper bound of the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.getUpper
* @syscap SystemCapability.Utils.Lang
* @returns Returns the upper bound of the current range.
*/
getUpper(): ScopeType;
/**
* Obtains the lower bound of the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.getLower
* @syscap SystemCapability.Utils.Lang
* @returns Returns the lower bound of the current range.
*/
getLower(): ScopeType;
/**
* Creates the smallest range that includes the current range and the given lower and upper bounds.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.expand
* @syscap SystemCapability.Utils.Lang
* @param lowerObj A ScopeType value
* @param upperObj A ScopeType value
* @returns Returns the smallest range that includes the current range and the given lower and upper bounds.
*/
expand(lowerObj: ScopeType, upperObj: ScopeType): Scope;
/**
* Creates the smallest range that includes the current range and a given range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.expand
* @syscap SystemCapability.Utils.Lang
* @param range A Scope range object
* @returns Returns the smallest range that includes the current range and a given range.
*/
expand(range: Scope): Scope;
/**
* Creates the smallest range that includes the current range and a given value.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.expand
* @syscap SystemCapability.Utils.Lang
* @param value A ScopeType value
* @returns Returns the smallest range that includes the current range and a given value.
*/
expand(value: ScopeType): Scope;
/**
* Checks whether a given value is within the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.contains
* @syscap SystemCapability.Utils.Lang
* @param value A ScopeType value
* @returns If the value is within the current range return true,otherwise return false.
*/
contains(value: ScopeType): boolean;
/**
* Checks whether a given range is within the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.contains
* @syscap SystemCapability.Utils.Lang
* @param range A Scope range
* @returns If the current range is within the given range return true,otherwise return false.
*/
contains(range: Scope): boolean;
/**
* Clamps a given value to the current range.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.ScopeHelper.clamp
* @syscap SystemCapability.Utils.Lang
* @param value A ScopeType value
* @returns Returns a ScopeType object that a given value is clamped to the current range..
*/
clamp(value: ScopeType): ScopeType;
}
/**
* The ScopeHelper interface is used to describe the valid range of a field.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 9
*/
class ScopeHelper {
/**
* A constructor used to create a Scope instance with the lower and upper bounds specified.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param lowerObj A ScopeType value
* @param upperObj A ScopeType value
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
constructor(lowerObj: ScopeType, upperObj: ScopeType);
/**
* Obtains a string representation of the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns a string representation of the current range object.
*/
toString(): string;
/**
* Returns the intersection of a given range and the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param range A Scope range object
* @returns Returns the intersection of a given range and the current range.
* @throws {BusinessError} 401 - The type of range must be ScopeHelper.
*/
intersect(range: ScopeHelper): ScopeHelper;
/**
* Returns the intersection of the current range and the range specified by the given lower and upper bounds.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param lowerObj A ScopeType value
* @param upperObj A ScopeType value
* @returns Returns the intersection of the current range and the range specified by the given lower and upper bounds.
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
intersect(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper;
/**
* Obtains the upper bound of the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the upper bound of the current range.
*/
getUpper(): ScopeType;
/**
* Obtains the lower bound of the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @returns Returns the lower bound of the current range.
*/
getLower(): ScopeType;
/**
* Creates the smallest range that includes the current range and the given lower and upper bounds.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param lowerObj A ScopeType value
* @param upperObj A ScopeType value
* @returns Returns the smallest range that includes the current range and the given lower and upper bounds.
* @throws {BusinessError} 401 - if the input parameters are invalid.
*/
expand(lowerObj: ScopeType, upperObj: ScopeType): ScopeHelper;
/**
* Creates the smallest range that includes the current range and a given range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param range A Scope range object
* @returns Returns the smallest range that includes the current range and a given range.
* @throws {BusinessError} 401 - The type of range must be ScopeHelper.
*/
expand(range: ScopeHelper): ScopeHelper;
/**
* Creates the smallest range that includes the current range and a given value.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value A ScopeType value
* @returns Returns the smallest range that includes the current range and a given value.
* @throws {BusinessError} 401 - The type of value must be object.
*/
expand(value: ScopeType): ScopeHelper;
/**
* Checks whether a given value is within the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value A ScopeType value
* @returns If the value is within the current range return true,otherwise return false.
* @throws {BusinessError} 401 - The type of value must be object.
*/
contains(value: ScopeType): boolean;
/**
* Checks whether a given range is within the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param range A Scope range
* @returns If the current range is within the given range return true,otherwise return false.
* @throws {BusinessError} 401 - The type of range must be ScopeHelper.
*/
contains(range: ScopeHelper): boolean;
/**
* Clamps a given value to the current range.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param value A ScopeType value
* @returns Returns a ScopeType object that a given value is clamped to the current range.
* @throws {BusinessError} 401 - The type of value must be object.
*/
clamp(value: ScopeType): ScopeType;
}
/**
* Decodes a Base64 encoded String or input u8 array into a newly-allocated
* u8 array using the Base64 encoding scheme.
* @syscap SystemCapability.Utils.Lang
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper
*/
class Base64 {
/**
* Constructor for creating base64 encoding and decoding
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.constructor
* @syscap SystemCapability.Utils.Lang
* @param No input parameter is required.
* @returns No return value.
*/
constructor();
/**
* Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.encodeSync
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Return the encoded new Uint8Array.
*/
encodeSync(src: Uint8Array): Uint8Array;
/**
* Encodes the specified byte array into a String using the Base64 encoding scheme.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.encodeToStringSync
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Return the encoded string.
*/
encodeToStringSync(src: Uint8Array): string;
/**
* Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.decodeSync
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value or value A string value
* @returns Return the decoded Uint8Array.
*/
decodeSync(src: Uint8Array | string): Uint8Array;
/**
* Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.encode
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Return the encodes asynchronous new Uint8Array.
*/
encode(src: Uint8Array): Promise<Uint8Array>;
/**
* Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.encodeToString
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Returns the encoded asynchronous string.
*/
encodeToString(src: Uint8Array): Promise<string>;
/**
* Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or input u8 array into a newly allocated u8 array.
* @since 8
* @deprecated since 9
* @useinstead ohos.util.Base64Helper.decode
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value or value A string value
* @returns Return the decoded asynchronous Uint8Array.
*/
decode(src: Uint8Array | string): Promise<Uint8Array>;
}
/**
* Decodes a Base64 encoded String or input u8 array into a newly-allocated
* u8 array using the Base64 encoding scheme.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 9
*/
class Base64Helper {
/**
* Constructor for creating base64 encoding and decoding
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param No input parameter is required.
* @returns No return value.
*/
constructor();
/**
* Encodes all bytes from the specified u8 array into a newly-allocated u8 array using the Base64 encoding scheme.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Return the encoded new Uint8Array.
* @throws {BusinessError} 401 - The type of src must be Uint8Array.
*/
encodeSync(src: Uint8Array): Uint8Array;
/**
* Encodes the specified byte array into a String using the Base64 encoding scheme.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Return the encoded string.
* @throws {BusinessError} 401 - The type of src must be Uint8Array.
*/
encodeToStringSync(src: Uint8Array): string;
/**
* Decodes a Base64 encoded String or input u8 array into a newly-allocated u8 array using the Base64 encoding scheme.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value or value A string value
* @returns Return the decoded Uint8Array.
* @throws {BusinessError} 401 - The type of src must be Uint8Array or string.
*/
decodeSync(src: Uint8Array | string): Uint8Array;
/**
* Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Return the encodes asynchronous new Uint8Array.
* @throws {BusinessError} 401 - The type of src must be Uint8Array.
*/
encode(src: Uint8Array): Promise<Uint8Array>;
/**
* Asynchronously encodes the specified byte array into a String using the Base64 encoding scheme.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value
* @returns Returns the encoded asynchronous string.
* @throws {BusinessError} 401 - The type of src must be Uint8Array.
*/
encodeToString(src: Uint8Array): Promise<string>;
/**
* Use the Base64 encoding scheme to asynchronously decode a Base64-encoded string or
* input u8 array into a newly allocated u8 array.
* @crossplatform
* @since 9
* @syscap SystemCapability.Utils.Lang
* @param src A Uint8Array value or value A string value
* @returns Return the decoded asynchronous Uint8Array.
* @throws {BusinessError} 401 - The type of src must be Uint8Array or string.
*/
decode(src: Uint8Array | string): Promise<Uint8Array>;
}
/**
* Check the type of parameter.
* @syscap SystemCapability.Utils.Lang
* @crossplatform
* @since 8
*/
class types{
/**
* The types constructor
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param No input parameter is required.
* @returns No return value.
*/
constructor();
/**
* Check whether the entered value is of arraybuffer or sharedarraybuffer type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A ArrayBuffer or SharedArrayBuffer value
* @returns Returns true if the value is a built-in ArrayBuffer or SharedArrayBuffer instance.
*/
isAnyArrayBuffer(value: Object): boolean;
/**
* Check whether the type is included in the isAnyArrayBuffer.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A included in the isAnyArrayBuffer value
* @returns Returns true if the value is an instance of one of the ArrayBuffer views, such as typed array objects or DataView. Equivalent to ArrayBuffer.isView().
*/
isArrayBufferView(value: Object): boolean;
/**
* Check whether the entered value is an arguments object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A arguments value
* @returns Returns true if the value is an arguments object.
*/
isArgumentsObject(value: Object): boolean;
/**
* Check whether the entered value is of arraybuffer type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A arraybuffer value
* @returns Returns true if the value is a built-in ArrayBuffer instance. This does not include SharedArrayBuffer instances. Usually, it is desirable to test for both; See isAnyArrayBuffer() for that.
*/
isArrayBuffer(value: Object): boolean;
/**
* Check whether the value entered is an asynchronous function type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A async function value
* @returns Returns true if the value is an async function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used.
*/
isAsyncFunction(value: Object): boolean;
/**
* Check whether the entered value is of bigint64array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A BigInt64Array value
* @returns Returns true if the value is a BigInt64Array instance.
*/
isBigInt64Array(value: Object): boolean;
/**
* Check whether the entered value is of biguint64array array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A BigUint64Array value
* @returns Returns true if the value is a BigUint64Array instance.
*/
isBigUint64Array(value: Object): boolean;
/**
* Check whether the entered value is a Boolean object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A boolean object value
* @returns Returns true if the value is a boolean object, e.g. created by new Boolean().
*/
isBooleanObject(value: Object): boolean;
/**
* Check whether the entered value is a Boolean or number or string or symbol object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A boxed primitive object value
* @returns Returns true if the value is any boxed primitive object, e.g. created by new Boolean(), new String() or Object(Symbol()).
*/
isBoxedPrimitive(value: Object): boolean;
/**
* Check whether the entered value is of DataView type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A DataView value
* @returns Returns true if the value is a built-in DataView instance.
*/
isDataView(value: Object): boolean;
/**
* Check whether the entered value is of type date.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Date value
* @returns Returns true if the value is a built-in Date instance.
*/
isDate(value: Object): boolean;
/**
* Check whether the entered value is a native external value type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A External value
* @returns Returns true if the value is a native External value.
*/
isExternal(value: Object): boolean;
/**
* Check whether the entered value is of float32array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Float32Array value
* @returns Returns true if the value is a built-in Float32Array instance.
*/
isFloat32Array(value: Object): boolean;
/**
* Check whether the entered value is of float64array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Float64Array value
* @returns Returns true if the value is a built-in Float64Array instance.
*/
isFloat64Array(value: Object): boolean;
/**
* Check whether the input value is a generator function type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A generator function value
* @returns Returns true if the value is a generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used.
*/
isGeneratorFunction(value: Object): boolean;
/**
* Check whether the entered value is a generator object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A generator object value
* @returns Returns true if the value is a generator object as returned from a built-in generator function. This only reports back what the JavaScript engine is seeing; in particular, the return value may not match the original source code if a transpilation tool was used.
*/
isGeneratorObject(value: Object): boolean;
/**
* Check whether the entered value is of int8array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Int8Array value
* @returns Returns true if the value is a built-in Int8Array instance.
*/
isInt8Array(value: Object): boolean;
/**
* Check whether the entered value is the int16array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Int16Array value
* @returns Returns true if the value is a built-in Int16Array instance.
*/
isInt16Array(value: Object): boolean;
/**
* Check whether the entered value is the int32array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Int32Array value
* @returns Returns true if the value is a built-in Int32Array instance.
*/
isInt32Array(value: Object): boolean;
/**
* Check whether the entered value is of map type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Map value
* @returns Returns true if the value is a built-in Map instance.
*/
isMap(value: Object): boolean;
/**
* Check whether the entered value is the iterator type of map.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Map iterator value
* @returns Returns true if the value is an iterator returned for a built-in Map instance.
*/
isMapIterator(value: Object): boolean;
/**
* Check whether the entered value is the module namespace object object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Module Namespace Object value
* @returns Returns true if the value is an instance of a Module Namespace Object.
*/
isModuleNamespaceObject(value: Object): boolean;
/**
* Check whether the value entered is of type error.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Error value
* @returns Returns true if the value is an instance of a built-in Error type.
*/
isNativeError(value: Object): boolean;
/**
* Check whether the entered value is of the number object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A number object value
* @returns Returns true if the value is a number object, e.g. created by new Number().
*/
isNumberObject(value: Object): boolean;
/**
* Check whether the entered value is of promise type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Promise value
* @returns Returns true if the value is a built-in Promise.
*/
isPromise(value: Object): boolean;
/**
* Check whether the value entered is of proxy type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Proxy value
* @returns Returns true if the value is a Proxy instance.
*/
isProxy(value: Object): boolean;
/**
* Check whether the entered value is of type regexp.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A regular expression object value
* @returns Returns true if the value is a regular expression object.
*/
isRegExp(value: Object): boolean;
/**
* Check whether the entered value is of type set.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Set instance value
* @returns Returns true if the value is a built-in Set instance.
*/
isSet(value: Object): boolean;
/**
* Check whether the entered value is the iterator type of set.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Set iterator value
* @returns Returns true if the value is an iterator returned for a built-in Set instance.
*/
isSetIterator(value: Object): boolean;
/**
* Check whether the entered value is of type sharedarraybuffer.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A SharedArrayBuffer instance value
* @returns Returns true if the value is a built-in SharedArrayBuffer instance. This does not include ArrayBuffer instances. Usually, it is desirable to test for both; See isAnyArrayBuffer() for that.
*/
isSharedArrayBuffer(value: Object): boolean;
/**
* Check whether the entered value is a string object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A String object value
* @returns Returns true if the value is a string object, e.g. created by new String().
*/
isStringObject(value: Object): boolean;
/**
* Check whether the entered value is a symbol object type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A symbol object value
* @returns Returns true if the value is a symbol object, created by calling Object() on a Symbol primitive.
*/
isSymbolObject(value: Object): boolean;
/**
* Check whether the entered value is a type contained in typedarray.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A TypedArray instance value
* @returns Returns true if the value is a built-in TypedArray instance.
*/
isTypedArray(value: Object): boolean;
/**
* Check whether the entered value is the uint8array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Uint8Array value
* @returns Returns true if the value is a built-in Uint8Array instance.
*/
isUint8Array(value: Object): boolean;
/**
* Check whether the entered value is the uint8clapedarray array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Uint8ClampedArray value
* @returns Returns true if the value is a built-in Uint8ClampedArray instance.
*/
isUint8ClampedArray(value: Object): boolean;
/**
* Check whether the entered value is the uint16array array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Uint16Array value
* @returns Returns true if the value is a built-in Uint16Array instance.
*/
isUint16Array(value: Object): boolean;
/**
* Check whether the entered value is the uint32array array type.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A Uint32Array value
* @returns Returns true if the value is a built-in Uint32Array instance.
*/
isUint32Array(value: Object): boolean;
/**
* Check whether the entered value is of type weakmap.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A WeakMap value
* @returns Returns true if the value is a built-in WeakMap instance.
*/
isWeakMap(value: Object): boolean;
/**
* Check whether the entered value is of type weakset.
* @crossplatform
* @since 8
* @syscap SystemCapability.Utils.Lang
* @param value A WeakSet value
* @returns Returns true if the value is a built-in WeakSet instance.
*/
isWeakSet(value: Object): boolean;
}
}
export default util;