未验证 提交 9ba9bae4 编写于 作者: O openharmony_ci 提交者: Gitee

!10553 翻译完成:10317+10328 js-apis-url.md+js-apis-Context.md

Merge pull request !10553 from wusongqing/TR10317
......@@ -27,8 +27,8 @@ If this API is called for the first time, a root directory will be created.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | -------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the local root directory.|
**Example**
......@@ -56,7 +56,7 @@ If this API is called for the first time, a root directory will be created.
**Return value**
| Type | Description |
| ---------------- | ----------- |
| ---------------- | ---------------------- |
| Promise\<string> | Promise used to return the local root directory.|
**Example**
......@@ -81,8 +81,8 @@ Verifies whether a specific PID and UID have the given permission. This API uses
**Parameters**
| Name | Type | Mandatory | Description |
| ---------- | --------------------------------------- | ---- | -------------------- |
| Name | Type | Mandatory| Description |
| ---------- | --------------------------------------- | ---- | ------------------------------------- |
| permission | string | Yes | Name of the permission to verify. |
| options | [PermissionOptions](#permissionoptions) | Yes | Permission options. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.|
......@@ -110,8 +110,8 @@ Verifies whether the current PID and UID have the given permission. This API use
**Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ---------------------- | ---- | -------------------- |
| Name | Type | Mandatory| Description |
| ---------- | ---------------------- | ---- | ------------------------------------- |
| permission | string | Yes | Name of the permission to verify. |
| callback | AsyncCallback\<number> | Yes | Callback used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.|
......@@ -133,15 +133,15 @@ Verifies whether a specific PID and UID have the given permission. This API uses
**Parameters**
| Name | Type | Mandatory | Description |
| ---------- | --------------------------------------- | ---- | -------- |
| Name | Type | Mandatory| Description |
| ---------- | --------------------------------------- | ---- | ---------------- |
| permission | string | Yes | Name of the permission to verify.|
| options | [PermissionOptions](#permissionoptions) | No | Permission options. |
**Return value**
| Type | Description |
| ---------------- | ---------------------------------- |
| ---------------- | ----------------------------------------------------------- |
| Promise\<number> | Promise used to return the permission verification result. The value **0** means that the PID and UID have the given permission, and the value **-1** means the opposite.|
**Example**
......@@ -168,8 +168,8 @@ Requests certain permissions from the system. This API uses an asynchronous call
**Parameters**
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | ----------------------------------- |
| Name | Type | Mandatory| Description |
| -------------- | ------------------------------------------------------------ | ---- | ----------------------------------------------- |
| permissions | Array\<string> | Yes | Permissions to request. This parameter cannot be **null**. |
| requestCode | number | Yes | Request code to be passed to **PermissionRequestResult**.|
| resultCallback | AsyncCallback<[PermissionRequestResult](#permissionrequestresult)> | Yes | Callback used to return the permission request result. |
......@@ -242,8 +242,8 @@ Obtains information about the current application. This API uses an asynchronous
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ------------------------------- | ---- | ------------ |
| Name | Type | Mandatory| Description |
| -------- | ------------------------------- | ---- | ------------------------ |
| callback | AsyncCallback\<ApplicationInfo> | Yes | Callback used to return the application information.|
**Example**
......@@ -267,7 +267,7 @@ Obtains information about the current application. This API uses a promise to re
**Return value**
| Type | Description |
| ------------------------- | --------- |
| ------------------------- | ------------------ |
| Promise\<ApplicationInfo> | Promise used to return the application information.|
**Example**
......@@ -293,8 +293,8 @@ Obtains the bundle name of this ability. This API uses an asynchronous callback
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------ |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ----------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.|
**Example**
......@@ -318,7 +318,7 @@ Obtains the bundle name of this ability. This API uses a promise to return the r
**Return value**
| Type | Description |
| ---------------- | ---------------- |
| ---------------- | ------------------------- |
| Promise\<string> | Promise used to return the bundle name.|
**Example**
......@@ -344,8 +344,8 @@ Obtains information about the current process, including the PID and process nam
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | ---------- |
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | -------------------- |
| callback | AsyncCallback\<ProcessInfo> | Yes | Callback used to return the process information.|
**Example**
......@@ -369,7 +369,7 @@ Obtains information about the current process, including the PID and process nam
**Return value**
| Type | Description |
| --------------------- | ------- |
| --------------------- | -------------- |
| Promise\<ProcessInfo> | Promise used to return the process information.|
**Example**
......@@ -397,8 +397,8 @@ This API is available only to Page abilities.
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | --------------------------- | ---- | -------------------------------------- |
| Name | Type | Mandatory| Description |
| -------- | --------------------------- | ---- | ---------------------------------------------- |
| callback | AsyncCallback\<ElementName> | Yes | Callback used to return the **ohos.bundle.ElementName** object.|
**Example**
......@@ -424,7 +424,7 @@ This API is available only to Page abilities.
**Return value**
| Type | Description |
| --------------------- | ------------------------------------ |
| --------------------- | ------------------------------------------ |
| Promise\<ElementName> | Promise used to return the **ohos.bundle.ElementName** object.|
**Example**
......@@ -448,8 +448,8 @@ Obtains the name of the current process. This API uses an asynchronous callback
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ---------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | -------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the process name.|
**Example**
......@@ -473,7 +473,7 @@ Obtains the name of the current process. This API uses a promise to return the r
**Return value**
| Type | Description |
| ---------------- | ---------- |
| ---------------- | -------------------- |
| Promise\<string> | Promise used to return the process name.|
**Example**
......@@ -499,8 +499,8 @@ Obtains the bundle name of the calling ability. This API uses an asynchronous ca
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ---------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the bundle name.|
**Example**
......@@ -524,7 +524,7 @@ Obtains the bundle name of the calling ability. This API uses a promise to retur
**Return value**
| Type | Description |
| ---------------- | -------------- |
| --------------- | ------------------------- |
| Promise\<string> | Promise used to return the bundle name.|
**Example**
......@@ -548,8 +548,8 @@ Obtains the cache directory of the application in the internal storage. This API
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | --------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the cache directory.|
**Example**
......@@ -577,7 +577,7 @@ Obtains the cache directory of the application in the internal storage. This API
**Return value**
| Type | Description |
| ---------------- | --------------- |
| --------------- | ------------------------- |
| Promise\<string> | Promise used to return the cache directory.|
**Example**
......@@ -601,8 +601,8 @@ Obtains the file directory of the application in the internal storage. This API
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the file directory.|
**Example**
......@@ -630,7 +630,7 @@ Obtains the file directory of the application in the internal storage. This API
**Return value**
| Type | Description |
| ---------------- | ------------------- |
| --------------- | ------------------------- |
| Promise\<string> | Promise used to return the file directory.|
**Example**
......@@ -656,8 +656,8 @@ If the distributed file path does not exist, the system will create one and retu
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ---------------------------------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the distributed file path. If the distributed file path does not exist, the system will create one and return the created path.|
**Example**
......@@ -687,7 +687,7 @@ If the distributed file path does not exist, the system will create one and retu
**Return value**
| Type | Description |
| ---------------- | ----------------------------------- |
| --------------- | ------------------------- |
| Promise\<string> | Promise used to return the distributed file path. If this API is called for the first time, a new path will be created.|
**Example**
......@@ -710,8 +710,8 @@ Obtains the application type. This API uses an asynchronous callback to return t
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | -------------------------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<string> | Yes | Callback used to return the application type.|
**Example**
......@@ -739,7 +739,7 @@ Obtains the application type. This API uses a promise to return the result.
**Return value**
| Type | Description |
| ---------------- | ------------------ |
| --------------- | ------------------------- |
| Promise\<string> | Promise used to return the application type.|
**Example**
......@@ -762,8 +762,8 @@ Obtains the **ModuleInfo** object of the application. This API uses an asynchron
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------------------- |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<[HapModuleInfo](#hapmoduleinfo)> | Yes | Callback used to return the **ModuleInfo** object.|
**Example**
......@@ -791,7 +791,7 @@ Obtains the **ModuleInfo** object of the application. This API uses a promise to
**Return value**
| Type | Description |
| ---------------------------------------- | ------------------ |
| --------------- | ------------------------- |
| Promise\<[HapModuleInfo](#hapmoduleinfo)> | Promise used to return the **ModuleInfo** object.|
**Example**
......@@ -814,8 +814,8 @@ Obtains the version information of the application. This API uses an asynchronou
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<[AppVersionInfo](#appversioninfo)> | Yes | Callback used to return the version information.|
**Example**
......@@ -843,7 +843,7 @@ Obtains the version information of the application. This API uses a promise to r
**Return value**
| Type | Description |
| ---------------------------------------- | --------- |
| --------------- | ------------------------- |
| Promise\<[AppVersionInfo](#appversioninfo)> | Promise used to return the version information.|
**Example**
......@@ -866,9 +866,9 @@ Obtains information about this ability. This API uses an asynchronous callback t
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------------------- |
| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes | Callback used to return the ability information.|
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------- |
| callback | AsyncCallback\<[AbilityInfo](#abilityInfo)> | Yes |Callback used to return the ability information.|
**Example**
......@@ -895,7 +895,7 @@ Obtains information about this ability. This API uses a promise to return the re
**Return value**
| Type | Description |
| ---------------------------------------- | ------------------ |
| --------------- | ------------------------- |
| Promise\<[AbilityInfo](#abilityInfo)> | Promise used to return the ability information.|
**Example**
......@@ -919,8 +919,8 @@ Obtains the context of the application.
**Return value**
| Type | Description |
| ------- | ---------- |
| Context | Application context.|
| --------- |------ |
| Context |Application context.|
**Example**
......@@ -929,12 +929,59 @@ import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext().getApplicationContext();
```
## Context.getExternalCacheDir
getExternalCacheDir(callback: AsyncCallback\<string>): void
Obtains the external cache directory of the application. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------- | ---- | ------------------ |
| callback | AsyncCallback\<string> | Yes | Callback used to return the absolute path of the cache directory.|
**Example**
```js
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext();
context.getExternalCacheDir()
```
## Context.getExternalCacheDir
getExternalCacheDir(): Promise\<string>;
Obtains the external cache directory of the application. This API uses a promise to return the result.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
**Return value**
| Type | Description |
| ---------------- | ---------------- |
| Promise\<string> | Promise used to return the absolute path of the cache directory.|
**Example**
```js
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext();
context.getExternalCacheDir().then((data) => {
console.info("=======================>getExternalCacheDirCallback====================>");
console.info("====>data====>" + JSON.stringify(data));
});
```
## PermissionOptions
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Readable/Writable| Type | Mandatory | Description |
| ---- | ---- | ------ | ---- | ----- |
| Name| Readable/Writable| Type | Mandatory| Description |
| ---- | -------- | ------ | ---- | ------ |
| pid | Read-only | number | No | Process ID.|
| uid | Read-only | number | No | User ID.|
......@@ -942,8 +989,8 @@ var context = featureAbility.getContext().getApplicationContext();
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
| Name | Readable/Writable| Type | Mandatory | Description |
| ----------- | ---- | -------------- | ---- | ---------- |
| Name | Readable/Writable| Type | Mandatory| Description |
| ----------- | -------- | -------------- | ---- | ------------------ |
| requestCode | Read-only | number | Yes | Request code passed.|
| permissions | Read-only | Array\<string> | Yes | Permissions requested. |
| authResults | Read-only | Array\<number> | Yes | Permission request result. |
......@@ -952,8 +999,8 @@ var context = featureAbility.getContext().getApplicationContext();
Describes the HAP module information.
| Name | Type | Readable | Writable | Description |
| ---------------- | ------------------- | -------- | -------- | ----------------------------------------- |
| Name | Type| Readable| Writable| Description|
| ------ | ------ | ------ | ------ | ------ |
| name | string | Yes | No | Module name. |
| description | string | Yes | No | Module description. |
| descriptionId | number | Yes | No | Module description ID. |
......@@ -963,19 +1010,18 @@ Describes the HAP module information.
| iconId | number | Yes | No | Module icon ID. |
| backgroundImg | string | Yes | No | Module background image. |
| supportedModes | number | Yes | No | Running modes supported by the module. |
| reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running. |
| deviceTypes | Array\<string> | Yes | No | Device types supported by the module. |
| reqCapabilities | Array\<string> | Yes | No | Capabilities required for module running.|
| deviceTypes | Array\<string> | Yes | No | Device types supported by the module.|
| abilityInfo | Array\<AbilityInfo> | Yes | No | Ability information. |
| moduleName | string | Yes | No | Module name. |
| mainAbilityName | string | Yes | No | Name of the main ability. |
| installationFree | boolean | Yes | No | Whether installation-free is supported. |
| mainElementName | string | Yes | No | Information about the main ability. |
| mainElementName | string | Yes| No| Information about the main ability.|
## AppVersionInfo
| Name | Type | Readable | Writable | Description |
| ----------- | ------ | ---- | ---- | ------- |
| Name | Type| Readable | Writable | Description|
| ------ | ------ | ------| ------ | ------ |
| appName | string | Yes | No | Module name. |
| versionCode | number | Yes | No | Module description.|
| versionName | string | Yes | No | Module description ID.|
| versionCode | number | Yes | No | Module description. |
| versionName | string | Yes | No | Module description ID. |
......@@ -26,16 +26,16 @@ Creates a **URLSearchParams** instance.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| init | string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams | No| Input parameter objects, which include the following:<br>- **string[][]**: two-dimensional string array<br>- **Record&lt;string, string&gt;**: list of objects<br>- **string**: string<br>- **URLSearchParams**: object |
| init | string[][] \| Record&lt;string, string&gt; \| string \| URLSearchParams | No| Input parameter objects, which include the following:<br>- **string[][]**: two-dimensional string array<br>- **Record&lt;string, string&gt;**: list of objects<br>- **string**: string<br>- **URLSearchParams**: object|
**Example**
```js
var objectParams = new Url.URLSearchParams([ ['user1', 'abc1'], ['query2', 'first2'], ['query3', 'second3'] ]);
var objectParams1 = new Url.URLSearchParams({"fod" : 1 , "bard" : 2});
var objectParams2 = new Url.URLSearchParams('?fod=1&bard=2');
var urlObject = new Url.URL('https://developer.mozilla.org/?fod=1&bard=2');
var params = new Url.URLSearchParams(urlObject.search);
let objectParams = new Url.URLSearchParams([ ['user1', 'abc1'], ['query2', 'first2'], ['query3', 'second3'] ]);
let objectParams1 = new Url.URLSearchParams({"fod" : '1' , "bard" : '2'});
let objectParams2 = new Url.URLSearchParams('?fod=1&bard=2');
let urlObject = new Url.URL('https://developer.mozilla.org/?fod=1&bard=2');
let params = new Url.URLSearchParams(urlObject.search);
```
......@@ -59,7 +59,7 @@ Appends a key-value pair into the query string.
```js
let urlObject = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new Url.URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3);
paramsObject.append('fod', '3');
```
......@@ -110,9 +110,9 @@ Obtains all the key-value pairs based on the specified key.
```js
let urlObject = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new Url.URLSearchParams(urlObject.search.slice(1));
paramsObject.append('fod', 3); // Add a second value for the fod parameter.
console.log(params.getAll('fod')) // Output ["1","3"].
let params = new Url.URLSearchParams(urlObject.search.slice(1));
params.append('fod', '3'); // Add a second value for the fod parameter.
console.log(params.getAll('fod').toString()) // Output ["1","3"].
```
......@@ -133,7 +133,7 @@ Obtains an ES6 iterator. Each item of the iterator is a JavaScript array, and th
**Example**
```js
var searchParamsObject = new Url.URLSearchParams("keyName1=valueName1&keyName2=valueName2");
let searchParamsObject = new Url.URLSearchParams("keyName1=valueName1&keyName2=valueName2");
for (var pair of searchParamsObject .entries()) { // Show keyName/valueName pairs
console.log(pair[0]+ ', '+ pair[1]);
}
......@@ -192,15 +192,14 @@ Obtains the value of the first key-value pair based on the specified key.
| Type | Description |
| -------- | -------- |
| string | Returns the value of the first key-value pair if obtained. |
| null | Returns null if no value is obtained. |
| null | Returns **null** if no value is obtained.|
**Example**
```js
var paramsOject = new Url.URLSearchParams(document.location.search.substring(1));
var name = paramsOject.get("name"); // is the string "Jonathan"
var age = parseInt(paramsOject.get("age"), 10); // is the number 18
var address = paramsOject.get("address"); // null
let paramsObject = new Url.URLSearchParams('name=Jonathan&age=18');
let name = paramsObject.get("name"); // is the string "Jonathan"
let age = parseInt(paramsObject.get("age"), 10); // is the number 18
```
......@@ -253,7 +252,7 @@ Sets the value for a key. If key-value pairs matching the specified key exist, t
```js
let urlObject = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2');
let paramsObject = new Url.URLSearchParams(urlObject.search.slice(1));
paramsObject.set('baz', 3); // Add a third parameter.
paramsObject.set('baz', '3'); // Add a third parameter.
```
......@@ -268,7 +267,7 @@ Sorts all key-value pairs contained in this object based on the Unicode code poi
**Example**
```js
var searchParamsObject = new Url.URLSearchParams("c=3&a=9&b=4&d=2"); // Create a test URLSearchParams object
let searchParamsObject = new Url.URLSearchParams("c=3&a=9&b=4&d=2"); // Create a test URLSearchParams object
searchParamsObject.sort(); // Sort the key/value pairs
console.log(searchParamsObject.toString()); // Display the sorted query string // Output a=9&b=2&c=3&d=4
```
......@@ -291,7 +290,7 @@ Obtains an ES6 iterator that contains the keys of all the key-value pairs.
**Example**
```js
var searchParamsObject = new Url.URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
let searchParamsObject = new Url.URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
for (var key of searchParamsObject .keys()) { // Output key-value pairs
console.log(key);
}
......@@ -315,7 +314,7 @@ Obtains an ES6 iterator that contains the values of all the key-value pairs.
**Example**
```js
var searchParams = new Url.URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
let searchParams = new Url.URLSearchParams("key1=value1&key2=value2"); // Create a URLSearchParamsObject object for testing
for (var value of searchParams.values()) {
console.log(value);
}
......@@ -365,7 +364,7 @@ Obtains search parameters that are serialized as a string and, if necessary, per
```js
let url = new Url.URL('https://developer.exampleUrl/?fod=1&bard=2');
let params = new Url.URLSearchParams(url.search.slice(1));
params.append('fod', 3);
params.append('fod', '3');
console.log(params.toString());
```
......@@ -405,16 +404,16 @@ Creates a URL.
| Name | Type | Mandatory | Description |
| -------- | -------- | -------- | -------- |
| url | string | Yes | Input object. |
| base | string \ |& URL | No | Input parameter, which can be any of the following:<br>- **string**: string<br>- **URL**: string or object |
| base | string \| URL | No| Input parameter, which can be any of the following:<br>- **string**: string<br>- **URL**: string or object|
**Example**
```js
var mm = 'http://username:password@host:8080';
var a = new Url.URL("/", mm); // Output 'http://username:password@host:8080/';
var b = new Url.URL(mm); // Output 'http://username:password@host:8080/';
let mm = 'http://username:password@host:8080';
let a = new Url.URL("/", mm); // Output 'http://username:password@host:8080/';
let b = new Url.URL(mm); // Output 'http://username:password@host:8080/';
new Url.URL('path/path1', b); // Output 'http://username:password@host:8080/path/path1';
var c = new Url.URL('/path/path1', b); // Output 'http://username:password@host:8080/path/path1';
let c = new Url.URL('/path/path1', b); // Output 'http://username:password@host:8080/path/path1';
new Url.URL('/path/path1', c); // Output 'http://username:password@host:8080/path/path1';
new Url.URL('/path/path1', a); // Output 'http://username:password@host:8080/path/path1';
new Url.URL('/path/path1', "https://www.exampleUrl/fr-FR/toto"); // Output https://www.exampleUrl/path/path1
......@@ -443,7 +442,7 @@ Converts the parsed URL into a string.
```js
const url = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toString()
url.toString();
```
......@@ -464,5 +463,5 @@ Converts the parsed URL into a JSON string.
**Example**
```js
const url = new Url.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da');
url.toJSON()
url.toJSON();
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册