From 998ca115db9b934016dfbfa5ecbd5051addae469 Mon Sep 17 00:00:00 2001 From: xujunyang Date: Fri, 27 Jun 2025 11:13:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=97=B6=E5=8C=BA.d.ts?= =?UTF-8?q?=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xujunyang --- api/@ohos.systemDateTime.d.ets | 129 -------------------- api/@ohos.systemDateTime.d.ts | 57 +++++---- api/@ohos.systemTimer.d.ets | 212 --------------------------------- api/@ohos.systemTimer.d.ts | 103 +++++++++------- 4 files changed, 94 insertions(+), 407 deletions(-) delete mode 100644 api/@ohos.systemDateTime.d.ets delete mode 100644 api/@ohos.systemTimer.d.ets diff --git a/api/@ohos.systemDateTime.d.ets b/api/@ohos.systemDateTime.d.ets deleted file mode 100644 index 2fab9f2a04..0000000000 --- a/api/@ohos.systemDateTime.d.ets +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * @kit BasicServicesKit - */ - -import { AsyncCallback } from './@ohos.base'; - -/** - * System time and timezone. - * - * @namespace systemDateTime - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ -declare namespace systemDateTime { - /** - * Sets the system time. - * - * @permission ohos.permission.SET_TIME - * @param { long } time - Indicates the target timestamp(in milliseconds) - * @param { AsyncCallback } callback - The callback of setTime - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use - * @since 20 - */ - function setTime(time: long, callback: AsyncCallback): void; - - /** - * Sets the system time. - * - * @permission ohos.permission.SET_TIME - * @param { long } time - Indicates the target timestamp(in milliseconds) - * @returns { Promise } The promise returned by the function - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use - * @since 20 - */ - function setTime(time: long): Promise; - - /** - * Obtains the number of timestamp that have elapsed since the Unix epoch. - * - * @param { boolean } [ isNanoseconds ] - True if the result is in nanoseconds, otherwise in milliseconds - * @returns { long } The timestamp returned of getTime. - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - function getTime(isNanoseconds?: boolean): long; - - /** - * Indicates time type. - * - * @enum { int } TimeType - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - enum TimeType { - /** - * Indicates the time elapsed since the system was booted, including deep sleep time. - * - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - STARTUP, - - /** - * Indicates the time elapsed since the system was booted, not including deep sleep time. - * - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - ACTIVE - } - - /** - * Obtains the number of milliseconds since the system has been running. - * - * @param { TimeType } timeType - indicates the type of get uptime. It can only be `STARTUP` or `ACTIVE`. - * @param { boolean } [ isNanoseconds ] - True if the result is in nanoseconds, otherwise in milliseconds - * @returns { long } The timestamp returned of getUpTime. - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - function getUptime(timeType: TimeType, isNanoseconds?: boolean): long; - - /** - * Obtains the system time zone. - * - * @param { AsyncCallback } callback - The callback of getTimezone - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - function getTimezone(callback: AsyncCallback): void; - - /** - * Obtains the system time zone. - * - * @returns { Promise } The promise returned by the function - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - function getTimezone(): Promise; - - /** - * Obtains the system time zone. - * - * @returns { string } The timezone returned of getTimezoneSync. - * @syscap SystemCapability.MiscServices.Time - * @since 20 - */ - function getTimezoneSync(): string; -} - -export default systemDateTime; diff --git a/api/@ohos.systemDateTime.d.ts b/api/@ohos.systemDateTime.d.ts index bc106dd6d3..18e889b79f 100644 --- a/api/@ohos.systemDateTime.d.ts +++ b/api/@ohos.systemDateTime.d.ts @@ -33,37 +33,40 @@ import { AsyncCallback } from './@ohos.base'; * @namespace systemDateTime * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace systemDateTime { /** * Sets the system time. * * @permission ohos.permission.SET_TIME - * @param { number } time - Indicates the target timestamp(in milliseconds) + * @param { long } time - Indicates the target timestamp(in milliseconds) * @param { AsyncCallback } callback - The callback of setTime * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use - * @since 9 + * @since arkts{ '1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ - function setTime(time: number, callback: AsyncCallback): void; + function setTime(time: long, callback: AsyncCallback): void; /** * Sets the system time. * * @permission ohos.permission.SET_TIME - * @param { number } time - Indicates the target timestamp(in milliseconds) + * @param { long } time - Indicates the target timestamp(in milliseconds) * @returns { Promise } The promise returned by the function * @throws { BusinessError } 201 - Permission denied * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use - * @since 9 + * @since arkts{ '1.1':'9','1.2':'20'} + * @arkts 1.1&1.2 */ - function setTime(time: number): Promise; + function setTime(time: long): Promise; /** * Obtains the number of milliseconds that have elapsed since the Unix epoch. @@ -112,12 +115,13 @@ declare namespace systemDateTime { * Obtains the number of timestamp that have elapsed since the Unix epoch. * * @param { boolean } [ isNanoseconds ] - True if the result is in nanoseconds, otherwise in milliseconds - * @returns { number } The timestamp returned of getTime. + * @returns { long } The timestamp returned of getTime. * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ - function getTime(isNanoseconds?: boolean): number; + function getTime(isNanoseconds?: boolean): long; /** * Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time. @@ -199,10 +203,11 @@ declare namespace systemDateTime { /** * Indicates time type. * - * @enum { number } TimeType + * @enum { int } TimeType * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ enum TimeType { /** @@ -216,9 +221,10 @@ declare namespace systemDateTime { * * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ - STARTUP, + STARTUP = 0, /** * Indicates the time elapsed since the system was booted, not including deep sleep time. @@ -231,9 +237,10 @@ declare namespace systemDateTime { * * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ - ACTIVE + ACTIVE = 1 } /** @@ -261,14 +268,15 @@ declare namespace systemDateTime { * * @param { TimeType } timeType - indicates the type of get uptime. It can only be `STARTUP` or `ACTIVE`. * @param { boolean } [ isNanoseconds ] - True if the result is in nanoseconds, otherwise in milliseconds - * @returns { number } The timestamp returned of getUpTime. + * @returns { long } The timestamp returned of getUpTime. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types; * 3. Parameter verification failed. This error code was added due to missing issues. * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ - function getUptime(timeType: TimeType, isNanoseconds?: boolean): number; + function getUptime(timeType: TimeType, isNanoseconds?: boolean): long; /** * Sets the system time. @@ -290,7 +298,7 @@ declare namespace systemDateTime { /** * Sets the system time. - * + * * @permission ohos.permission.SET_TIME * @param { Date } date - The target date, it must > 0 * @returns { Promise } The promise returned by the function @@ -381,7 +389,8 @@ declare namespace systemDateTime { * @param { AsyncCallback } callback - The callback of getTimezone * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ function getTimezone(callback: AsyncCallback): void; @@ -406,7 +415,8 @@ declare namespace systemDateTime { * @returns { Promise } The promise returned by the function * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ function getTimezone(): Promise; @@ -423,7 +433,8 @@ declare namespace systemDateTime { * @returns { string } The timezone returned of getTimezoneSync. * @syscap SystemCapability.MiscServices.Time * @crossplatform - * @since 18 + * @since arkts{ '1.1':'18','1.2':'20'} + * @arkts 1.1&1.2 */ function getTimezoneSync(): string; diff --git a/api/@ohos.systemTimer.d.ets b/api/@ohos.systemTimer.d.ets deleted file mode 100644 index 9a70149919..0000000000 --- a/api/@ohos.systemTimer.d.ets +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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 - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @file - * @kit BasicServicesKit - */ - -import { AsyncCallback } from './@ohos.base'; - -/** - * Provides js api for systemTimer - * - * @namespace systemTimer - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ -declare namespace systemTimer { - /** - * Indicates the timing policy the timer use, which can be REALTIME or UTC. - * - * - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - const TIMER_TYPE_REALTIME: int; - - /** - * Describes whether a timer will wake the device up. - * - * - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - const TIMER_TYPE_WAKEUP: int; - - /** - * Describes whether a timer will be delivered precisely at a scheduled time. - * - * - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - const TIMER_TYPE_EXACT: int; - - /** - * Creates a timer. - * - * @param { TimerOptions } options - The timer options. - * @param { AsyncCallback } callback - {long} is the timer ID. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function createTimer(options: TimerOptions, callback: AsyncCallback): void; - - /** - * Creates a timer. - * - * @param { TimerOptions } options - The timer options. - * @returns { Promise } the timer ID. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function createTimer(options: TimerOptions): Promise; - - /** - * Starts a timer. - * - * @param { long } timer - The timer ID. - * @param { long } triggerTime - Indicates the time at which the timer is triggered for the first time, in - * milliseconds. The time will be automatically set to 5000 milliseconds after the current time if - * the passed value is smaller than the current time plus 5000 milliseconds. - * @param { AsyncCallback } callback - The callback function. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function startTimer(timer: long, triggerTime: long, callback: AsyncCallback): void; - - /** - * Starts a timer. - * - * @param { long } timer - The timer ID. - * @param { long } triggerTime - Indicates the time at which the timer is triggered for the first time, in - * milliseconds. The time will be automatically set to 5000 milliseconds after the current time if - * the passed value is smaller than the current time plus 5000 milliseconds. - * @returns { Promise } return a promise object. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function startTimer(timer: long, triggerTime: long): Promise; - - /** - * Stops a timer. - * - * @param { long } timer - The timer ID. - * @param { AsyncCallback } callback - The callback function. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function stopTimer(timer: long, callback: AsyncCallback): void; - - /** - * Stops a timer. - * - * @param { long } timer - The timer ID. - * @returns { Promise } return a promise object. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function stopTimer(timer: long): Promise; - - /** - * Destroy a timer. - * - * @param { long } timer - The timer ID. - * @param { AsyncCallback } callback - The callback function. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function destroyTimer(timer: long, callback: AsyncCallback): void; - - /** - * Destroy a timer. - * - * @param { long } timer - The timer ID. - * @returns { Promise } return a promise object. - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - function destroyTimer(timer: long): Promise; - - /** - * When the repeat is false,the interval is not needed, choose one of wantAgent and callback. - * When the repeat is true,the interval is required, the wantAgent is required, and the callback can be left blank. - * - * @interface TimerOptions - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - interface TimerOptions { - /** - * The timer type. - * - * @type { long } - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - type: long; - - /** - * Indicates a repeating timer - * - * @type { boolean } - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - repeat: boolean; - - /** - * Indicates the interval between two consecutive triggers, in milliseconds. - * The interval will be set to 5000 milliseconds automatically if the passed value is smaller than 5000. - * - * @type { ?long } - * @syscap SystemCapability.MiscServices.Time - * @systemapi Hide this for inner system use. - * @since 20 - */ - interval?: long; - - /** - * Indicates the name of the timer. - * The default value is empty string. - * The length of the name cannot be longer than 64 bytes, and the name can not be set the same name as other timers - * under the same UID. - * - * @type { ?string } - * @syscap SystemCapability.MiscServices.Time - * @systemapi - * @since 20 - */ - name?: string; - } -} - -export default systemTimer; \ No newline at end of file diff --git a/api/@ohos.systemTimer.d.ts b/api/@ohos.systemTimer.d.ts index 73eaaeeb20..4bd77636f1 100644 --- a/api/@ohos.systemTimer.d.ts +++ b/api/@ohos.systemTimer.d.ts @@ -27,7 +27,8 @@ import { WantAgent } from './@ohos.app.ability.wantAgent'; * @namespace systemTimer * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ declare namespace systemTimer { /** @@ -36,9 +37,10 @@ declare namespace systemTimer { * * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - const TIMER_TYPE_REALTIME: number; + const TIMER_TYPE_REALTIME: int; /** * Describes whether a timer will wake the device up. @@ -46,9 +48,10 @@ declare namespace systemTimer { * * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - const TIMER_TYPE_WAKEUP: number; + const TIMER_TYPE_WAKEUP: int; /** * Describes whether a timer will be delivered precisely at a scheduled time. @@ -56,9 +59,10 @@ declare namespace systemTimer { * * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - const TIMER_TYPE_EXACT: number; + const TIMER_TYPE_EXACT: int; /** * Indicates whether the timer waking up the system is supported in low-power mode. @@ -68,41 +72,43 @@ declare namespace systemTimer { * @systemapi Hide this for inner system use. * @since 7 */ - const TIMER_TYPE_IDLE: number; + const TIMER_TYPE_IDLE: int; /** * Creates a timer. * * @param { TimerOptions } options - The timer options. - * @param { AsyncCallback } callback - {number} is the timer ID. + * @param { AsyncCallback } callback - {long} is the timer ID. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; * 3.Parameter verification failed. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function createTimer(options: TimerOptions, callback: AsyncCallback): void; + function createTimer(options: TimerOptions, callback: AsyncCallback): void; /** * Creates a timer. * * @param { TimerOptions } options - The timer options. - * @returns { Promise } the timer ID. + * @returns { Promise } the timer ID. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types; * 3.Parameter verification failed. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function createTimer(options: TimerOptions): Promise; + function createTimer(options: TimerOptions): Promise; /** * Starts a timer. * - * @param { number } timer - The timer ID. - * @param { number } triggerTime - Indicates the time at which the timer is triggered for the first time, in milliseconds. + * @param { long } timer - The timer ID. + * @param { long } triggerTime - Indicates the time at which the timer is triggered for the first time, in milliseconds. * The time will be automatically set to 5000 milliseconds after the current time if the passed * value is smaller than the current time plus 5000 milliseconds. * @param { AsyncCallback } callback - The callback function. @@ -110,15 +116,16 @@ declare namespace systemTimer { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function startTimer(timer: number, triggerTime: number, callback: AsyncCallback): void; + function startTimer(timer: long, triggerTime: long, callback: AsyncCallback): void; /** * Starts a timer. * - * @param { number } timer - The timer ID. - * @param { number } triggerTime - Indicates the time at which the timer is triggered for the first time, in milliseconds. + * @param { long } timer - The timer ID. + * @param { long } triggerTime - Indicates the time at which the timer is triggered for the first time, in milliseconds. * The time will be automatically set to 5000 milliseconds after the current time if the passed * value is smaller than the current time plus 5000 milliseconds. * @returns { Promise } return a promise object. @@ -126,61 +133,66 @@ declare namespace systemTimer { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function startTimer(timer: number, triggerTime: number): Promise; + function startTimer(timer: long, triggerTime: long): Promise; /** * Stops a timer. * - * @param { number } timer - The timer ID. + * @param { long } timer - The timer ID. * @param { AsyncCallback } callback - The callback function. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function stopTimer(timer: number, callback: AsyncCallback): void; + function stopTimer(timer: long, callback: AsyncCallback): void; /** * Stops a timer. * - * @param { number } timer - The timer ID. + * @param { long } timer - The timer ID. * @returns { Promise } return a promise object. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function stopTimer(timer: number): Promise; + function stopTimer(timer: long): Promise; /** * Destroy a timer. * - * @param { number } timer - The timer ID. + * @param { long } timer - The timer ID. * @param { AsyncCallback } callback - The callback function. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function destroyTimer(timer: number, callback: AsyncCallback): void; + function destroyTimer(timer: long, callback: AsyncCallback): void; /** * Destroy a timer. * - * @param { number } timer - The timer ID. + * @param { long } timer - The timer ID. * @returns { Promise } return a promise object. * @throws { BusinessError } 202 - Permission verification failed. A non-system application calls a system API. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2.Incorrect parameter types. * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - function destroyTimer(timer: number): Promise; + function destroyTimer(timer: long): Promise; /** * When the repeat is false,the interval is not needed, choose one of wantAgent and callback. @@ -189,18 +201,20 @@ declare namespace systemTimer { * @interface TimerOptions * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ interface TimerOptions { /** * The timer type. * - * @type { number } + * @type { int } * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - type: number; + type: int; /** * Indicates a repeating timer @@ -208,7 +222,8 @@ declare namespace systemTimer { * @type { boolean } * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ repeat: boolean; @@ -216,12 +231,13 @@ declare namespace systemTimer { * Indicates the interval between two consecutive triggers, in milliseconds. * The interval will be set to 5000 milliseconds automatically if the passed value is smaller than 5000. * - * @type { ?number } + * @type { ?long } * @syscap SystemCapability.MiscServices.Time * @systemapi Hide this for inner system use. - * @since 7 + * @since arkts{ '1.1':'7','1.2':'20'} + * @arkts 1.1&1.2 */ - interval?: number; + interval?: long; /** * Indicates the intent to send when the timer goes off. @@ -263,7 +279,8 @@ declare namespace systemTimer { * @type { ?string } * @syscap SystemCapability.MiscServices.Time * @systemapi - * @since 15 + * @since arkts{ '1.1':'15','1.2':'20'} + * @arkts 1.1&1.2 */ name?: string; } -- Gitee