diff --git a/api/@ohos.rpc.d.ts b/api/@ohos.rpc.d.ts index fbbc9ddf9267a7567affa922619d299ca3c6a3e4..cbc94267216d8907787878c6236d412e227a7247 100644 --- a/api/@ohos.rpc.d.ts +++ b/api/@ohos.rpc.d.ts @@ -25,7 +25,7 @@ import type { AsyncCallback } from './@ohos.base'; * * @namespace rpc * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ declare namespace rpc { @@ -35,6 +35,7 @@ declare namespace rpc { * @enum { number } * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ enum ErrorCode { /** @@ -42,6 +43,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ CHECK_PARAM_ERROR = 401, @@ -50,6 +52,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ OS_MMAP_ERROR = 1900001, @@ -58,6 +61,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ OS_IOCTL_ERROR = 1900002, @@ -66,6 +70,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ WRITE_TO_ASHMEM_ERROR = 1900003, @@ -74,6 +79,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ READ_FROM_ASHMEM_ERROR = 1900004, @@ -82,6 +88,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ ONLY_PROXY_OBJECT_PERMITTED_ERROR = 1900005, @@ -90,6 +97,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ ONLY_REMOTE_OBJECT_PERMITTED_ERROR = 1900006, @@ -98,6 +106,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ COMMUNICATION_ERROR = 1900007, @@ -106,6 +115,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ PROXY_OR_REMOTE_OBJECT_INVALID_ERROR = 1900008, @@ -114,6 +124,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ WRITE_DATA_TO_MESSAGE_SEQUENCE_ERROR = 1900009, @@ -122,6 +133,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ READ_DATA_FROM_MESSAGE_SEQUENCE_ERROR = 1900010, @@ -130,6 +142,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ PARCEL_MEMORY_ALLOC_ERROR = 1900011, @@ -138,6 +151,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ CALL_JS_METHOD_ERROR = 1900012, @@ -146,6 +160,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ OS_DUP_ERROR = 1900013 } @@ -156,6 +171,7 @@ declare namespace rpc { * @enum { number } * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ enum TypeCode { /** @@ -163,6 +179,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ INT8_ARRAY = 0, @@ -171,6 +188,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ UINT8_ARRAY = 1, @@ -179,6 +197,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ INT16_ARRAY = 2, @@ -187,6 +206,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ UINT16_ARRAY = 3, @@ -195,6 +215,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ INT32_ARRAY = 4, @@ -203,6 +224,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ UINT32_ARRAY = 5, @@ -211,6 +233,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ FLOAT32_ARRAY = 6, @@ -219,6 +242,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ FLOAT64_ARRAY = 7, @@ -227,6 +251,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ BIGINT64_ARRAY = 8, @@ -235,6 +260,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ BIGUINT64_ARRAY = 9 } @@ -1170,7 +1196,7 @@ declare namespace rpc { * {@link Parcelable}, and ParcelableArray. * * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ class MessageSequence { @@ -1179,7 +1205,7 @@ declare namespace rpc { * * @returns { MessageSequence } Return the object created. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ static create(): MessageSequence; @@ -1188,7 +1214,7 @@ declare namespace rpc { * Reclaim the {@link MessageSequence} object. * * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ reclaim(): void; @@ -1203,7 +1229,7 @@ declare namespace rpc { * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeRemoteObject(obj: IRemoteObject): void; @@ -1215,7 +1241,7 @@ declare namespace rpc { * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readRemoteObject(): IRemoteObject; @@ -1231,7 +1257,7 @@ declare namespace rpc { * 4.The number of bytes copied to the buffer is different from the length of the obtained string. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeInterfaceToken(token: string): void; @@ -1242,7 +1268,7 @@ declare namespace rpc { * @returns { string } Return a string value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readInterfaceToken(): string; @@ -1250,18 +1276,19 @@ declare namespace rpc { /** * Obtains the size of data (in bytes) contained in the {@link MessageSequence} object. * - * @returns { number } Return the size of data contained in the {@link MessageSequence} object. + * @returns { long } Return the size of data contained in the {@link MessageSequence} object. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - getSize(): number; + getSize(): long; /** * Obtains the storage capacity (in bytes) of the {@link MessageSequence} object. * * @returns { int } Return the storage capacity of the {@link MessageSequence} object. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ getCapacity(): int; @@ -1271,15 +1298,16 @@ declare namespace rpc { *

{@code false} is returned if the data size set in this method is greater * than the storage capacity of the {@link MessageSequence}. * - * @param { number } size - Indicates the data size of the {@link MessageSequence} object. + * @param { long } size - Indicates the data size of the {@link MessageSequence} object. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - setSize(size: number): void; + setSize(size: long): void; /** * Sets the storage capacity (in bytes) of the {@link MessageSequence} object. @@ -1293,7 +1321,7 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @throws { BusinessError } 1900011 - Memory allocation failed. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ setCapacity(size: int): void; @@ -1303,69 +1331,75 @@ declare namespace rpc { *

Writable data space = Storage capacity of the {@link MessageSequence} – Size of data contained in * the {@link MessageSequence}. * - * @returns { number } Return the writable data space of the {@link MessageSequence} object. + * @returns { long } Return the writable data space of the {@link MessageSequence} object. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - getWritableBytes(): number; + getWritableBytes(): long; /** * Obtains the readable data space (in bytes) in the {@link MessageSequence} object. *

Readable data space = Size of data contained in the {@link MessageSequence} – Size of data that has been read. * - * @returns { number } Return the readable data space of the {@link MessageSequence} object. + * @returns { long } Return the readable data space of the {@link MessageSequence} object. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - getReadableBytes(): number; + getReadableBytes(): long; /** * Obtains the current read position in the {@link MessageSequence} object. * - * @returns { number } Return the current read position in the {@link MessageSequence} object. + * @returns { long } Return the current read position in the {@link MessageSequence} object. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - getReadPosition(): number; + getReadPosition(): long; /** * Obtains the current write position in the {@link MessageSequence} object. * - * @returns { number } Return the current write position in the {@link MessageSequence} object. + * @returns { long } Return the current write position in the {@link MessageSequence} object. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - getWritePosition(): number; + getWritePosition(): long; /** * Changes the current read position in the {@link MessageSequence} object. *

Generally, you are advised not to change the current read position. If you must * change it, change it to an accurate position. Otherwise, the read data may be incorrect. * - * @param { number } pos - Indicates the target position to start data reading. + * @param { long } pos - Indicates the target position to start data reading. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - rewindRead(pos: number): void; + rewindRead(pos: long): void; /** * Changes the current write position in the {@link MessageSequence} object. *

Generally, you are advised not to change the current write position. If you must * change it, change it to an accurate position. Otherwise, the data to be read may be incorrect. * - * @param { number } pos - Indicates the target position to start data writing. + * @param { long } pos - Indicates the target position to start data writing. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - rewindWrite(pos: number): void; + rewindWrite(pos: long): void; /** * Writes information to this MessageSequence object indicating that no exception occurred. @@ -1374,7 +1408,7 @@ declare namespace rpc { * * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeNoException(): void; @@ -1387,7 +1421,7 @@ declare namespace rpc { * * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readException(): void; @@ -1395,28 +1429,30 @@ declare namespace rpc { /** * Writes a byte value into the {@link MessageSequence} object. * - * @param { number } val - Indicates the byte value to write. + * @param { byte } val - Indicates the byte value to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeByte(val: number): void; + writeByte(val: byte): void; /** * Writes a short integer value into the {@link MessageSequence} object. * - * @param { number } val - Indicates the short integer value to write. + * @param { short } val - Indicates the short integer value to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeShort(val: number): void; + writeShort(val: short): void; /** * Writes an integer value into the {@link MessageSequence} object. @@ -1427,7 +1463,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeInt(val: int): void; @@ -1441,7 +1477,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeLong(val: long): void; @@ -1449,28 +1485,30 @@ declare namespace rpc { /** * Writes a floating point value into the {@link MessageSequence} object. * - * @param { number } val - Indicates the floating point value to write. + * @param { double } val - Indicates the floating point value to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeFloat(val: number): void; + writeFloat(val: double): void; /** * Writes a double-precision floating point value into the {@link MessageSequence} object. * - * @param { number } val - Indicates the double-precision floating point value to write. + * @param { double } val - Indicates the double-precision floating point value to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeDouble(val: number): void; + writeDouble(val: double): void; /** * Writes a boolean value into the {@link MessageSequence} object. @@ -1481,7 +1519,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeBoolean(val: boolean): void; @@ -1489,15 +1527,16 @@ declare namespace rpc { /** * Writes a single character value into the {@link MessageSequence} object. * - * @param { number } val - Indicates the single character value to write. + * @param { byte } val - Indicates the single character value to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeChar(val: number): void; + writeChar(val: byte): void; /** * Writes a string value into the {@link MessageSequence} object. @@ -1510,7 +1549,7 @@ declare namespace rpc { * 4.The number of bytes copied to the buffer is different from the length of the obtained string. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeString(val: string): void; @@ -1524,7 +1563,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeParcelable(val: Parcelable): void; @@ -1541,7 +1580,7 @@ declare namespace rpc { * 5.The type of the element in the array is incorrect. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeByteArray(byteArray: int[]): void; @@ -1551,7 +1590,7 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * - * @param { number[] } shortArray - Indicates the short integer array to write. + * @param { byte[] } shortArray - Indicates the short integer array to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1561,8 +1600,9 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeShortArray(shortArray: number[]): void; + writeShortArray(shortArray: byte[]): void; /** * Writes an integer array into the {@link MessageSequence} object. @@ -1578,7 +1618,7 @@ declare namespace rpc { * 5.The type of the element in the array is incorrect. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeIntArray(intArray: int[]): void; @@ -1588,7 +1628,7 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * - * @param { number[] } longArray - Indicates the long integer array to write. + * @param { long[] } longArray - Indicates the long integer array to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1598,15 +1638,16 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeLongArray(longArray: number[]): void; + writeLongArray(longArray: long[]): void; /** * Writes a floating point array into the {@link MessageSequence} object. * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * - * @param { number[] } floatArray - Indicates the floating point array to write. + * @param { float[] } floatArray - Indicates the floating point array to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1616,8 +1657,9 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeFloatArray(floatArray: number[]): void; + writeFloatArray(floatArray: float[]): void; /** * Writes a double-precision floating point array into the {@link MessageSequence} object. @@ -1633,7 +1675,7 @@ declare namespace rpc { * 5.The type of the element in the array is incorrect. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeDoubleArray(doubleArray: double[]): void; @@ -1651,7 +1693,7 @@ declare namespace rpc { * 4.The element does not exist in the array. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeBooleanArray(booleanArray: boolean[]): void; @@ -1661,7 +1703,7 @@ declare namespace rpc { * Ensure that the data type and size comply with the interface definition. * Otherwise,data may be truncated. * - * @param { number[] } charArray - Indicates the single character array to write. + * @param { byte[] } charArray - Indicates the single character array to write. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1670,8 +1712,9 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - writeCharArray(charArray: number[]): void; + writeCharArray(charArray: byte[]): void; /** * Writes a string array into the {@link MessageSequence} object. @@ -1687,7 +1730,7 @@ declare namespace rpc { * 5.The number of bytes copied to the buffer is different from the length of the obtained string. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeStringArray(stringArray: string[]): void; @@ -1703,7 +1746,7 @@ declare namespace rpc { * 4.The element does not exist in the array. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeParcelableArray(parcelableArray: Parcelable[]): void; @@ -1721,28 +1764,31 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ writeRemoteObjectArray(objectArray: IRemoteObject[]): void; /** * Reads a byte value from the {@link MessageSequence} object. * - * @returns { number } Return a byte value. + * @returns { byte } Return a byte value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readByte(): number; + readByte(): byte; /** * Reads a short integer value from the {@link MessageSequence} object. * - * @returns { number } Return a short integer value. + * @returns { short } Return a short integer value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readShort(): number; + readShort(): short; /** * Reads an integer value from the {@link MessageSequence} object. @@ -1750,7 +1796,7 @@ declare namespace rpc { * @returns { int } Return an integer value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readInt(): int; @@ -1761,7 +1807,7 @@ declare namespace rpc { * @returns { long } Return a long integer value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readLong(): long; @@ -1769,22 +1815,24 @@ declare namespace rpc { /** * Reads a floating point value from the {@link MessageSequence} object. * - * @returns { number } Return a floating point value. + * @returns { double } Return a floating point value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readFloat(): number; + readFloat(): double; /** * Reads a double-precision floating point value from the {@link MessageSequence} object. * - * @returns { number } Return a double-precision floating point value. + * @returns { double } Return a double-precision floating point value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readDouble(): number; + readDouble(): double; /** * Reads a boolean value from the {@link MessageSequence} object. @@ -1792,7 +1840,7 @@ declare namespace rpc { * @returns { boolean } Return a boolean value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readBoolean(): boolean; @@ -1800,12 +1848,13 @@ declare namespace rpc { /** * Reads a single character value from the {@link MessageSequence} object. * - * @returns { number } Return a single character value. + * @returns { short } Return a single character value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readChar(): number; + readChar(): short; /** * Reads a string value from the {@link MessageSequence} object. @@ -1813,7 +1862,7 @@ declare namespace rpc { * @returns { string } Return a string value. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readString(): string; @@ -1828,7 +1877,7 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @throws { BusinessError } 1900012 - Failed to call the JS callback function. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readParcelable(dataIn: Parcelable): void; @@ -1836,7 +1885,7 @@ declare namespace rpc { /** * Writes a byte array into the {@link MessageSequence} object. * - * @param { number[] } dataIn - Indicates the byte array read from MessageSequence. + * @param { byte[] } dataIn - Indicates the byte array read from MessageSequence. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1844,23 +1893,25 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readByteArray(dataIn: number[]): void; + readByteArray(dataIn: byte[]): void; /** * Reads a byte array from the {@link MessageSequence} object. * - * @returns { number[] } Return a byte array. + * @returns { byte[] } Return a byte array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readByteArray(): number[]; + readByteArray(): byte[]; /** * Reads a short integer array from the {@link MessageSequence} object. * - * @param { number[] } dataIn - Indicates the short integer array read from MessageSequence. + * @param { short[] } dataIn - Indicates the short integer array read from MessageSequence. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1868,18 +1919,20 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readShortArray(dataIn: number[]): void; + readShortArray(dataIn: short[]): void; /** * Reads a short integer array from the {@link MessageSequence} object. * - * @returns { number[] } Return a short integer array. + * @returns { short[] } Return a short integer array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readShortArray(): number[]; + readShortArray(): short[]; /** * Reads an integer array from the {@link MessageSequence} object. @@ -1891,7 +1944,7 @@ declare namespace rpc { * 3.The parameter type does not match. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readIntArray(dataIn: int[]): void; @@ -1902,7 +1955,7 @@ declare namespace rpc { * @returns { int[] } Return an integer array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readIntArray(): int[]; @@ -1910,7 +1963,7 @@ declare namespace rpc { /** * Reads a long integer array from the {@link MessageSequence} object. * - * @param { number[] } dataIn - Indicates the long integer array to read. + * @param { long[] } dataIn - Indicates the long integer array to read. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1918,23 +1971,25 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readLongArray(dataIn: number[]): void; + readLongArray(dataIn: long[]): void; /** * Reads a long integer array from the {@link MessageSequence} object. * - * @returns { number[] } Return a long integer array. + * @returns { long[] } Return a long integer array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readLongArray(): number[]; + readLongArray(): long[]; /** * Reads a floating point array from the {@link MessageSequence} object. * - * @param { number[] } dataIn - Indicates the floating point array to read. + * @param { double[] } dataIn - Indicates the floating point array to read. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -1942,18 +1997,20 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readFloatArray(dataIn: number[]): void; + readFloatArray(dataIn: double[]): void; /** * Reads a floating point array from the {@link MessageSequence} object. * - * @returns { number[] } Return a floating point array. + * @returns { double[] } Return a floating point array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readFloatArray(): number[]; + readFloatArray(): double[]; /** * Reads a double-precision floating point array from the {@link MessageSequence} object. @@ -1965,7 +2022,7 @@ declare namespace rpc { * 3.The parameter type does not match. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readDoubleArray(dataIn: double[]): void; @@ -1976,7 +2033,7 @@ declare namespace rpc { * @returns { double[] } Return a double-precision floating point array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readDoubleArray(): double[]; @@ -1991,7 +2048,7 @@ declare namespace rpc { * 3.The parameter type does not match. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readBooleanArray(dataIn: boolean[]): void; @@ -2002,7 +2059,7 @@ declare namespace rpc { * @returns { boolean[] } Return a boolean array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readBooleanArray(): boolean[]; @@ -2010,7 +2067,7 @@ declare namespace rpc { /** * Reads a single character array from the {@link MessageSequence} object. * - * @param { number[] } dataIn - Indicates the single character array to read. + * @param { short[] } dataIn - Indicates the single character array to read. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The parameter is an empty array; * 2.The number of parameters is incorrect; @@ -2018,18 +2075,20 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readCharArray(dataIn: number[]): void; + readCharArray(dataIn: short[]): void; /** * Reads a single character array from the {@link MessageSequence} object. * - * @returns { number[] } Return a single character array. + * @returns { short[] } Return a single character array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - readCharArray(): number[]; + readCharArray(): short[]; /** * Reads a string array from the {@link MessageSequence} object. @@ -2041,7 +2100,7 @@ declare namespace rpc { * 3.The parameter type does not match. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readStringArray(dataIn: string[]): void; @@ -2052,7 +2111,7 @@ declare namespace rpc { * @returns { string[] } Return a string array. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readStringArray(): string[]; @@ -2070,7 +2129,7 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @throws { BusinessError } 1900012 - Failed to call the JS callback function. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readParcelableArray(parcelableArray: Parcelable[]): void; @@ -2088,6 +2147,7 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ readRemoteObjectArray(objects: IRemoteObject[]): void; @@ -2098,6 +2158,7 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ readRemoteObjectArray(): IRemoteObject[]; @@ -2110,7 +2171,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @static * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ static closeFileDescriptor(fd: int): void; @@ -2118,16 +2179,17 @@ declare namespace rpc { /** * Duplicates the specified file descriptor. * - * @param { number } fd - File descriptor to be duplicated. - * @returns { number } Return a duplicated file descriptor. + * @param { int } fd - File descriptor to be duplicated. + * @returns { int } Return a duplicated file descriptor. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900013 - Failed to call dup. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - static dupFileDescriptor(fd: number): number; + static dupFileDescriptor(fd: int): int; /** * Checks whether this {@link MessageSequence} object contains a file descriptor. @@ -2136,6 +2198,7 @@ declare namespace rpc { * return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ containFileDescriptors(): boolean; @@ -2148,7 +2211,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeFileDescriptor(fd: int): void; @@ -2159,7 +2222,7 @@ declare namespace rpc { * @returns { int } Return a file descriptor obtained. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readFileDescriptor(): int; @@ -2173,7 +2236,7 @@ declare namespace rpc { * 2.The parameter is not an instance of the Ashmem object. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ writeAshmem(ashmem: Ashmem): void; @@ -2184,7 +2247,7 @@ declare namespace rpc { * @returns { Ashmem } Return the anonymous share object obtained. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ readAshmem(): Ashmem; @@ -2192,11 +2255,12 @@ declare namespace rpc { /** * Obtains the maximum amount of raw data that can be sent in a time. * - * @returns { number } 128 MB. + * @returns { long } 128 MB. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - getRawDataCapacity(): number; + getRawDataCapacity(): long; /** * Writes raw data to this {@link MessageSequence} object. @@ -2235,7 +2299,7 @@ declare namespace rpc { * 6.The transferred size is greater than the byte length of ArrayBuffer. * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ writeRawDataBuffer(rawData: ArrayBuffer, size: int): void; @@ -2266,7 +2330,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ readRawDataBuffer(size: int): ArrayBuffer; @@ -2285,6 +2349,7 @@ declare namespace rpc { * @throws { BusinessError } 1900009 - Failed to write data to the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ writeArrayBuffer(buf: ArrayBuffer, typeCode: TypeCode): void; @@ -2300,6 +2365,7 @@ declare namespace rpc { * @throws { BusinessError } 1900010 - Failed to read data from the message sequence. * @syscap SystemCapability.Communication.IPC.Core * @since 12 dynamic + * @since 20 static */ readArrayBuffer(typeCode: TypeCode): ArrayBuffer; } @@ -2348,7 +2414,7 @@ declare namespace rpc { * * @typedef Parcelable * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ interface Parcelable { @@ -2359,7 +2425,7 @@ declare namespace rpc { * object will be marshalled. * @returns { boolean } Return {@code true} if the marshalling is successful; return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ marshalling(dataOut: MessageSequence): boolean; @@ -2371,7 +2437,7 @@ declare namespace rpc { * which the {@code Parcelable} object has been marshalled. * @returns { boolean } Return {@code true} if the unmarshalling is successful; return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ unmarshalling(dataIn: MessageSequence): boolean; @@ -2439,7 +2505,7 @@ declare namespace rpc { * * @typedef RequestResult * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ interface RequestResult { @@ -2448,7 +2514,7 @@ declare namespace rpc { * * @type { int } * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ errCode: int; @@ -2458,7 +2524,7 @@ declare namespace rpc { * * @type { int } * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ code: int; @@ -2469,7 +2535,7 @@ declare namespace rpc { * * @type { MessageSequence } * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ data: MessageSequence; @@ -2480,7 +2546,7 @@ declare namespace rpc { * * @type { MessageSequence } * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ reply: MessageSequence; @@ -2495,7 +2561,7 @@ declare namespace rpc { * a specific file, and send messages. * * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ abstract class IRemoteObject { @@ -2529,6 +2595,7 @@ declare namespace rpc { * 4.The number of bytes copied to the buffer is different from the length of the obtained string. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ getLocalInterface(descriptor: string): IRemoteBroker; @@ -2594,7 +2661,7 @@ declare namespace rpc { * 2.The parameter type does not match; * 3.Failed to obtain the passed object instance. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ sendMessageRequest( @@ -2648,7 +2715,7 @@ declare namespace rpc { * 2.The parameter type does not match; * 3.Failed to obtain the passed object instance. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ sendMessageRequest( @@ -2685,7 +2752,7 @@ declare namespace rpc { * @throws { BusinessError } 1900005 - Operation allowed only for the proxy object. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ registerDeathRecipient(recipient: DeathRecipient, flags: int): void; @@ -2716,7 +2783,7 @@ declare namespace rpc { * @throws { BusinessError } 1900005 - Operation allowed only for the proxy object. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ unregisterDeathRecipient(recipient: DeathRecipient, flags: int): void; @@ -2740,7 +2807,7 @@ declare namespace rpc { * @returns { string } Return the interface descriptor. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ getDescriptor(): string; @@ -2750,7 +2817,7 @@ declare namespace rpc { * * @returns { boolean } Return {@code true} if the object is dead; return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ isObjectDead(): boolean; @@ -2766,7 +2833,7 @@ declare namespace rpc { * * @typedef IRemoteBroker * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ interface IRemoteBroker { @@ -2776,7 +2843,7 @@ declare namespace rpc { * @returns { IRemoteObject } Return the RemoteObject if the caller is a RemoteObject; return the IRemoteObject, * that is, the holder of this RemoteProxy object, if the caller is a RemoteProxy object. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ asObject(): IRemoteObject; @@ -2799,7 +2866,7 @@ declare namespace rpc { * * @typedef DeathRecipient * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ interface DeathRecipient { @@ -2807,7 +2874,7 @@ declare namespace rpc { * Called to perform subsequent operations when a death notification of the remote object is received. * * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ onRemoteDied(): void; @@ -2821,7 +2888,7 @@ declare namespace rpc { * Public Message Option, using the specified flag type, constructs the specified MessageOption object. * * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ class MessageOption { @@ -2833,6 +2900,7 @@ declare namespace rpc { * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ static TF_SYNC: int; @@ -2844,19 +2912,21 @@ declare namespace rpc { * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ static TF_ASYNC: int; /** * Indicates the sendRequest API for returning the file descriptor. * - * @type { number } + * @type { int } * @default 16 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - static TF_ACCEPT_FDS: number; + static TF_ACCEPT_FDS: int; /** * Indicates the wait time for RPC, in seconds. It is NOT used in IPC case. @@ -2874,6 +2944,7 @@ declare namespace rpc { * @static * @syscap SystemCapability.Communication.IPC.Core * @since 11 dynamic + * @since 20 static */ static TF_WAIT_TIME: int; @@ -2883,7 +2954,7 @@ declare namespace rpc { * @param { int } syncFlags - Specifies whether the SendRequest is called synchronously (default) or asynchronously. * @param { int } waitTime - Maximum wait time for a RPC call. The default value is TF_WAIT_TIME. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ constructor(syncFlags?: int, waitTime?: int); @@ -2909,20 +2980,22 @@ declare namespace rpc { /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. * - * @returns { number } Return whether the SendRequest is called synchronously or asynchronously. + * @returns { int } Return whether the SendRequest is called synchronously or asynchronously. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - getFlags(): number; + getFlags(): int; /** * Sets the SendRequest call flag, which can be synchronous or asynchronous. * - * @param { number } flags - Indicates the call flag, which can be synchronous or asynchronous. + * @param { int } flags - Indicates the call flag, which can be synchronous or asynchronous. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - setFlags(flags: number): void; + setFlags(flags: int): void; /** * Obtains the SendRequest call flag, which can be synchronous or asynchronous. @@ -2930,7 +3003,7 @@ declare namespace rpc { * @returns { boolean } Return {@code true} if the asynchronous call succeeds; * return {@code false} if the synchronous call succeeds. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ isAsync(): boolean; @@ -2940,7 +3013,7 @@ declare namespace rpc { * * @param { boolean } isAsync - Indicates the call flag, which can be synchronous or asynchronous. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ setAsync(isAsync: boolean): void; @@ -2948,20 +3021,22 @@ declare namespace rpc { /** * Obtains the maximum wait time for this RPC call. * - * @returns { number } Return maximum wait time obtained. + * @returns { int } Return maximum wait time obtained. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - getWaitTime(): number; + getWaitTime(): int; /** * Sets the maximum wait time for this RPC call. * - * @param { number } waitTime - Indicates maximum wait time to set. + * @param { int } waitTime - Indicates maximum wait time to set. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - setWaitTime(waitTime: number): void; + setWaitTime(waitTime: int): void; } /** @@ -2974,7 +3049,7 @@ declare namespace rpc { * * @extends IRemoteObject * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ class RemoteObject extends IRemoteObject { @@ -2983,7 +3058,7 @@ declare namespace rpc { * * @param { string } descriptor - Specifies interface descriptor. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ constructor(descriptor: string); @@ -3014,6 +3089,7 @@ declare namespace rpc { * 4.The number of bytes copied to the buffer is different from the length of the obtained string. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ getLocalInterface(descriptor: string): IRemoteBroker; @@ -3034,7 +3110,7 @@ declare namespace rpc { * @returns { string } Return the interface descriptor. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ getDescriptor(): string; @@ -3054,7 +3130,7 @@ declare namespace rpc { * {{@code false} otherwise} when the function call is synchronous. * Return a promise object with a boolean when the function call is asynchronous. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ onRemoteMessageRequest( @@ -3141,7 +3217,7 @@ declare namespace rpc { * 2.The parameter type does not match; * 3.Failed to obtain the passed object instance. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ sendMessageRequest( @@ -3195,7 +3271,7 @@ declare namespace rpc { * 2.The parameter type does not match; * 3.Failed to obtain the passed object instance. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ sendMessageRequest( @@ -3211,7 +3287,7 @@ declare namespace rpc { * * @returns { int } Return the PID of the {@link RemoteProxy} object. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ getCallingPid(): int; @@ -3221,7 +3297,7 @@ declare namespace rpc { * * @returns { int } Return the UID of the {@link RemoteProxy} object. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ getCallingUid(): int; @@ -3252,6 +3328,7 @@ declare namespace rpc { * 4.The number of bytes copied to the buffer is different from the length of the obtained string. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ modifyLocalInterface(localInterface: IRemoteBroker, descriptor: string): void; } @@ -3265,66 +3342,71 @@ declare namespace rpc { * * @extends IRemoteObject * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ class RemoteProxy extends IRemoteObject { /** * Indicates the message code for a Ping operation. * - * @type { number } + * @type { int } * @default 1599098439 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - static PING_TRANSACTION: number; + static PING_TRANSACTION: int; /** * Indicates the message code for a dump operation. * - * @type { number } + * @type { int } * @default 1598311760 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - static DUMP_TRANSACTION: number; + static DUMP_TRANSACTION: int; /** * Indicates the message code for a transmission. * - * @type { number } + * @type { int } * @default 1598968902 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - static INTERFACE_TRANSACTION: number; + static INTERFACE_TRANSACTION: int; /** * Indicates the minimum value of a valid message code. *

This constant is used to check the validity of an operation. * - * @type { number } + * @type { int } * @default 0x1 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - static MIN_TRANSACTION_ID: number; + static MIN_TRANSACTION_ID: int; /** * Indicates the maximum value of a valid message code. *

This constant is used to check the validity of an operation. * - * @type { number } + * @type { int } * @default 0x00FFFFFF * @static * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ - static MAX_TRANSACTION_ID: number; + static MAX_TRANSACTION_ID: int; /** * Queries a local interface with a specified descriptor. @@ -3377,7 +3459,7 @@ declare namespace rpc { * 3.The callback used to receive remote object death notifications is empty. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ registerDeathRecipient(recipient: DeathRecipient, flags: int): void; @@ -3409,7 +3491,7 @@ declare namespace rpc { * 3.The callback used to receive remote object death notifications is empty. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ unregisterDeathRecipient(recipient: DeathRecipient, flags: int): void; @@ -3432,7 +3514,7 @@ declare namespace rpc { * @throws { BusinessError } 1900007 - communication failed. * @throws { BusinessError } 1900008 - The proxy or remote object is invalid. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ getDescriptor(): string; @@ -3496,7 +3578,7 @@ declare namespace rpc { * 2.The parameter type does not match; * 3.Failed to obtain the passed object instance. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ sendMessageRequest( @@ -3550,7 +3632,7 @@ declare namespace rpc { * 2.The parameter type does not match; * 3.Failed to obtain the passed object instance. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ sendMessageRequest( @@ -3566,7 +3648,7 @@ declare namespace rpc { * * @returns { boolean } Return {@code true} if the {@code RemoteObject} is dead; return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ isObjectDead(): boolean; @@ -3581,7 +3663,7 @@ declare namespace rpc { * peer device IDs, and checking whether the API call is on the same device. * * @syscap SystemCapability.Communication.IPC.Core - * @since 11 dynamic + * @since 11 dynamic * @since 20 static */ class IPCSkeleton { @@ -3591,7 +3673,7 @@ declare namespace rpc { * * @returns { IRemoteObject } Return an {@link IRemoteObject} reference of the registered service. * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ static getContextObject(): IRemoteObject; @@ -3607,7 +3689,7 @@ declare namespace rpc { * @returns { int } Return the PID of the proxy. * @static * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ static getCallingPid(): int; @@ -3623,7 +3705,7 @@ declare namespace rpc { * @returns { int } Return the UID of the proxy. * @static * @syscap SystemCapability.Communication.IPC.Core - * @since 7 dynamic + * @since 7 dynamic * @since 20 static */ static getCallingUid(): int; @@ -3635,7 +3717,7 @@ declare namespace rpc { * @returns { long } Return the TOKENID. * @static * @syscap SystemCapability.Communication.IPC.Core - * @since 8 dynamic + * @since 8 dynamic * @since 20 static */ static getCallingTokenId(): long; @@ -3647,6 +3729,7 @@ declare namespace rpc { * @returns { string } Return the ID of the device where the peer process resides. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ static getCallingDeviceID(): string; @@ -3657,6 +3740,7 @@ declare namespace rpc { * @returns { string } Return the ID of the local device. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ static getLocalDeviceID(): string; @@ -3667,6 +3751,7 @@ declare namespace rpc { * @returns { boolean } Return {@code true} if the call is made on the same device; return {@code false} otherwise. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ static isLocalCalling(): boolean; @@ -3694,6 +3779,7 @@ declare namespace rpc { * 2.The parameter type does not match. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ static flushCmdBuffer(object: IRemoteObject): void; @@ -3704,6 +3790,7 @@ declare namespace rpc { * @returns { string } Return a string containing the UID and PID of the remote user. * @syscap SystemCapability.Communication.IPC.Core * @since 7 dynamic + * @since 20 static */ static resetCallingIdentity(): string; @@ -3736,6 +3823,7 @@ declare namespace rpc { * 4.The number of bytes copied to the buffer is different from the length of the obtained string. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ static restoreCallingIdentity(identity: string): void; } @@ -3747,53 +3835,57 @@ declare namespace rpc { * obtaining the Ashmem size, and setting Ashmem protection. * * @syscap SystemCapability.Communication.IPC.Core - * @since 8 dynamic + * @since 8 dynamic * @since 20 static */ class Ashmem { /** * The mapped memory is executable. * - * @type { number } + * @type { int } * @default 4 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 8 dynamic + * @since 20 static */ - static PROT_EXEC: number; + static PROT_EXEC: int; /** * The mapped memory is inaccessible. * - * @type { number } + * @type { int } * @default 0 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 8 dynamic + * @since 20 static */ - static PROT_NONE: number; + static PROT_NONE: int; /** * The mapped memory is readable. * - * @type { number } + * @type { int } * @default 1 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 8 dynamic + * @since 20 static */ - static PROT_READ: number; + static PROT_READ: int; /** * The mapped memory is writable. * - * @type { number } + * @type { int } * @default 2 * @static * @syscap SystemCapability.Communication.IPC.Core * @since 8 dynamic + * @since 20 static */ - static PROT_WRITE: number; + static PROT_WRITE: int; /** * Creates an Ashmem object with the specified name and size. @@ -3821,7 +3913,7 @@ declare namespace rpc { * 4.The Ashmem size passed is less than or equal to 0. * @static * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ static create(name: string, size: int): Ashmem; @@ -3850,7 +3942,7 @@ declare namespace rpc { * 2.The passed parameter is not an Ahmem object; * 3.The ashmem instance for obtaining packaging is empty. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ static create(ashmem: Ashmem): Ashmem; @@ -3860,6 +3952,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 8 dynamic + * @since 20 static */ closeAshmem(): void; @@ -3868,6 +3961,7 @@ declare namespace rpc { * * @syscap SystemCapability.Communication.IPC.Core * @since 8 dynamic + * @since 20 static */ unmapAshmem(): void; @@ -3876,7 +3970,7 @@ declare namespace rpc { * * @returns { int } Memory size mapped. * @syscap SystemCapability.Communication.IPC.Core - * @since 8 dynamic + * @since 8 dynamic * @since 20 static */ getAshmemSize(): int; @@ -3898,7 +3992,7 @@ declare namespace rpc { * Creates the shared file mapping on the virtual address space of this process. * The size of the mapping region is specified by this Ashmem object. * - * @param { number } mapType - Protection level of the memory region to which the shared file is mapped. + * @param { int } mapType - Protection level of the memory region to which the shared file is mapped. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match; @@ -3906,8 +4000,9 @@ declare namespace rpc { * @throws { BusinessError } 1900001 - Failed to call mmap. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - mapTypedAshmem(mapType: number): void; + mapTypedAshmem(mapType: int): void; /** * Maps the shared file to the readable and writable virtual address space of the process. @@ -3925,7 +4020,7 @@ declare namespace rpc { * * @throws { BusinessError } 1900001 - Failed to call mmap. * @syscap SystemCapability.Communication.IPC.Core - * @since 9 dynamic + * @since 9 dynamic * @since 20 static */ mapReadWriteAshmem(): void; @@ -3947,6 +4042,7 @@ declare namespace rpc { * @throws { BusinessError } 1900001 - Failed to call mmap. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ mapReadonlyAshmem(): void; @@ -3965,15 +4061,16 @@ declare namespace rpc { /** * Sets the protection level of the memory region to which the shared file is mapped. * - * @param { number } protectionType - Protection type to set. + * @param { int } protectionType - Protection type to set. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; * 2.The parameter type does not match. * @throws { BusinessError } 1900002 - Failed to call ioctl. * @syscap SystemCapability.Communication.IPC.Core * @since 9 dynamic + * @since 20 static */ - setProtectionType(protectionType: number): void; + setProtectionType(protectionType: int): void; /** * Writes data to the shared file associated with this Ashmem object. @@ -4013,8 +4110,8 @@ declare namespace rpc { * Writes data to the shared file associated with this Ashmem object. * * @param { ArrayBuffer } buf - Data to write - * @param { number } size - Size of the data to write - * @param { number } offset - Start position of the data to write in the memory region associated + * @param { int } size - Size of the data to write + * @param { int } offset - Start position of the data to write in the memory region associated * with this Ashmem object. * @throws { BusinessError } 401 - Parameter error. Possible causes: * 1.The number of parameters is incorrect; @@ -4023,8 +4120,9 @@ declare namespace rpc { * @throws { BusinessError } 1900003 - Failed to write data to the shared memory. * @syscap SystemCapability.Communication.IPC.Core * @since 11 dynamic + * @since 20 static */ - writeDataToAshmem(buf: ArrayBuffer, size: number, offset: number): void; + writeDataToAshmem(buf: ArrayBuffer, size: int, offset: int): void; /** * Reads data from the shared file associated with this Ashmem object. @@ -4061,8 +4159,8 @@ declare namespace rpc { /** * Reads data from the shared file associated with this Ashmem object. * - * @param { number } size - Size of the data to read. - * @param { number } offset - Start position of the data to read in the memory region associated + * @param { int } size - Size of the data to read. + * @param { int } offset - Start position of the data to read in the memory region associated * with this Ashmem object. * @returns { ArrayBuffer } Data read. * @throws { BusinessError } 401 - Parameter error. Possible causes: @@ -4071,8 +4169,9 @@ declare namespace rpc { * @throws { BusinessError } 1900004 - Failed to read data from the shared memory. * @syscap SystemCapability.Communication.IPC.Core * @since 11 dynamic + * @since 20 static */ - readDataFromAshmem(size: number, offset: number): ArrayBuffer; + readDataFromAshmem(size: int, offset: int): ArrayBuffer; } }