diff --git a/api/@ohos.buffer.d.ts b/api/@ohos.buffer.d.ts index 14005e47b9ad951af37e6b5b7713f6db4441de6a..d92ca3c4ab4e16195329cdf02cadc19cba96ffd9 100644 --- a/api/@ohos.buffer.d.ts +++ b/api/@ohos.buffer.d.ts @@ -407,8 +407,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function from(array: double[]): Buffer; @@ -465,23 +464,6 @@ declare namespace buffer { */ function from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer; - /** - * This creates a view of the ArrayBuffer without copying the underlying memory. - * - * @param { ArrayBuffer } arrayBuffer - arrayBuffer arrayBuffer An ArrayBuffer, - * @param { int } [byteOffset] - byteOffset [byteOffset = 0] Index of first byte to expose - * @param { int } [length] - length [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose - * @returns { Buffer } Return a view of the ArrayBuffer - * @throws { BusinessError } 10200001 - The value of "[byteOffset/length]" is out of range. - * It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length] - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - function from(arrayBuffer: ArrayBuffer, byteOffset?: int, length?: int): Buffer; - /** * Copies the passed buffer data onto a new Buffer instance. * @@ -516,8 +498,7 @@ declare namespace buffer { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function from(buffer: Buffer | Uint8Array): Buffer; @@ -566,21 +547,6 @@ declare namespace buffer { */ function from(object: Object, offsetOrEncoding: int | string, length: int): Buffer; - /** - * Creates a Buffer instance based on the specified object. - * - * @param { Object } input - Object that supports Symbol.toPrimitive or valueOf(). - * @param { int | string } offsetOrEncoding - Byte offset or encoding format. - * @param { int } length - Length of the Buffer instance to create, in bytes. - * @returns { Buffer } Return a new allocated Buffer - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - function from(input: Object, offsetOrEncoding: int | string, length: int): Buffer; - /** * Creates a new Buffer containing string. The encoding parameter identifies the character encoding * to be used when converting string into bytes. @@ -624,11 +590,68 @@ declare namespace buffer { function from(string: String, encoding?: BufferEncoding): Buffer; /** - * Creates a new Buffer containing string. The encoding parameter identifies the character encoding - * to be used when converting string into bytes. + * Creates a Buffer instance with the specified array. * - * @param { string } input - input input A string to encode - * @param { BufferEncoding } [encoding] - encoding [encoding='utf8'] The encoding of string + * @param { double[] } array - Array to create a Buffer instance. + * @returns { Buffer } Return a new allocated Buffer + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function fromWithArray(array: double[]): Buffer; + + /** + * This creates a view of the ArrayBuffer without copying the underlying memory. + * + * @param { ArrayBuffer } arrayBuffer - arrayBuffer arrayBuffer An ArrayBuffer, + * @param { int } [byteOffset] - byteOffset [byteOffset = 0] Index of first byte to expose + * @param { int } [length] - length [length = arrayBuffer.byteLength - byteOffset] Number of bytes to expose + * @returns { Buffer } Return a view of the ArrayBuffer + * @throws { BusinessError } 10200001 - The value of "[byteOffset/length]" is out of range. + * It must be >= [left range] and <= [right range]. Received value is: [byteOffset/length] + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function fromWithArrayBufferByteOffsetLength(arrayBuffer: ArrayBuffer, byteOffset?: int, length?: int): Buffer; + + /** + * Copies the data of a passed Buffer instance to create a new Buffer instance and returns the new one. + * + * @param { Buffer | Uint8Array } buffer - Buffer or Uint8Array instance. + * @returns { Buffer } Return a new allocated Buffer + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function fromWithBuffer(buffer: Buffer | Uint8Array): Buffer; + + /** + * Creates a Buffer instance based on the specified object. + * + * @param { Object } input - Object that supports Symbol.toPrimitive or valueOf(). + * @param { int | string } offsetOrEncoding - Byte offset or encoding format. + * @param { int } length - Length of the Buffer instance to create, in bytes. + * @returns { Buffer } Return a new allocated Buffer + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function fromWithObjectTypedInputOffsetOrEncodingLength(input: Object, offsetOrEncoding: int | string, length: int): Buffer; + + /** + * Creates a Buffer instance based on various types. + * + * @param { string } input - string. + * @param { BufferEncoding } [encoding] - Encoding format of the string. The default value is 'utf8'. * @returns { Buffer } Return a new Buffer containing string * @syscap SystemCapability.Utils.Lang * @crossplatform @@ -636,7 +659,21 @@ declare namespace buffer { * @since 20 * @arkts 1.2 */ - function from(input: string, encoding?: BufferEncoding): Buffer; + function fromWithStringTypedInputEncoding(input: string, encoding?: BufferEncoding): Buffer; + + /** + * Creates a Buffer instance based on a string in the given encoding format. + * + * @overload { fromWithArray, fromWithArrayBufferByteOffsetLength, fromWithBuffer, + fromWithObjectTypedInputOffsetOrEncodingLength, fromWithStringTypedInputEncoding } + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + export overload from { fromWithArray, fromWithArrayBufferByteOffsetLength, fromWithBuffer, + fromWithObjectTypedInputOffsetOrEncodingLength, fromWithStringTypedInputEncoding } /** * Returns true if obj is a Buffer, false otherwise @@ -3701,21 +3738,17 @@ declare namespace buffer { /** * Creates a new Blob object containing a concatenation of the given sources. * - * @param { Array | Array | Array | Array | Array } sources - sources sources An array of string, , - * , , or objects, or any mix of such objects, that will be stored within the Blob + * @param { ArrayUnionType } sources - sources sources ArrayUnionType * @param { BlobOptions } [options] - options options {endings: string, type: string} * endings: One of either 'transparent' or 'native'. * type: The Blob content-type - * @throws { BusinessError } 401 - Parameter error. Possible causes: - * 1.Mandatory parameters are left unspecified; - * 2.Incorrect parameter types. * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice * @since 20 * @arkts 1.2 */ - constructor(sources: Array | Array | Array | Array | Array, options?: BlobOptions); + constructor(sources: ArrayUnionType, options?: BlobOptions); /** * The total size of the Blob in bytes @@ -3742,7 +3775,7 @@ declare namespace buffer { * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - size: int; + get size(): int; /** * The content-type of the Blob @@ -3769,7 +3802,7 @@ declare namespace buffer { * @since arkts {'1.1':'11', '1.2':'20'} * @arkts 1.1&1.2 */ - type: string; + get type(): string; /** * Returns a promise that fulfills with an containing a copy of the Blob data. diff --git a/api/arkui/AttributeUpdater.d.ts b/api/arkui/AttributeUpdater.d.ts index fdf5c8e1861532759be2dd22f2c870fe4c56cf14..ef4662f019ae19b8e03796e49a4460fd8d5733bd 100644 --- a/api/arkui/AttributeUpdater.d.ts +++ b/api/arkui/AttributeUpdater.d.ts @@ -1,5 +1,6 @@ +'use static' /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,157 +17,65 @@ /** * @file Defines a modifier which can update attributes to native side. * @kit ArkUI + * @arkts 1.2 */ -/** - * function that returns a default param of AttributeUpdater. - * - * @typedef { function } Initializer - * @returns { T } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ -declare type Initializer = () => T; - -/** - * Defines a modifier which can update attributes to native side. - * - * @implements AttributeModifier - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ -export declare class AttributeUpdater> implements AttributeModifier { - - /** - * Defines the normal update attribute function. - * - * @param { T } instance - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - applyNormalAttribute?(instance: T): void; - - /** - * Defines a function for initialization. - * - * @param { T } instance - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - initializeModifier(instance: T): void; - - /** - * Get attribute of the modifier. - * - * @returns { T | undefined } The attribute of the modifier. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - get attribute(): T | undefined; - - /** - * Used to update constructor params. - * - * @type { C } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - updateConstructorParams: C; +import { AttributeModifier } from './component/common' - /** - * Defines a function executed when component changed. - * - * @param { T } component - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 12 - */ - onComponentChanged(component: T): void; -} /** * function that returns by the function updateConstructorParams. * * @typedef { function } Initializer - * @param { Object[] } params + * @param { FixedArray } params * @returns { T } * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 - * @arkts 1.2 */ -export type Initializer = (...params: Object[]) => T; +export type Initializer = (...params:FixedArray) => T; /** * Defines a modifier which can update attributes to native side. * - * @implements AttributeModifier + * @implements AttributeModifier * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 - * @arkts 1.2 */ export declare class AttributeUpdater implements AttributeModifier { + /** - * Defines a function for initialization. + * Get attribute of the modifier. * - * @param { T } instance + * @returns { T | undefined } The attribute of the modifier. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 - * @arkts 1.2 */ - initializeModifier(instance: T): void; + get attribute(): T | undefined; /** - * Get attribute of the modifier. + * Defines a function for initialization. * - * @returns { T | undefined } The attribute of the modifier. + * @param { T } instance * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 - * @arkts 1.2 */ - get attribute(): T | undefined; + initializeModifier(instance: T): void; /** * Used to update constructor params. * * @type { Initializer } * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 - * @arkts 1.2 */ - get updateConstructorParams(): Initializer; + get updateConstructorParams(): Initializer; - /** + /** * Defines a function executed when component changed. * * @param { T } component * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 - * @arkts 1.2 */ - onComponentChanged(component: T): void; -} \ No newline at end of file + onComponentChanged(component: T): void; +} diff --git a/api/arkui/AttributeUpdater.d.ets b/api/arkui/AttributeUpdater.static.d.ets similarity index 83% rename from api/arkui/AttributeUpdater.d.ets rename to api/arkui/AttributeUpdater.static.d.ets index 0966ac8b0a84af18af9cd368dd7140213d57fc62..ef4662f019ae19b8e03796e49a4460fd8d5733bd 100644 --- a/api/arkui/AttributeUpdater.d.ets +++ b/api/arkui/AttributeUpdater.static.d.ets @@ -1,5 +1,6 @@ +'use static' /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -16,10 +17,21 @@ /** * @file Defines a modifier which can update attributes to native side. * @kit ArkUI + * @arkts 1.2 */ import { AttributeModifier } from './component/common' + +/** + * function that returns by the function updateConstructorParams. + * + * @typedef { function } Initializer + * @param { FixedArray } params + * @returns { T } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ export type Initializer = (...params:FixedArray) => T; /** @@ -27,8 +39,6 @@ export type Initializer = (...params:FixedArray) => T; * * @implements AttributeModifier * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 */ export declare class AttributeUpdater implements AttributeModifier { @@ -38,8 +48,6 @@ export declare class AttributeUpdater implements AttributeModifier { * * @returns { T | undefined } The attribute of the modifier. * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 */ get attribute(): T | undefined; @@ -49,19 +57,15 @@ export declare class AttributeUpdater implements AttributeModifier { * * @param { T } instance * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 */ - initializeModifier(instaice:T):void; + initializeModifier(instance: T): void; /** * Used to update constructor params. * * @type { Initializer } * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 */ get updateConstructorParams(): Initializer; @@ -71,8 +75,6 @@ export declare class AttributeUpdater implements AttributeModifier { * * @param { T } component * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 */ onComponentChanged(component: T): void; diff --git a/api/arkui/CommonModifier.d.ets b/api/arkui/CommonModifier.static.d.ets similarity index 84% rename from api/arkui/CommonModifier.d.ets rename to api/arkui/CommonModifier.static.d.ets index cbf721a0ad59dbdc6f954facc6882b57c26c8827..a6cac8915b1256e72e6d4608c3a8e600974c740e 100644 --- a/api/arkui/CommonModifier.d.ets +++ b/api/arkui/CommonModifier.static.d.ets @@ -1,5 +1,6 @@ +'use static' /* - * Copyright (c) 2024 Huawei Device Co., Ltd. + * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -12,9 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /** * @file * @kit ArkUI + * @arkts 1.2 */ import { AttributeModifier, CommonAttribute } from './component/common'; @@ -22,9 +25,9 @@ import { AttributeModifier, CommonAttribute } from './component/common'; /** * Defines Common Modifier * - * @implements CommonAttribute, AttributeModifier + * @implements { CommonAttribute, AttributeModifier } * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice * @since 20 -*/ + * @noninterop + */ export declare class CommonModifier implements CommonAttribute, AttributeModifier {} diff --git a/api/arkui/component/common.static.d.ets b/api/arkui/component/common.static.d.ets index 31b466c06d64602614419e728f0cf9032ef16383..f1b81b06f3869855908099726211efb306199018 100644 --- a/api/arkui/component/common.static.d.ets +++ b/api/arkui/component/common.static.d.ets @@ -1,4 +1,4 @@ -"use static" +'use static' /* * Copyright (c) 2021-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -9770,61 +9770,59 @@ export declare interface MenuElement { */ action: () => void; } + /** * Defines the attribute modifier. * * @interface AttributeModifier * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice * @since 20 */ export declare interface AttributeModifier { - /** - * Defines the normal update attribute function. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - */ - default applyNormalAttribute(instance: T) : void; - /** - * Defines the pressed update attribute function. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - */ - default applyPressedAttribute(instance: T) : void; - /** - * Defines the focused update attribute function. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - */ - default applyFocusedAttribute(instance: T) : void; - /** - * Defines the disabled update attribute function. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - */ - default applyDisabledAttribute(instance: T) : void; - /** - * Defines the selected update attribute function. - * - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - */ - default applySelectedAttribute(instance: T) : void; + /** + * Defines the normal update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default applyNormalAttribute(instance: T) : void; + + /** + * Defines the pressed update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default applyPressedAttribute(instance: T) : void; + + /** + * Defines the focused update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default applyFocusedAttribute(instance: T) : void; + + /** + * Defines the disabled update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default applyDisabledAttribute(instance: T) : void; + + /** + * Defines the selected update attribute function. + * + * @param { T } instance + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default applySelectedAttribute(instance: T) : void; } /** * Defines the content modifier.