diff --git a/api/@ohos.util.stream.d.ts b/api/@ohos.util.stream.d.ts index 226fdfb290673f1a151f1aa72a7f019633bbc936..a684f219f6c5ae83d4e9899191502c6ebf64b252 100644 --- a/api/@ohos.util.stream.d.ts +++ b/api/@ohos.util.stream.d.ts @@ -294,61 +294,25 @@ declare namespace stream { * Returns boolean indicating whether it is in ObjectMode. * * @type { boolean } - * @readonly * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 - */ - readonly writableObjectMode: boolean; - - /** - * Returns boolean indicating whether it is in ObjectMode. - * - * @type { boolean } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writableObjectMode(): boolean; /** * Value of highWatermark. * - * @type { number } - * @readonly + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 - */ - readonly writableHighWatermark: number; - - /** - * Value of highWatermark. - * - * @type { number } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get writableHighWatermark(): number; - - /** - * Is true if it is safe to call writable.write(), which means the stream has not been destroyed, error or end. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly writable: boolean; + get writableHighWatermark(): int; /** * Is true if it is safe to call writable.write(), which means the stream has not been destroyed, error or end. @@ -357,70 +321,34 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writable(): boolean; /** * Size of data that can be flushed, in bytes or objects. * - * @type { number } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly writableLength: number; - - /** - * Size of data that can be flushed, in bytes or objects. - * - * @type { number } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get writableLength(): number; - - /** - * Number of times writable.uncork() needs to be called in order to fully uncork the stream. - * - * @type { number } - * @readonly + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly writableCorked: number; + get writableLength(): int; /** * Number of times writable.uncork() needs to be called in order to fully uncork the stream. * - * @type { number } + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get writableCorked(): number; - - /** - * Whether Writable.end has been called. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly writableEnded: boolean; + get writableCorked(): int; /** * Whether Writable.end has been called. @@ -429,23 +357,11 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writableEnded(): boolean; - /** - * Whether Writable.end has been called and all buffers have been flushed. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly writableFinished: boolean; - /** * Whether Writable.end has been called and all buffers have been flushed. * @@ -453,8 +369,8 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writableFinished(): boolean; } @@ -518,7 +434,7 @@ declare namespace stream { * Reads a buffer of a specified size from the buffer. If the available buffer is sufficient, the result * of the specified size is returned. Otherwise, if Readable has ended, all remaining buffers are returned. * - * @param { number } [size] - Expected length of the data to be read. + * @param { int } [size] - Expected length of the data to be read. * @returns { buffer.Buffer | string | null } If no data is available to read, null is returned. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; @@ -531,7 +447,7 @@ declare namespace stream { * @since 20 * @arkts 1.2 */ - read(size?: number): buffer.Buffer | string | null; + read(size?: int): buffer.Buffer | string | null; /** * Switch Readable to Streaming Mode. @@ -698,7 +614,7 @@ declare namespace stream { * After data production, Readable.push should be called to push the produced data into the buffer. * If push is not called, doRead will not be called again. * - * @param { number } size - Expected length of the data to be read. + * @param { int } size - Expected length of the data to be read. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.Mandatory parameters are left unspecified; * 2.Incorrect parameter types; @@ -709,7 +625,7 @@ declare namespace stream { * @since arkts {'1.1':'12', '1.2':'20'} * @arkts 1.1&1.2 */ - doRead(size: number): void; + doRead(size: int): void; /** * Adds the generated data to the buffer. The return value indicates whether the data in the buffer has not @@ -730,18 +646,6 @@ declare namespace stream { */ push(chunk: Uint8Array | string | null, encoding?: string): boolean; - /** - * Returns boolean indicating whether it is in ObjectMode. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly readableObjectMode: boolean; - /** * Returns boolean indicating whether it is in ObjectMode. * @@ -749,24 +653,11 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get readableObjectMode(): boolean; - /** - * Is true if it is safe to call readable.read(), which means - * the stream has not been destroyed or emitted 'error' or 'end'. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly readable: boolean; - /** * Is true if it is safe to call readable.read(), which means * the stream has not been destroyed or emitted 'error' or 'end'. @@ -775,46 +666,22 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get readable(): boolean; /** * Returns the value of highWatermark passed when creating this Readable. * - * @type { number } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly readableHighWatermark: number; - - /** - * Returns the value of highWatermark passed when creating this Readable. - * - * @type { number } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get readableHighWatermark(): number; - - /** - * This property reflects the current state of the readable stream null/true/false. - * - * @type { boolean | null } - * @readonly + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly readableFlowing: boolean | null; + get readableHighWatermark(): int; /** * This property reflects the current state of the readable stream null/true/false. @@ -823,47 +690,22 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get readableFlowing(): boolean | null; /** * Size of the data that can be read, in bytes or objects. * - * @type { number } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly readableLength: number; - - /** - * Size of the data that can be read, in bytes or objects. - * - * @type { number } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get readableLength(): number; - - /** - * Getter for the property encoding of a given Readable stream. The encoding property can be set using the - * readable.setEncoding() method. - * - * @type { string | null } - * @readonly + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly readableEncoding: string | null; + get readableLength(): int; /** * Getter for the property encoding of a given Readable stream. The encoding property can be set using the @@ -873,23 +715,11 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get readableEncoding(): string | null; - /** - * Whether all data has been generated. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly readableEnded: boolean; - /** * Whether all data has been generated. * @@ -897,8 +727,8 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get readableEnded(): boolean; } @@ -1049,18 +879,6 @@ declare namespace stream { */ doWritev(chunks: string[] | Uint8Array[], callback: Function): void; - /** - * Returns boolean indicating whether it is in ObjectMode. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly writableObjectMode: boolean; - /** * Returns boolean indicating whether it is in ObjectMode. * @@ -1068,46 +886,22 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writableObjectMode(): boolean; /** * Value of highWatermark. * - * @type { number } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly writableHighWatermark: number; - - /** - * Value of highWatermark. - * - * @type { number } + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get writableHighWatermark(): number; - - /** - * Is true if it is safe to call writable.write(), which means the stream has not been destroyed, error or end. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly writable: boolean; + get writableHighWatermark(): int; /** * Is true if it is safe to call writable.write(), which means the stream has not been destroyed, error or end. @@ -1116,70 +910,34 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writable(): boolean; /** * Size of data that can be flushed, in bytes or objects. * - * @type { number } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly writableLength: number; - - /** - * Size of data that can be flushed, in bytes or objects. - * - * @type { number } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get writableLength(): number; - - /** - * Number of times writable.uncork() needs to be called in order to fully uncork the stream. - * - * @type { number } - * @readonly + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly writableCorked: number; + get writableLength(): int; /** * Number of times writable.uncork() needs to be called in order to fully uncork the stream. * - * @type { number } - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - get writableCorked(): number; - - /** - * Whether Writable.end has been called. - * - * @type { boolean } - * @readonly + * @type { int } * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 12 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ - readonly writableEnded: boolean; + get writableCorked(): int; /** * Whether Writable.end has been called. @@ -1188,23 +946,11 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writableEnded(): boolean; - /** - * Whether Writable.end has been called and all buffers have been flushed. - * - * @type { boolean } - * @readonly - * @syscap SystemCapability.Utils.Lang - * @crossplatform - * @atomicservice - * @since 12 - */ - readonly writableFinished: boolean; - /** * Whether Writable.end has been called and all buffers have been flushed. * @@ -1212,8 +958,8 @@ declare namespace stream { * @syscap SystemCapability.Utils.Lang * @crossplatform * @atomicservice - * @since 20 - * @arkts 1.2 + * @since arkts {'1.1':'12', '1.2':'20'} + * @arkts 1.1&1.2 */ get writableFinished(): boolean; }