diff --git a/api/@ohos.request.d.ts b/api/@ohos.request.d.ts index 765fb4a1efd14d35e050b1d8625ac883640f7b2c..ee238f8c9dbb4e759a7851261ece804d160fd78b 100644 --- a/api/@ohos.request.d.ts +++ b/api/@ohos.request.d.ts @@ -2807,6 +2807,39 @@ declare namespace request { text?: string; } + /** + * Options of the custom task timeout. + * + * @typedef Timeout + * @syscap SystemCapability.Request.FileTransferAgent + * @since 20 + */ + interface Timeout { + /** + * The connection timeout of the task, in seconds. + * Connection timeout is the maximum time required for a client and a server to establish a connection. + * If this value is not specified, use default value instead. The default value is 60 seconds. + * The minimum value allowed is 1 second. + * + * @type { ?number } + * @syscap SystemCapability.Request.FileTransferAgent + * @since 20 + */ + connectionTimeout?: number; + /** + * Total timeout of the task, in seconds. + * Total timeout includes the time to establish a connection, send a request and receive a response. + * If this value is not specified, use default value instead. The default value is 604,800 seconds(1 week). + * The minimum value allowed is 1 second. + * The maximum value allowed is 604,800 seconds(1 week). + * + * @type { ?number } + * @syscap SystemCapability.Request.FileTransferAgent + * @since 20 + */ + totalTimeout?: number; + } + /** * The configurations for a task. * Using a flexible configuration for clear upload and download functions. @@ -3370,6 +3403,14 @@ declare namespace request { * @since 15 */ notification?: Notification; + /** + * Customizes the timeout of the task. + * + * @type { ?Timeout } + * @syscap SystemCapability.Request.FileTransferAgent + * @since 20 + */ + timeout?: Timeout; } /**