> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...
...
@@ -23,15 +23,15 @@ Prints the input content in a formatted string.
| string | Detailed information about the error code.|
| Type | Description |
| -------- | -------- |
| string | Detailed information about the error code. |
**Example**
```js
...
...
@@ -76,14 +76,14 @@ Calls back an asynchronous function. In the callback, the first parameter indica
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| original | Function | Yes| Asynchronous function.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| original | Function | Yes | Asynchronous function. |
**Return value**
| Type| Description|
| -------- | -------- |
| Function | Callback, in which the first parameter indicates the cause of the rejection (the value is **null** if the promise has been resolved) and the second parameter indicates the resolved value.|
| Type | Description |
| -------- | -------- |
| Function | Callback, in which the first parameter indicates the cause of the rejection (the value is **null** if the promise has been resolved) and the second parameter indicates the resolved value. |
**Example**
```js
...
...
@@ -107,14 +107,14 @@ Processes an asynchronous function and returns a promise version.
| ignoreBOM | boolean | Yes| No| Whether to ignore the byte order marker (BOM). The default value is **false**, which indicates that the result contains the BOM.|
| Name | Type | Readable | Writable | Description |
| fatal | boolean | Yes | No | Whether to display fatal errors. |
| ignoreBOM | boolean | Yes | No | Whether to ignore the byte order marker (BOM). The default value is **false**, which indicates that the result contains the BOM. |
### constructor
...
...
@@ -154,17 +154,17 @@ A constructor used to create a **TextDecoder** object.
| options | Object | No | Options related to decoding. |
**Table 2** options
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| stream | boolean | No| Whether to allow data blocks in subsequent **decode()**. If data is processed in blocks, set this parameter to **true**. If this is the last data block to process or data is not divided into blocks, set this parameter to **false**. The default value is **false**.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| stream | boolean | No | Whether to allow data blocks in subsequent **decode()**. If data is processed in blocks, set this parameter to **true**. If this is the last data block to process or data is not divided into blocks, set this parameter to **false**. The default value is **false**. |
| another | RationalNumber | Yes| Object used to compare with this **RationalNumber** object.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| another | RationalNumber | Yes | Object used to compare with this **RationalNumber** object. |
**Return value**
| Type| Description|
| -------- | -------- |
| number | Returns **0** if the two objects are equal; returns **1** if the given object is less than this object; return **-1** if the given object is greater than this object.|
| Type | Description |
| -------- | -------- |
| number | Returns **0** if the two objects are equal; returns **1** if the given object is less than this object; return **-1** if the given object is greater than this object. |
**Example**
...
...
@@ -378,9 +378,9 @@ Obtains the value of this **RationalNumber** object as an integer or a floating-
| boolean | Returns **true** if this **RationalNumber** object represents a finite value (the denominator is not **0**); returns **false** otherwise.|
| Type | Description |
| -------- | -------- |
| boolean | Returns **true** if this **RationalNumber** object represents a finite value (the denominator is not **0**); returns **false** otherwise. |
**Example**
```js
...
...
@@ -551,9 +551,9 @@ Obtains the string representation of this **RationalNumber** object.
| string | Returns **NaN** if the numerator and denominator of this object are both **0**; returns a string in Numerator/Denominator format otherwise, for example, **3/5**.|
| Type | Description |
| -------- | -------- |
| string | Returns **NaN** if the numerator and denominator of this object are both **0**; returns a string in Numerator/Denominator format otherwise, for example, **3/5**. |
**Example**
```js
...
...
@@ -567,9 +567,9 @@ Obtains the string representation of this **RationalNumber** object.
| key | K | Yes| Key of the key-value pair to add.|
| value | V | Yes| Value of the key-value pair to add.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| key | K | Yes | Key of the key-value pair to add. |
| value | V | Yes | Value of the key-value pair to add. |
**Return value**
| Type| Description|
| -------- | -------- |
| V | Returns the existing value if the key already exists; returns the value added otherwise. If the key or value is null, an exception will be thrown. |
| Type | Description |
| -------- | -------- |
| V | Returns the existing value if the key already exists; returns the value added otherwise. If the key or value is null, an exception will be thrown. |
**Example**
```js
...
...
@@ -870,9 +870,9 @@ Obtains all values in this buffer, listed from the most to the least recently ac
| V \| undefind | Returns an **Optional** object containing the removed key-value pair if the key exists in the buffer; returns an empty **Optional** object otherwise. If the key is null, an exception will be thrown.|
| Type | Description |
| -------- | -------- |
| V \ | undefind | Returns an **Optional** object containing the removed key-value pair if the key exists in the buffer; returns an empty **Optional** object otherwise. If the key is null, an exception will be thrown. |
**Example**
```js
...
...
@@ -940,12 +940,12 @@ Performs subsequent operations after a value is removed.
| isEvict | boolean | No| Whether the buffer capacity is insufficient. If the value is **true**, this method is called due to insufficient capacity.|
| key | K | Yes| Key removed.|
| value | V | Yes| Value removed.|
| newValue | V | No| New value for the key if the **put()** method is called and the key to be added already exists. In other cases, this parameter is left blank.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| isEvict | boolean | No | Whether the buffer capacity is insufficient. If the value is **true**, this method is called due to insufficient capacity. |
| key | K | Yes | Key removed. |
| value | V | Yes | Value removed. |
| newValue | V | No | New value for the key if the **put()** method is called and the key to be added already exists. In other cases, this parameter is left blank. |
**Example**
```js
...
...
@@ -985,14 +985,14 @@ Checks whether this buffer contains the specified key.
| value | [ScopeType](#scopetype8) | Yes| Value specified.|
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| value | [ScopeType](#scopetype8) | Yes | Value specified. |
**Return value**
| Type| Description|
| -------- | -------- |
| [ScopeType](#scopetype8) | Returns **lowerObj** if the specified value is less than the lower limit; returns **upperObj** if the specified value is greater than the upper limit; returns the specified value if it is within this **Scope**.|
| Type | Description |
| -------- | -------- |
| [ScopeType](#scopetype8) | Returns **lowerObj** if the specified value is less than the lower limit; returns **upperObj** if the specified value is greater than the upper limit; returns the specified value if it is within this **Scope**. |
**Example**
```js
...
...
@@ -1456,14 +1456,14 @@ Encodes the input content.