mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-11-27 01:11:35 +00:00
update uitl worker buffer convertxml process taskpool uri url xml base d.ts
Signed-off-by: Wang <JWWANGAW@isoftstone.com> https://gitee.com/openharmony/interface_sdk-js/issues/I8G44I
This commit is contained in:
parent
3d358efc2d
commit
9fa229a2f1
73
api/@ohos.base.d.ts
vendored
73
api/@ohos.base.d.ts
vendored
@ -26,6 +26,14 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the basic callback.
|
||||
* @typedef Callback
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
export interface Callback<T> {
|
||||
/**
|
||||
* Defines the callback info.
|
||||
@ -40,6 +48,14 @@ export interface Callback<T> {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the callback info.
|
||||
* @param { T } data
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
(data: T): void;
|
||||
}
|
||||
|
||||
@ -56,6 +72,14 @@ export interface Callback<T> {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the basic error callback.
|
||||
* @typedef ErrorCallback
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
export interface ErrorCallback<T extends Error = BusinessError> {
|
||||
/**
|
||||
* Defines the basic error callback.
|
||||
@ -70,6 +94,14 @@ export interface ErrorCallback<T extends Error = BusinessError> {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the basic error callback.
|
||||
* @param { T } err
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
(err: T): void;
|
||||
}
|
||||
|
||||
@ -86,6 +118,14 @@ export interface ErrorCallback<T extends Error = BusinessError> {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the basic async callback.
|
||||
* @typedef AsyncCallback
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
export interface AsyncCallback<T, E = void> {
|
||||
/**
|
||||
* Defines the callback data.
|
||||
@ -102,6 +142,15 @@ export interface AsyncCallback<T, E = void> {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the callback data.
|
||||
* @param { BusinessError<E> } err
|
||||
* @param { T } data
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
(err: BusinessError<E>, data: T): void;
|
||||
}
|
||||
|
||||
@ -118,6 +167,14 @@ export interface AsyncCallback<T, E = void> {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the error interface.
|
||||
* @typedef BusinessError
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
export interface BusinessError<T = void> extends Error {
|
||||
/**
|
||||
* Defines the basic error code.
|
||||
@ -132,6 +189,14 @@ export interface BusinessError<T = void> extends Error {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the basic error code.
|
||||
* @type { number } code
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
code: number;
|
||||
/**
|
||||
* Defines the additional information for business
|
||||
@ -146,5 +211,13 @@ export interface BusinessError<T = void> extends Error {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Defines the additional information for business
|
||||
* @type { ?T } data
|
||||
* @syscap SystemCapability.Base
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
data?: T;
|
||||
}
|
||||
|
1073
api/@ohos.buffer.d.ts
vendored
1073
api/@ohos.buffer.d.ts
vendored
File diff suppressed because it is too large
Load Diff
182
api/@ohos.convertxml.d.ts
vendored
182
api/@ohos.convertxml.d.ts
vendored
@ -28,6 +28,15 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The convertxml module provides utilities for converting XML text to Javascript object.
|
||||
*
|
||||
* @namespace xml
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declare namespace xml {
|
||||
interface ConvertOptions {
|
||||
/**
|
||||
@ -43,6 +52,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to trim whitespace characters that may exist before and after the text, default false.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
trim: boolean;
|
||||
/**
|
||||
* Whether to ignore writing declaration directives of xml.
|
||||
@ -57,6 +74,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore writing declaration directives of xml.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreDeclaration?: boolean;
|
||||
/**
|
||||
* Whether to ignore writing processing instruction of xml.
|
||||
@ -71,6 +96,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore writing processing instruction of xml.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreInstruction?: boolean;
|
||||
/**
|
||||
* Whether to print attributes across multiple lines and indent them.
|
||||
@ -85,6 +118,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to print attributes across multiple lines and indent them.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreAttributes?: boolean;
|
||||
/**
|
||||
* Whether to ignore writing comments of the elements.
|
||||
@ -99,6 +140,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore writing comments of the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreComment?: boolean;
|
||||
/**
|
||||
* Whether to ignore writing CDATA of the elements.
|
||||
@ -113,6 +162,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore writing CDATA of the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreCDATA?: boolean;
|
||||
/**
|
||||
* Whether to ignore writing Doctype of the elements.
|
||||
@ -127,6 +184,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore writing Doctype of the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreDoctype?: boolean;
|
||||
/**
|
||||
* Whether to ignore writing texts of the elements.
|
||||
@ -141,6 +206,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore writing texts of the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreText?: boolean;
|
||||
/**
|
||||
* Name of the property key which will be used for the declaration.
|
||||
@ -155,6 +228,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the declaration.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declarationKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the processing instruction.
|
||||
@ -169,6 +250,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the processing instruction.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
instructionKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the attributes.
|
||||
@ -183,6 +272,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the attributes.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
attributesKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the text.
|
||||
@ -197,6 +294,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the text.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
textKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the cdata.
|
||||
@ -211,6 +316,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the cdata.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
cdataKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the doctype.
|
||||
@ -225,6 +338,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the doctype.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
doctypeKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the comment.
|
||||
@ -239,6 +360,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the comment.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
commentKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the parent.
|
||||
@ -253,6 +382,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the parent.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
parentKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the type.
|
||||
@ -267,6 +404,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the type.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
typeKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the name.
|
||||
@ -281,6 +426,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the name.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
nameKey: string;
|
||||
/**
|
||||
* Name of the property key which will be used for the elements.
|
||||
@ -295,6 +448,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Name of the property key which will be used for the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
elementsKey: string;
|
||||
}
|
||||
|
||||
@ -313,6 +474,14 @@ declare namespace xml {
|
||||
* @since 10
|
||||
* @name ConvertXML
|
||||
*/
|
||||
/**
|
||||
* ConvertXML representation refers to extensible markup language.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
class ConvertXML {
|
||||
/**
|
||||
* To convert XML text to JavaScript object.
|
||||
@ -350,6 +519,19 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* To convert XML text to JavaScript object.
|
||||
*
|
||||
* @param { string } xml - xml xml The xml text to be converted.
|
||||
* @param { ConvertOptions } options - options option Option Inputted by user to set.
|
||||
* @returns { Object } Returns a JavaScript object converting from XML text.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200002 - Invalid xml string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
convertToJSObject(xml: string, options?: ConvertOptions): Object;
|
||||
}
|
||||
}
|
||||
|
184
api/@ohos.process.d.ts
vendored
184
api/@ohos.process.d.ts
vendored
@ -30,6 +30,16 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The process is mainly used to obtain the relevant ID of the process, obtain and modify
|
||||
* the working directory of the process, exit and close the process.
|
||||
*
|
||||
* @namespace process
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declare namespace process {
|
||||
/**
|
||||
* The childprocess object can be used to create a new process.
|
||||
@ -153,6 +163,16 @@ declare namespace process {
|
||||
* @since 10
|
||||
* @name ProcessManager
|
||||
*/
|
||||
/**
|
||||
* Process is mainly used to obtain the relevant ID of the process, obtain and modify the
|
||||
* working directory of the process, exit and close the process.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
* @name ProcessManager
|
||||
*/
|
||||
export class ProcessManager {
|
||||
/**
|
||||
* Returns a boolean whether the specified uid belongs to a particular application.
|
||||
@ -173,6 +193,17 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns a boolean whether the specified uid belongs to a particular application.
|
||||
*
|
||||
* @param { number } v - An id.
|
||||
* @returns { boolean } Return a boolean whether the specified uid belongs to a particular application.
|
||||
* @throws { BusinessError } 401 - The type of v must be number.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
isAppUid(v: number): boolean;
|
||||
|
||||
/**
|
||||
@ -194,6 +225,17 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the uid based on the specified user name.
|
||||
*
|
||||
* @param { string } v - Process name.
|
||||
* @returns { number } Return the uid based on the specified user name.
|
||||
* @throws { BusinessError } 401 - The type of v must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getUidForName(v: string): number;
|
||||
|
||||
/**
|
||||
@ -215,6 +257,17 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the thread priority based on the specified tid.
|
||||
*
|
||||
* @param { number } v - The tid of the process.
|
||||
* @returns { number } Return the thread priority based on the specified tid.
|
||||
* @throws { BusinessError } 401 - The type of v must be number.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getThreadPriority(v: number): number;
|
||||
|
||||
/**
|
||||
@ -236,6 +289,17 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the system configuration at runtime.
|
||||
*
|
||||
* @param { number } name - Parameters defined by the system configuration.
|
||||
* @returns { number } Return the system configuration at runtime.
|
||||
* @throws { BusinessError } 401 - The type of name must be number.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getSystemConfig(name: number): number;
|
||||
|
||||
/**
|
||||
@ -257,6 +321,17 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the system value for environment variables.
|
||||
*
|
||||
* @param { string } name - Parameters defined by the system environment variables.
|
||||
* @returns { string } Return the system value for environment variables.
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getEnvironmentVar(name: string): string;
|
||||
|
||||
/**
|
||||
@ -276,6 +351,16 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Process exit
|
||||
*
|
||||
* @param { number } code - Process exit code.
|
||||
* @throws { BusinessError } 401 - The type of code must be number.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
exit(code: number): void;
|
||||
|
||||
/**
|
||||
@ -299,6 +384,18 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Return whether the signal was sent successfully
|
||||
*
|
||||
* @param { number } signal - Signal sent.
|
||||
* @param { number } pid - Send signal to target pid.
|
||||
* @returns { boolean } Return the result of the signal.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
kill(signal: number, pid: number): boolean;
|
||||
}
|
||||
|
||||
@ -350,6 +447,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the digital user id of the process
|
||||
*
|
||||
* @constant
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
const uid: number;
|
||||
|
||||
/**
|
||||
@ -378,6 +484,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Return pid is The pid of the current process
|
||||
*
|
||||
* @constant
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
const pid: number;
|
||||
|
||||
/**
|
||||
@ -406,6 +521,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the tid of the current thread.
|
||||
*
|
||||
* @constant
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
const tid: number;
|
||||
|
||||
/**
|
||||
@ -415,6 +539,14 @@ declare namespace process {
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @since 8
|
||||
*/
|
||||
/**
|
||||
* Returns a boolean whether the process is isolated.
|
||||
*
|
||||
* @returns { boolean } Return boolean whether the process is isolated.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function isIsolatedProcess(): boolean;
|
||||
|
||||
/**
|
||||
@ -444,6 +576,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns a boolean whether the process is running in a 64-bit environment.
|
||||
*
|
||||
* @returns { boolean } Return a boolean whether the process is running in a 64-bit environment.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function is64Bit(): boolean;
|
||||
|
||||
/**
|
||||
@ -485,6 +626,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the elapsed real time (in milliseconds) taken from the start of the system to the start of the process.
|
||||
*
|
||||
* @returns { number } Return the start of the system to the start of the process.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function getStartRealtime(): number;
|
||||
|
||||
/**
|
||||
@ -502,6 +652,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the cpu time (in milliseconds) from the time when the process starts to the current time.
|
||||
*
|
||||
* @returns { number } Return the cpu time (in milliseconds) from the time when the process starts to the current time.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function getPastCpuTime(): number;
|
||||
|
||||
/**
|
||||
@ -541,6 +700,14 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* User Stored Events
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
type EventListener = (evt: Object) => void;
|
||||
|
||||
/**
|
||||
@ -618,6 +785,14 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Abort current process
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function abort(): void;
|
||||
|
||||
/**
|
||||
@ -692,6 +867,15 @@ declare namespace process {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the running time of the system
|
||||
*
|
||||
* @returns { number } Return the running time of the system.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function uptime(): number;
|
||||
|
||||
/**
|
||||
|
344
api/@ohos.taskpool.d.ts
vendored
344
api/@ohos.taskpool.d.ts
vendored
@ -28,6 +28,15 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* JS cross-thread task executor.
|
||||
*
|
||||
* @namespace taskpool
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declare namespace taskpool {
|
||||
/**
|
||||
* The Priority defines the task priority.
|
||||
@ -44,6 +53,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The Priority defines the task priority.
|
||||
*
|
||||
* @enum { number } Priority
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
enum Priority {
|
||||
/**
|
||||
* set task priority to high.
|
||||
@ -58,6 +76,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* set task priority to high.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
HIGH = 0,
|
||||
|
||||
/**
|
||||
@ -73,6 +99,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* set task priority to medium.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
MEDIUM = 1,
|
||||
|
||||
/**
|
||||
@ -88,6 +122,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* set task priority to low.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
LOW = 2
|
||||
}
|
||||
|
||||
@ -104,6 +146,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The Task class provides an interface to create a task.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
class Task {
|
||||
/**
|
||||
* Create a Task instance.
|
||||
@ -126,6 +176,18 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Create a Task instance.
|
||||
*
|
||||
* @param { Function } func - func func Concurrent function to execute in taskpool.
|
||||
* @param { unknown[] } args - args args The concurrent function arguments.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200014 - The function is not mark as concurrent.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor(func: Function, ...args: unknown[]);
|
||||
|
||||
/**
|
||||
@ -137,6 +199,16 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Check current running Task is canceled or not.
|
||||
*
|
||||
* @returns { boolean } Returns {@code true} if current running task is canceled; returns {@code false} otherwise.
|
||||
* @static
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
static isCanceled(): boolean;
|
||||
|
||||
/**
|
||||
@ -148,6 +220,16 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Set transfer list for this task.
|
||||
*
|
||||
* @param { ArrayBuffer[] } transfer - transfer Transfer list of this task, empty array is default.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setTransferList(transfer?: ArrayBuffer[]): void;
|
||||
|
||||
/**
|
||||
@ -163,6 +245,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Concurrent function to execute in taskpool.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function: Function;
|
||||
|
||||
/**
|
||||
@ -179,6 +269,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The concurrent function arguments.
|
||||
*
|
||||
* @type { ?unknown[] }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
arguments?: unknown[];
|
||||
}
|
||||
|
||||
@ -189,6 +288,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The TaskGroup class provides an interface to create a task group.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
class TaskGroup {
|
||||
/**
|
||||
* Create a TaskGroup instance.
|
||||
@ -197,6 +304,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Create a TaskGroup instance.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
@ -210,6 +325,18 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Add a Concurrent function into task group.
|
||||
*
|
||||
* @param { Function } func - func func Concurrent function to add in task group.
|
||||
* @param { unknown[] } args - args args The concurrent function arguments.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200014 - The function is not mark as concurrent.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
addTask(func: Function, ...args: unknown[]): void;
|
||||
|
||||
/**
|
||||
@ -222,6 +349,17 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Add a Task into TaskGroup.
|
||||
*
|
||||
* @param { Task } task - task task The task want to add in task group.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200014 - The function is not mark as concurrent.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
addTask(task: Task): void;
|
||||
}
|
||||
|
||||
@ -233,6 +371,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The State defines the task state.
|
||||
*
|
||||
* @enum { number } State
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
enum State {
|
||||
/**
|
||||
* the task state is waiting.
|
||||
@ -241,6 +388,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* the task state is waiting.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
WAITING = 1,
|
||||
|
||||
/**
|
||||
@ -250,6 +405,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* the task state is running.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
RUNNING = 2,
|
||||
|
||||
/**
|
||||
@ -259,6 +422,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* the task state is canceled.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
CANCELED = 3
|
||||
}
|
||||
|
||||
@ -269,6 +440,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Indicates the internal information of the worker thread.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
class TaskInfo {
|
||||
/**
|
||||
* Task identity.
|
||||
@ -279,6 +458,16 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Task identity.
|
||||
*
|
||||
* @type { number }
|
||||
* @default 0
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
taskId: number;
|
||||
|
||||
/**
|
||||
@ -290,6 +479,16 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Task state.
|
||||
*
|
||||
* @type { State }
|
||||
* @default State::WAITING
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
state: State;
|
||||
|
||||
/**
|
||||
@ -300,6 +499,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Duration of task execution.
|
||||
*
|
||||
* @type { ?number }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
@ -310,6 +518,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Indicates the internal information of the worker thread.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
class ThreadInfo {
|
||||
/**
|
||||
* Thread id.
|
||||
@ -320,6 +536,16 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Thread id.
|
||||
*
|
||||
* @type { number }
|
||||
* @default 0
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
tid: number;
|
||||
|
||||
/**
|
||||
@ -330,6 +556,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Task id list that running on current thread.
|
||||
*
|
||||
* @type { ?number[] }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
taskIds?: number[];
|
||||
|
||||
/**
|
||||
@ -340,6 +575,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Thread priority.
|
||||
*
|
||||
* @type { ?Priority }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
priority?: Priority;
|
||||
}
|
||||
|
||||
@ -350,6 +594,14 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Indicates the internal information of the taskpool.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
class TaskPoolInfo {
|
||||
/**
|
||||
* An array of taskpool thread information.
|
||||
@ -359,6 +611,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* An array of taskpool thread information.
|
||||
*
|
||||
* @type { ThreadInfo[] }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
threadInfos: ThreadInfo[];
|
||||
|
||||
/**
|
||||
@ -369,6 +630,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* An array of taskpool task information.
|
||||
*
|
||||
* @type { TaskInfo[] }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
taskInfos: TaskInfo[];
|
||||
}
|
||||
|
||||
@ -399,6 +669,21 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Execute a concurrent function.
|
||||
*
|
||||
* @param { Function } func - func func Concurrent function want to execute.
|
||||
* @param { unknown[] } args - args args The concurrent function arguments.
|
||||
* @returns { Promise<unknown> }
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200003 - Worker initialization failure.
|
||||
* @throws { BusinessError } 10200006 - An exception occurred during serialization.
|
||||
* @throws { BusinessError } 10200014 - The function is not mark as concurrent.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function execute(func: Function, ...args: unknown[]): Promise<unknown>;
|
||||
|
||||
/**
|
||||
@ -428,6 +713,21 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Execute a concurrent task.
|
||||
*
|
||||
* @param { Task } task - task task The task want to execute.
|
||||
* @param { Priority } priority - priority priority Task priority, MEDIUM is default.
|
||||
* @returns { Promise<unknown> }
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200003 - Worker initialization failure.
|
||||
* @throws { BusinessError } 10200006 - An exception occurred during serialization.
|
||||
* @throws { BusinessError } 10200014 - The function is not mark as concurrent.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function execute(task: Task, priority?: Priority): Promise<unknown>;
|
||||
|
||||
/**
|
||||
@ -442,6 +742,19 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Execute a concurrent task group.
|
||||
*
|
||||
* @param { TaskGroup } group - group group The task group want to execute.
|
||||
* @param { Priority } priority - priority priority Task group priority, MEDIUM is default.
|
||||
* @returns { Promise<unknown[]> }
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200006 - An exception occurred during serialization.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function execute(group: TaskGroup, priority?: Priority): Promise<unknown[]>;
|
||||
|
||||
/**
|
||||
@ -464,6 +777,17 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Cancel a concurrent task.
|
||||
*
|
||||
* @param { Task } task - task task The task want to cancel.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200015 - The task does not exist when it is canceled.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function cancel(task: Task): void;
|
||||
|
||||
/**
|
||||
@ -476,6 +800,17 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Cancel a concurrent task group.
|
||||
*
|
||||
* @param { TaskGroup } group - group group The task group want to cancel.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @throws { BusinessError } 10200018 - The task group does not exist when it is canceled.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function cancel(group: TaskGroup): void;
|
||||
|
||||
/**
|
||||
@ -486,6 +821,15 @@ declare namespace taskpool {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Get task pool internal information.
|
||||
*
|
||||
* @returns { TaskPoolInfo }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
function getTaskPoolInfo(): TaskPoolInfo;
|
||||
}
|
||||
|
||||
|
140
api/@ohos.uri.d.ts
vendored
140
api/@ohos.uri.d.ts
vendored
@ -28,6 +28,15 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The uri module provides utilities for URI resolution and parsing.
|
||||
*
|
||||
* @namespace uri
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declare namespace uri {
|
||||
/**
|
||||
* URI Represents a Uniform Resource Identifier (URI) reference.
|
||||
@ -44,6 +53,15 @@ declare namespace uri {
|
||||
* @since 10
|
||||
* @name URI
|
||||
*/
|
||||
/**
|
||||
* URI Represents a Uniform Resource Identifier (URI) reference.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
* @name URI
|
||||
*/
|
||||
class URI {
|
||||
/**
|
||||
* URI constructor, which is used to instantiate a URI object.
|
||||
@ -66,6 +84,18 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* URI constructor, which is used to instantiate a URI object.
|
||||
* uri: Constructs a URI by parsing a given string.
|
||||
*
|
||||
* @param { string } uri - uri uri
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200002 - Invalid uri string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor(uri: string);
|
||||
|
||||
/**
|
||||
@ -83,6 +113,15 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the serialized URI as a string.
|
||||
*
|
||||
* @returns { string } Returns the serialized URI as a string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
toString(): string;
|
||||
|
||||
/**
|
||||
@ -116,6 +155,17 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Check whether this URI is equivalent to other URI objects.
|
||||
*
|
||||
* @param { URI } other - other other URI object to be compared
|
||||
* @returns { boolean } boolean Tests whether this URI is equivalent to other URI objects.
|
||||
* @throws { BusinessError } 401 - The type of other must be URI.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
equalsTo(other: URI): boolean;
|
||||
|
||||
/**
|
||||
@ -133,6 +183,15 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Indicates whether this URI is an absolute URI.
|
||||
*
|
||||
* @returns { boolean } boolean Indicates whether the URI is an absolute URI (whether the scheme component is defined).
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
checkIsAbsolute(): boolean;
|
||||
|
||||
/**
|
||||
@ -150,6 +209,15 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Normalize the path of this URI, It is not safe to call the normalize interface with URI.
|
||||
*
|
||||
* @returns { URI } URI Used to normalize the path of this URI and return a URI object whose path has been normalized.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
normalize(): URI;
|
||||
|
||||
/**
|
||||
@ -165,6 +233,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the protocol part of the URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
scheme: string;
|
||||
|
||||
/**
|
||||
@ -180,6 +256,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Obtains the user information part of the URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
userInfo: string;
|
||||
|
||||
/**
|
||||
@ -195,6 +279,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the hostname portion of the URI without a port.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
host: string;
|
||||
|
||||
/**
|
||||
@ -210,6 +302,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the port portion of the URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
port: string;
|
||||
|
||||
/**
|
||||
@ -225,6 +325,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the path portion of the URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
path: string;
|
||||
|
||||
/**
|
||||
@ -240,6 +348,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the query portion of the URI
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
query: string;
|
||||
|
||||
/**
|
||||
@ -255,6 +371,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the fragment part of the URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
fragment: string;
|
||||
|
||||
/**
|
||||
@ -270,6 +394,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the decoding permission component part of this URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
authority: string;
|
||||
|
||||
/**
|
||||
@ -285,6 +417,14 @@ declare namespace uri {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the decoding scheme-specific part of the URI.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ssp: string;
|
||||
}
|
||||
}
|
||||
|
329
api/@ohos.url.d.ts
vendored
329
api/@ohos.url.d.ts
vendored
@ -28,6 +28,15 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The url module provides utilities for URL resolution and parsing.
|
||||
*
|
||||
* @namespace url
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declare namespace url {
|
||||
/**
|
||||
* The URLSearchParams interface defines some practical methods to process URL query strings.
|
||||
@ -105,7 +114,7 @@ declare namespace url {
|
||||
/**
|
||||
* Callback functions are used to traverse key-value pairs on the URLSearchParams instance object.
|
||||
*
|
||||
* @param { (value: string, key: string, searchParams: this) => void } callbackFn - callbackFn callbackFn Current traversal key value.
|
||||
* @param { function } callbackFn - callbackFn callbackFn Current traversal key value.
|
||||
* @param { Object } thisArg - thisArg thisArg thisArg to be used as this value for when callbackFn is called
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @since 7
|
||||
@ -188,12 +197,12 @@ declare namespace url {
|
||||
/**
|
||||
* Returns an iterator allowing to go through all key/value
|
||||
* pairs contained in this object.
|
||||
* @returns { IterableIterator<[string, string]> } Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
|
||||
* The first item of Array is name, and the second item of Array is value.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @since 7
|
||||
* @deprecated since 9
|
||||
* @useinstead ohos.url.URLParams.[Symbol.iterator]
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @returns Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
|
||||
* The first item of Array is name, and the second item of Array is value.
|
||||
*/
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
|
||||
@ -224,6 +233,15 @@ declare namespace url {
|
||||
* @since 10
|
||||
* @name URLParams
|
||||
*/
|
||||
/**
|
||||
* The URLParams interface defines some practical methods to process URL query strings.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
* @name URLParams
|
||||
*/
|
||||
class URLParams {
|
||||
/**
|
||||
* A parameterized constructor used to create an URLParams instance.
|
||||
@ -254,6 +272,22 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* A parameterized constructor used to create an URLParams instance.
|
||||
* As the input parameter of the constructor function, init supports four types.
|
||||
* The input parameter is a character string two-dimensional array.
|
||||
* The input parameter is the object list.
|
||||
* The input parameter is a character string.
|
||||
* The input parameter is the URLParams object.
|
||||
*
|
||||
* @param { string[][] | Record<string, string> | string | URLParams } init - init init
|
||||
* @throws { BusinessError } 401 - The type of init must be string two-dimensional array or object list
|
||||
* or string or URLParams object.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor(init?: string[][] | Record<string, string> | string | URLParams);
|
||||
|
||||
/**
|
||||
@ -275,6 +309,17 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Appends a specified key/value pair as a new search parameter.
|
||||
*
|
||||
* @param { string } name - name name Key name of the search parameter to be inserted.
|
||||
* @param { string } value - value value Values of search parameters to be inserted.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
append(name: string, value: string): void;
|
||||
|
||||
/**
|
||||
@ -294,6 +339,16 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Deletes the given search parameter and its associated value,from the list of all search parameters.
|
||||
*
|
||||
* @param { string } name - name name Name of the key-value pair to be deleted.
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
delete(name: string): void;
|
||||
|
||||
/**
|
||||
@ -315,6 +370,17 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns all key-value pairs associated with a given search parameter as an array.
|
||||
*
|
||||
* @param { string } name - name name Specifies the name of a key value.
|
||||
* @returns { string[] } string[] Returns all key-value pairs with the specified name.
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getAll(name: string): string[];
|
||||
|
||||
/**
|
||||
@ -334,12 +400,22 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
|
||||
* The first item of Array is name, and the second item of Array is value.
|
||||
*
|
||||
* @returns { IterableIterator<[string, string]> } Returns an iterator for ES6.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
|
||||
/**
|
||||
* Callback functions are used to traverse key-value pairs on the URLParams instance object.
|
||||
*
|
||||
* @param { (value: string, key: string, searchParams: this) => void } callbackFn - callbackFn value Current traversal key value,
|
||||
* @param { function } callbackFn - callbackFn value Current traversal key value,
|
||||
* key Indicates the name of the key that is traversed.
|
||||
* @param { Object } thisArg - thisArg thisArg to be used as this value for when callbackFn is called
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
@ -349,7 +425,7 @@ declare namespace url {
|
||||
/**
|
||||
* Callback functions are used to traverse key-value pairs on the URLParams instance object.
|
||||
*
|
||||
* @param { (value: string, key: string, searchParams: this) => void } callbackFn - callbackFn value Current traversal key value,
|
||||
* @param { function } callbackFn - callbackFn value Current traversal key value,
|
||||
* key Indicates the name of the key that is traversed.
|
||||
* @param { Object } thisArg - thisArg thisArg to be used as this value for when callbackFn is called
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
@ -357,6 +433,18 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Callback functions are used to traverse key-value pairs on the URLParams instance object.
|
||||
*
|
||||
* @param { function } callbackFn - callbackFn value Current traversal key value,
|
||||
* key Indicates the name of the key that is traversed.
|
||||
* @param { Object } thisArg - thisArg thisArg to be used as this value for when callbackFn is called
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
forEach(callbackFn: (value: string, key: string, searchParams: this) => void, thisArg?: Object): void;
|
||||
|
||||
/**
|
||||
@ -378,6 +466,17 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the first value associated to the given search parameter.
|
||||
*
|
||||
* @param { string } name - name name Specifies the name of a key-value pair.
|
||||
* @returns { string | null } Returns the first value found by name. If no value is found, null is returned.
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
get(name: string): string | null;
|
||||
|
||||
/**
|
||||
@ -399,6 +498,17 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns a Boolean that indicates whether a parameter with the specified name exists.
|
||||
*
|
||||
* @param { string } name - name name Specifies the name of a key-value pair.
|
||||
* @returns { boolean } Returns a Boolean value that indicates whether a found
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
has(name: string): boolean;
|
||||
|
||||
/**
|
||||
@ -426,6 +536,20 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Sets the value associated with a given search parameter to the
|
||||
* given value. If there were several matching values, this method
|
||||
* deletes the others. If the search parameter doesn't exist, this
|
||||
* method creates it.
|
||||
*
|
||||
* @param { string } name - name name Key name of the parameter to be set.
|
||||
* @param { string } value - value value Indicates the parameter value to be set.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
set(name: string, value: string): void;
|
||||
|
||||
/**
|
||||
@ -441,6 +565,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Sort all key/value pairs contained in this object in place and return undefined.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
sort(): void;
|
||||
|
||||
/**
|
||||
@ -458,6 +590,15 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns an iterator allowing to go through all keys contained in this object.
|
||||
*
|
||||
* @returns { IterableIterator<string> } Returns an ES6 Iterator over the names of each name-value pair.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
keys(): IterableIterator<string>;
|
||||
|
||||
/**
|
||||
@ -475,6 +616,15 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns an iterator allowing to go through all values contained in this object.
|
||||
*
|
||||
* @returns { IterableIterator<string> } Returns an ES6 Iterator over the values of each name-value pair.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
values(): IterableIterator<string>;
|
||||
|
||||
/**
|
||||
@ -496,6 +646,17 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns an iterator allowing to go through all key/value
|
||||
* pairs contained in this object.
|
||||
*
|
||||
* @returns { IterableIterator<[string, string]> } Returns an ES6 iterator. Each item of the iterator is a JavaScript Array.
|
||||
* The first item of Array is name, and the second item of Array is value.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
[Symbol.iterator](): IterableIterator<[string, string]>;
|
||||
|
||||
/**
|
||||
@ -513,6 +674,15 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns a query string suitable for use in a URL.
|
||||
*
|
||||
* @returns { string } Returns a search parameter serialized as a string, percent-encoded if necessary.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
@ -531,6 +701,15 @@ declare namespace url {
|
||||
* @since 10
|
||||
* @name URL
|
||||
*/
|
||||
/**
|
||||
* The interface of URL is used to parse, construct, normalize, and encode URLs.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
* @name URL
|
||||
*/
|
||||
class URL {
|
||||
/**
|
||||
* URL constructor, which is used to instantiate a URL object.
|
||||
@ -560,6 +739,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* URL constructor, which is used to instantiate a URL object.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor();
|
||||
|
||||
/**
|
||||
@ -587,6 +774,20 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Replaces the original constructor to process arguments and return a url object.
|
||||
*
|
||||
* @param { string } url - url url Absolute or relative input URL to resolve. Base is required if input is relative.
|
||||
* If input is an absolute value, base ignores the value.
|
||||
* @param { string | URL } base - base base Base URL to parse if input is not absolute.
|
||||
* @returns { URL }
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200002 - Invalid url string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
static parseURL(url: string, base?: string | URL): URL;
|
||||
|
||||
/**
|
||||
@ -604,6 +805,15 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the serialized URL as a string.
|
||||
*
|
||||
* @returns { string } Returns the serialized URL as a string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
toString(): string;
|
||||
|
||||
/**
|
||||
@ -621,6 +831,15 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the serialized URL as a string.
|
||||
*
|
||||
* @returns { string } Returns the serialized URL as a string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
toJSON(): string;
|
||||
|
||||
/**
|
||||
@ -636,6 +855,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the fragment portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
hash: string;
|
||||
|
||||
/**
|
||||
@ -651,6 +878,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the host portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
host: string;
|
||||
|
||||
/**
|
||||
@ -666,6 +901,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the host name portion of the URL,not include the port.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
hostname: string;
|
||||
|
||||
/**
|
||||
@ -681,6 +924,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the serialized URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
href: string;
|
||||
|
||||
/**
|
||||
@ -696,6 +947,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the read-only serialization of the URL's origin.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
readonly origin: string;
|
||||
|
||||
/**
|
||||
@ -711,6 +970,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the password portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
password: string;
|
||||
|
||||
/**
|
||||
@ -726,6 +993,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the path portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
pathname: string;
|
||||
|
||||
/**
|
||||
@ -741,6 +1016,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the port portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
port: string;
|
||||
|
||||
/**
|
||||
@ -756,6 +1039,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the protocol portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
protocol: string;
|
||||
|
||||
/**
|
||||
@ -771,6 +1062,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the serialized query portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
search: string;
|
||||
|
||||
/**
|
||||
@ -802,6 +1101,16 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets the URLParams object that represents the URL query parameter.
|
||||
* This property is read-only, but URLParams provides an object that can be used to change
|
||||
* the URL instance. To replace the entire query parameter for a URL, use url.searchsetter.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
readonly params: URLParams;
|
||||
|
||||
/**
|
||||
@ -817,6 +1126,14 @@ declare namespace url {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Gets and sets the username portion of the URL.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
username: string;
|
||||
}
|
||||
}
|
||||
|
36
api/@ohos.util.d.ts
vendored
36
api/@ohos.util.d.ts
vendored
@ -160,7 +160,7 @@ declare namespace util {
|
||||
* error-first callback style.
|
||||
*
|
||||
* @param { Function } original - Asynchronous function
|
||||
* @returns { (err: Object, value: Object) => void } Return a Asynchronous function
|
||||
* @returns { function } Return a Asynchronous function
|
||||
* @throws { BusinessError } 401 - The type of original must be Function.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
@ -522,7 +522,7 @@ declare namespace util {
|
||||
*
|
||||
* @param { string } input - The string to be encoded.
|
||||
* @param { Uint8Array } dest - Decoded numbers in accordance with the format
|
||||
* @returns { { read: number; written: number } } Return the object, where read represents
|
||||
* @returns { object } Return 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.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
@ -537,7 +537,7 @@ declare namespace util {
|
||||
*
|
||||
* @param { string } input - The string to be encoded.
|
||||
* @param { Uint8Array } dest - Decoded numbers in accordance with the format
|
||||
* @returns { { read: number; written: number } } Return the object, where read represents
|
||||
* @returns { object } Return 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.
|
||||
@ -549,7 +549,7 @@ declare namespace util {
|
||||
*
|
||||
* @param { string } input - The string to be encoded.
|
||||
* @param { Uint8Array } dest - Decoded numbers in accordance with the format
|
||||
* @returns { { read: number; written: number } } Return the object, where read represents
|
||||
* @returns { object } Return 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.
|
||||
@ -1986,7 +1986,6 @@ declare namespace util {
|
||||
/**
|
||||
* Constructor for creating base64 encoding and decoding
|
||||
*
|
||||
* @param No input parameter is required.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @since 8
|
||||
* @deprecated since 9
|
||||
@ -2111,14 +2110,12 @@ declare namespace util {
|
||||
/**
|
||||
* Constructor for creating base64 encoding and decoding
|
||||
*
|
||||
* @param No input parameter is required.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @since 9
|
||||
*/
|
||||
/**
|
||||
* Constructor for creating base64 encoding and decoding
|
||||
*
|
||||
* @param No input parameter is required.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
@ -2167,6 +2164,18 @@ declare namespace util {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Encodes the specified byte array into a String using the Base64 encoding scheme.
|
||||
*
|
||||
* @param { Uint8Array } src - A Uint8Array value
|
||||
* @param { Type } options - Enumerating input parameters includes two encoding formats: BASIC and MIME
|
||||
* @returns { string } Return the encoded string.
|
||||
* @throws { BusinessError } 401 - The type of src must be Uint8Array.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
encodeToStringSync(src: Uint8Array, options?: Type): string;
|
||||
|
||||
/**
|
||||
@ -2211,6 +2220,17 @@ declare namespace util {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Asynchronously encodes all bytes in the specified u8 array into the newly allocated u8 array using the Base64 encoding scheme.
|
||||
*
|
||||
* @param { Uint8Array } src - A Uint8Array value
|
||||
* @returns { Promise<Uint8Array> } Return the encodes asynchronous new Uint8Array.
|
||||
* @throws { BusinessError } 401 - The type of src must be Uint8Array.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
encode(src: Uint8Array): Promise<Uint8Array>;
|
||||
|
||||
/**
|
||||
@ -2279,14 +2299,12 @@ declare namespace util {
|
||||
/**
|
||||
* The types constructor
|
||||
*
|
||||
* @param No input parameter is required.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @since 8
|
||||
*/
|
||||
/**
|
||||
* The types constructor
|
||||
*
|
||||
* @param No input parameter is required.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
|
86
api/@ohos.worker.d.ts
vendored
86
api/@ohos.worker.d.ts
vendored
@ -736,6 +736,20 @@ export interface ThreadWorkerGlobalScope extends GlobalScope {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The onmessage attribute of parentPort specifies the event handler
|
||||
* to be called then the worker thread receives a message sent by
|
||||
* the host thread through worker postMessage.
|
||||
* The event handler is executed in the worker thread.
|
||||
*
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200004 - Worker instance is not running.
|
||||
* @throws { BusinessError } 10200005 - The invoked API is not supported in workers.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
onmessage?: (this: ThreadWorkerGlobalScope, ev: MessageEvents) => void;
|
||||
|
||||
/**
|
||||
@ -803,6 +817,19 @@ export interface ThreadWorkerGlobalScope extends GlobalScope {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Send a message to host thread from the worker
|
||||
*
|
||||
* @param { Object } messageObject - messageObject Data to be sent to the worker
|
||||
* @param { ArrayBuffer[] } transfer - transfer array cannot contain null.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200004 - Worker instance is not running.
|
||||
* @throws { BusinessError } 10200006 - An exception occurred during serialization.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
postMessage(messageObject: Object, transfer: ArrayBuffer[]): void;
|
||||
|
||||
/**
|
||||
@ -828,6 +855,19 @@ export interface ThreadWorkerGlobalScope extends GlobalScope {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Send a message to be host thread from the worker
|
||||
*
|
||||
* @param { Object } messageObject - messageObject Data to be sent to the worker
|
||||
* @param { PostMessageOptions } options - options Option can be set for postmessage.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200004 - Worker instance is not running.
|
||||
* @throws { BusinessError } 10200006 - An exception occurred during serialization.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
postMessage(messageObject: Object, options?: PostMessageOptions): void;
|
||||
}
|
||||
|
||||
@ -956,6 +996,20 @@ declare namespace worker {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The onmessage attribute of the worker specifies the event handler
|
||||
* to be called then the host thread receives a message created by itself
|
||||
* and sent by the worker through the parentPort.postMessage.
|
||||
* The event handler is executed in the host thread.
|
||||
*
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200004 - Worker instance is not running.
|
||||
* @throws { BusinessError } 10200005 - The invoked API is not supported in workers.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
onmessage?: (event: MessageEvents) => void;
|
||||
/**
|
||||
* The onmessage attribute of the worker specifies the event handler
|
||||
@ -1034,6 +1088,20 @@ declare namespace worker {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Sends a message to the worker thread.
|
||||
* The data is transferred using the structured clone algorithm.
|
||||
*
|
||||
* @param { Object } message - message Data to be sent to the worker
|
||||
* @param { PostMessageOptions } options - options
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @throws { BusinessError } 10200004 - Worker instance is not running.
|
||||
* @throws { BusinessError } 10200006 - An exception occurred during serialization.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
postMessage(message: Object, options?: PostMessageOptions): void;
|
||||
/**
|
||||
* Adds an event listener to the worker.
|
||||
@ -1124,6 +1192,15 @@ declare namespace worker {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Terminates the worker thread to stop the worker from receiving messages
|
||||
*
|
||||
* @throws { BusinessError } 10200004 - Worker instance is not running.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
terminate(): void;
|
||||
/**
|
||||
* Adds an event listener to the worker.
|
||||
@ -1369,6 +1446,15 @@ declare namespace worker {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The object used by the worker thread to communicate with the host thread.
|
||||
*
|
||||
* @constant
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
const workerPort: ThreadWorkerGlobalScope;
|
||||
}
|
||||
export default worker;
|
||||
|
407
api/@ohos.xml.d.ts
vendored
407
api/@ohos.xml.d.ts
vendored
@ -28,6 +28,15 @@
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The xml module provides utilities for converting XML text to Javascript object, XML generation and parsing.
|
||||
*
|
||||
* @namespace xml
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
declare namespace xml {
|
||||
/**
|
||||
* The XmlSerializer interface is used to generate an xml file.
|
||||
@ -44,6 +53,15 @@ declare namespace xml {
|
||||
* @since 10
|
||||
* @name XmlSerializer
|
||||
*/
|
||||
/**
|
||||
* The XmlSerializer interface is used to generate an xml file.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
* @name XmlSerializer
|
||||
*/
|
||||
class XmlSerializer {
|
||||
/**
|
||||
* A parameterized constructor used to create a new XmlSerializer instance.
|
||||
@ -72,6 +90,21 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* A parameterized constructor used to create a new XmlSerializer instance.
|
||||
* As the input parameter of the constructor function, init supports three types.
|
||||
* The input parameter is an Arrarybuffer.
|
||||
* The input parameter is a DataView.
|
||||
* The input parameter is an encoding format of string type.
|
||||
*
|
||||
* @param { ArrayBuffer | DataView } buffer - A instance, the new XmlPullParser with.
|
||||
* @param { string } encoding - [encoding='utf8'] this is its encoding.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor(buffer: ArrayBuffer | DataView, encoding?: string);
|
||||
|
||||
/**
|
||||
@ -93,6 +126,17 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Write an attribute.
|
||||
*
|
||||
* @param { string } name - Key name of the attribute.
|
||||
* @param { string } value - Values of attribute.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setAttributes(name: string, value: string): void;
|
||||
|
||||
/**
|
||||
@ -112,6 +156,16 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Add an empty element.
|
||||
*
|
||||
* @param { string } name - Key name of the attribute.
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
addEmptyElement(name: string): void;
|
||||
|
||||
/**
|
||||
@ -127,6 +181,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes xml declaration with encoding. For example: <?xml version="1.0" encoding="utf-8"?>.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setDeclaration(): void;
|
||||
|
||||
/**
|
||||
@ -146,6 +208,16 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes a element start tag with the given name.
|
||||
*
|
||||
* @param { string } name - Name of the element.
|
||||
* @throws { BusinessError } 401 - The type of name must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
startElement(name: string): void;
|
||||
|
||||
/**
|
||||
@ -161,6 +233,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes end tag of the element.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
endElement(): void;
|
||||
|
||||
/**
|
||||
@ -182,6 +262,17 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes the namespace of the current element tag.
|
||||
*
|
||||
* @param { string } prefix - Values name of the prefix.
|
||||
* @param { string } namespace - Values of namespace.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setNamespace(prefix: string, namespace: string): void;
|
||||
|
||||
/**
|
||||
@ -201,6 +292,16 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes the comment.
|
||||
*
|
||||
* @param { string } text - Values of comment.
|
||||
* @throws { BusinessError } 401 - The type of text must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setComment(text: string): void;
|
||||
|
||||
/**
|
||||
@ -220,6 +321,16 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes the CDATA.
|
||||
*
|
||||
* @param { string } text - Values of CDATA.
|
||||
* @throws { BusinessError } 401 - The type of text must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setCDATA(text: string): void;
|
||||
|
||||
/**
|
||||
@ -239,6 +350,16 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes the text.
|
||||
*
|
||||
* @param { string } text - Values of text.
|
||||
* @throws { BusinessError } 401 - The type of text must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setText(text: string): void;
|
||||
|
||||
/**
|
||||
@ -258,6 +379,16 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Writes the DOCTYPE.
|
||||
*
|
||||
* @param { string } text - Values of docType.
|
||||
* @throws { BusinessError } 401 - The type of text must be string.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
setDocType(text: string): void;
|
||||
}
|
||||
|
||||
@ -276,6 +407,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The event types represented by XML elements.
|
||||
*
|
||||
* @enum { number }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
enum EventType {
|
||||
/**
|
||||
* Start a document.
|
||||
@ -290,6 +430,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Start a document.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
START_DOCUMENT,
|
||||
/**
|
||||
* End a document.
|
||||
@ -304,6 +452,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* End a document.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
END_DOCUMENT,
|
||||
/**
|
||||
* Start a tag.
|
||||
@ -318,6 +474,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Start a tag.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
START_TAG,
|
||||
/**
|
||||
* End a tag.
|
||||
@ -332,6 +496,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* End a tag.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
END_TAG,
|
||||
/**
|
||||
* Character data.
|
||||
@ -346,6 +518,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Character data.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
TEXT,
|
||||
/**
|
||||
* A CDATA sections.
|
||||
@ -360,6 +540,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* A CDATA sections.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
CDSECT,
|
||||
/**
|
||||
* An XML comment.
|
||||
@ -374,6 +562,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* An XML comment.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
COMMENT,
|
||||
/**
|
||||
* An XML document type declaration.
|
||||
@ -388,6 +584,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* An XML document type declaration.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
DOCDECL,
|
||||
/**
|
||||
* An XML processing instruction declaration.
|
||||
@ -402,6 +606,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* An XML processing instruction declaration.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
INSTRUCTION,
|
||||
/**
|
||||
* An entity reference.
|
||||
@ -416,6 +628,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* An entity reference.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ENTITY_REFERENCE,
|
||||
/**
|
||||
* A whitespace.
|
||||
@ -430,6 +650,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* A whitespace.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
WHITESPACE
|
||||
}
|
||||
|
||||
@ -448,6 +676,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current parse info.
|
||||
*
|
||||
* @typedef ParseInfo
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
interface ParseInfo {
|
||||
/**
|
||||
* The current column number, starting from 1.
|
||||
@ -464,6 +701,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current column number, starting from 1.
|
||||
*
|
||||
* @returns { number }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getColumnNumber(): number;
|
||||
/**
|
||||
* The current depth of the element.
|
||||
@ -480,6 +726,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current depth of the element.
|
||||
*
|
||||
* @returns { number }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getDepth(): number;
|
||||
/**
|
||||
* The current line number, starting from 1.
|
||||
@ -496,6 +751,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current line number, starting from 1.
|
||||
*
|
||||
* @returns { number }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getLineNumber(): number;
|
||||
/**
|
||||
* The current element's name.
|
||||
@ -512,6 +776,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current element's name.
|
||||
*
|
||||
* @returns { string }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getName(): string;
|
||||
/**
|
||||
* The current element's namespace.
|
||||
@ -528,6 +801,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current element's namespace.
|
||||
*
|
||||
* @returns { string }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getNamespace(): string;
|
||||
/**
|
||||
* The current element's prefix.
|
||||
@ -544,6 +826,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The current element's prefix.
|
||||
*
|
||||
* @returns { string }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getPrefix(): string;
|
||||
/**
|
||||
* The text content of the current event as String.
|
||||
@ -560,6 +851,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* The text content of the current event as String.
|
||||
*
|
||||
* @returns { string }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getText(): string;
|
||||
/**
|
||||
* Returns true if the current element is empty.
|
||||
@ -576,6 +876,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns true if the current element is empty.
|
||||
*
|
||||
* @returns { boolean }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
isEmptyElementTag(): boolean;
|
||||
/**
|
||||
* Checks whether the current TEXT event contains only whitespace characters.
|
||||
@ -592,6 +901,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Checks whether the current TEXT event contains only whitespace characters.
|
||||
*
|
||||
* @returns { boolean }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
isWhitespace(): boolean;
|
||||
/**
|
||||
* Returns the number of attributes of the current start tag.
|
||||
@ -608,6 +926,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Returns the number of attributes of the current start tag.
|
||||
*
|
||||
* @returns { number }
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
getAttributeCount(): number;
|
||||
}
|
||||
|
||||
@ -626,6 +953,15 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Parse options for XmlPullParser.
|
||||
*
|
||||
* @typedef ParseOptions
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
interface ParseOptions {
|
||||
/**
|
||||
* Whether to parsing Doctype of the elements.
|
||||
@ -640,6 +976,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to parsing Doctype of the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
supportDoctype?: boolean;
|
||||
|
||||
/**
|
||||
@ -655,6 +999,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Whether to ignore parsing texts of the elements.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
ignoreNameSpace?: boolean;
|
||||
|
||||
/**
|
||||
@ -670,6 +1022,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Tag value callback function.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
tagValueCallbackFunction?: (name: string, value: string) => boolean;
|
||||
|
||||
/**
|
||||
@ -685,6 +1045,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Attribute value callback function.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
attributeValueCallbackFunction?: (name: string, value: string) => boolean;
|
||||
|
||||
/**
|
||||
@ -700,6 +1068,14 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Token value callback function.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
tokenValueCallbackFunction?: (eventType: EventType, value: ParseInfo) => boolean;
|
||||
}
|
||||
|
||||
@ -718,6 +1094,15 @@ declare namespace xml {
|
||||
* @since 10
|
||||
* @name XmlPullParser
|
||||
*/
|
||||
/**
|
||||
* The XmlPullParser interface is used to parse the existing xml file.
|
||||
*
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
* @name XmlPullParser
|
||||
*/
|
||||
class XmlPullParser {
|
||||
/**
|
||||
* A constructor used to create a new XmlPullParser instance.
|
||||
@ -738,6 +1123,17 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* A constructor used to create a new XmlPullParser instance.
|
||||
*
|
||||
* @param { ArrayBuffer | DataView } buffer - A instance, the new XmlPullParser with.
|
||||
* @param { string } encoding - [encoding='utf8'] this is its encoding.
|
||||
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
constructor(buffer: ArrayBuffer | DataView, encoding?: string);
|
||||
|
||||
/**
|
||||
@ -759,6 +1155,17 @@ declare namespace xml {
|
||||
* @crossplatform
|
||||
* @since 10
|
||||
*/
|
||||
/**
|
||||
* Starts parsing the XML file.
|
||||
*
|
||||
* @param { ParseOptions } option - Parse options for XmlPullParser, the interface including
|
||||
* two Boolean variables and three callback functions.
|
||||
* @throws { BusinessError } 401 - The type of option must be ParseOptions.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 11
|
||||
*/
|
||||
parse(option: ParseOptions): void;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user