From a3ea7160c3334b8ad3fa9151c5ba34f91095857e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E9=98=B3=E6=BA=A2?= Date: Wed, 30 Jul 2025 14:54:30 +0800 Subject: [PATCH] FormKit Overload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 卢阳溢 --- api/@ohos.app.form.formProvider.d.ts | 57 ++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts index f3ad3e4414..8538f969bc 100644 --- a/api/@ohos.app.form.formProvider.d.ts +++ b/api/@ohos.app.form.formProvider.d.ts @@ -77,8 +77,7 @@ declare namespace formProvider { * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback): void; @@ -117,8 +116,7 @@ declare namespace formProvider { * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ function setFormNextRefreshTime(formId: string, minute: number): Promise; @@ -594,5 +592,56 @@ declare namespace formProvider { * @since 20 */ function getFormRect(formId: string): Promise; + + /** + * Set next update time for a specified form. + * + * @param { string } formId - Indicates the form ID. + * @param { number } minute - Indicates duration minute before next update. + * @param { AsyncCallback } callback - The callback of setFormNextRefreshTime. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. + * @throws { BusinessError } 16500050 - IPC connection error. + * @throws { BusinessError } 16500060 - Service connection error. + * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. + * @throws { BusinessError } 16501000 - An internal functional error occurred. + * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. + * @throws { BusinessError } 16501002 - The number of forms exceeds the maximum allowed. + * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. + * @syscap SystemCapability.Ability.Form + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function setFormNextRefreshTimeWithCallback(formId: string, minute: number, callback: AsyncCallback): void; + + /** + * Set next update time for a specified form. + * + * @param { string } formId - Indicates the form ID. + * @param { number } minute - Indicates duration minute before next update. + * @returns { Promise } The promise returned by the function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + * 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; 3.Parameter verification failed. + * @throws { BusinessError } 16500050 - IPC connection error. + * @throws { BusinessError } 16500060 - Service connection error. + * @throws { BusinessError } 16500100 - Failed to obtain the configuration information. + * @throws { BusinessError } 16501000 - An internal functional error occurred. + * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. + * @throws { BusinessError } 16501002 - The number of forms exceeds the maximum allowed. + * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. + * @syscap SystemCapability.Ability.Form + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + function setFormNextRefreshTimeReturnsPromise(formId: string, minute: number): Promise; + + /** + * Set next update time for a specified form. + * @since 20 + * @arkts 1.2 + */ + overload setFormNextRefreshTime { setFormNextRefreshTimeWithCallback, setFormNextRefreshTimeReturnsPromise }; } export default formProvider; -- Gitee