diff --git a/api/@ohos.util.json.d.ts b/api/@ohos.util.json.d.ts index ab940ca26..57825a4a7 100644 --- a/api/@ohos.util.json.d.ts +++ b/api/@ohos.util.json.d.ts @@ -39,7 +39,7 @@ declare namespace json { * @atomicservice * @since 12 */ - type Transformer = (this: Object, key: string, value: Object) => Object | undefined | null + type Transformer = (this: Object, key: string, value: Object) => Object | undefined | null; /** * Converts a JavaScript Object Notation (JSON) string into an Object or null. @@ -48,7 +48,9 @@ declare namespace json { * @param { Transformer } [reviver] - A function that transforms the results. * @param {ParseOptions} options - The config of parse. * @returns { Object | null } Return an Object, array, string, number, boolean, or null value corresponding to JSON text. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types; 3.Parameter verification failed. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice @@ -60,16 +62,20 @@ declare namespace json { * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. * * @param { Object } value - A JavaScript value, usually an Object or array. - * @param { (number | string)[] | null } [replacer] - An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringify. + * @param { (number | string)[] | null } [replacer] - An array of strings and numbers that acts as an approved list + * for selecting the object properties that will be stringify. * @param { string | number } [space] - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. * @returns { string } Return a JSON text. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types; + * 3.Parameter verification failed. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 12 */ - function stringify(value: Object, replacer?: (number | string)[] | null, space?: string | number): string + function stringify(value: Object, replacer?: (number | string)[] | null, space?: string | number): string; /** * Converts a JavaScript value to a JavaScript Object Notation (JSON) string. @@ -78,7 +84,10 @@ declare namespace json { * @param { Transformer } [replacer] - A function that transforms the results. * @param { string | number } [space] - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read. * @returns { string } Return a JSON text. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; + * 2.Incorrect parameter types; + * 3.Parameter verification failed. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice