From 92379a84eebb737e2dd9ab677557e628c6fe807f Mon Sep 17 00:00:00 2001 From: guduhanyan Date: Wed, 22 Dec 2021 16:47:16 +0800 Subject: [PATCH 1/3] 20211222interfacelts00 Signed-off-by: guduhanyan --- api/@ohos.systemTime.d.ts | 55 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts index d69ec642af..be454c97d3 100755 --- a/api/@ohos.systemTime.d.ts +++ b/api/@ohos.systemTime.d.ts @@ -31,6 +31,47 @@ declare namespace systemTime { */ function setTime(time : number, callback : AsyncCallback) : void; function setTime(time : number) : Promise; + /** + * Obtains the number of milliseconds that have elapsed since the Unix epoch. + * @since 7 + */ + function getCurrentTime(callback: AsyncCallback): void; + function getCurrentTime(): Promise; + + /** + * Obtains the number of nanoseconds that have elapsed since the Unix epoch. + * @since 7 + */ + function getCurrentTimeNs(callback: AsyncCallback): void; + function getCurrentTimeNs(): Promise; + + /** + * Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time. + * @since 7 + */ + function getRealActiveTime(callback: AsyncCallback): void; + function getRealActiveTime(): Promise; + + /** + * Obtains the number of nanoseconds elapsed since the system was booted, not including deep sleep time. + * @since 7 + */ + function getRealActiveTimeNs(callback: AsyncCallback): void; + function getRealActiveTimeNs(): Promise; + + /** + * Obtains the number of milliseconds elapsed since the system was booted, including deep sleep time. + * @since 7 + */ + function getRealTime(callback: AsyncCallback): void; + function getRealTime(): Promise; + + /** + * Obtains the number of nanoseconds elapsed since the system was booted, including deep sleep time. + * @since 7 + */ + function getRealTimeNs(callback: AsyncCallback): void; + function getRealTimeNs(): Promise; /** * Sets the system time. @@ -41,6 +82,13 @@ declare namespace systemTime { function setDate(date: Date, callback: AsyncCallback): void; function setDate(date: Date): Promise; + /** + * Obtains the system date. + * @since 7 + */ + function getDate(callback: AsyncCallback): void; + function getDate(): Promise; + /** * Sets the system time zone. * @permission ohos.permission.SET_TIME_ZONE @@ -49,6 +97,13 @@ declare namespace systemTime { */ function setTimezone(timezone: string, callback: AsyncCallback): void; function setTimezone(timezone: string): Promise; + + /** + * Obtains the system time zone. + * @since 7 + */ + function getTimeZone(callback: AsyncCallback): void; + function getTimeZone(): Promise; } export default systemTime; -- Gitee From bd23251afe12c78f997629e2c0144f992fb81b87 Mon Sep 17 00:00:00 2001 From: guduhanyan Date: Fri, 24 Dec 2021 13:39:16 +0800 Subject: [PATCH 2/3] 20211224interfacelts00 Signed-off-by: guduhanyan --- api/@ohos.systemTime.d.ts | 20 ++++++++++---------- api/@ohos.systemTimer.d.ts | 23 +++++++++++++---------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts index be454c97d3..70037ed806 100755 --- a/api/@ohos.systemTime.d.ts +++ b/api/@ohos.systemTime.d.ts @@ -33,42 +33,42 @@ declare namespace systemTime { function setTime(time : number) : Promise; /** * Obtains the number of milliseconds that have elapsed since the Unix epoch. - * @since 7 + * @since 8 */ function getCurrentTime(callback: AsyncCallback): void; function getCurrentTime(): Promise; /** * Obtains the number of nanoseconds that have elapsed since the Unix epoch. - * @since 7 + * @since 8 */ function getCurrentTimeNs(callback: AsyncCallback): void; function getCurrentTimeNs(): Promise; /** * Obtains the number of milliseconds elapsed since the system was booted, not including deep sleep time. - * @since 7 + * @since 8 */ function getRealActiveTime(callback: AsyncCallback): void; function getRealActiveTime(): Promise; /** * Obtains the number of nanoseconds elapsed since the system was booted, not including deep sleep time. - * @since 7 + * @since 8 */ function getRealActiveTimeNs(callback: AsyncCallback): void; function getRealActiveTimeNs(): Promise; /** * Obtains the number of milliseconds elapsed since the system was booted, including deep sleep time. - * @since 7 + * @since 8 */ function getRealTime(callback: AsyncCallback): void; function getRealTime(): Promise; /** * Obtains the number of nanoseconds elapsed since the system was booted, including deep sleep time. - * @since 7 + * @since 8 */ function getRealTimeNs(callback: AsyncCallback): void; function getRealTimeNs(): Promise; @@ -84,7 +84,7 @@ declare namespace systemTime { /** * Obtains the system date. - * @since 7 + * @since 8 */ function getDate(callback: AsyncCallback): void; function getDate(): Promise; @@ -100,10 +100,10 @@ declare namespace systemTime { /** * Obtains the system time zone. - * @since 7 + * @since 8 */ - function getTimeZone(callback: AsyncCallback): void; - function getTimeZone(): Promise; + function getTimezone(callback: AsyncCallback): void; + function getTimezone(): Promise; } export default systemTime; diff --git a/api/@ohos.systemTimer.d.ts b/api/@ohos.systemTimer.d.ts index 987f9067a8..435aa603bd 100644 --- a/api/@ohos.systemTimer.d.ts +++ b/api/@ohos.systemTimer.d.ts @@ -46,48 +46,51 @@ declare namespace systemTimer { /** * Creates a timer. + * @since 7 * @Param options Indicates the timer options. * @Return timer ID. + * + * @systemapi Hide this for inner system use. */ function createTimer(options: TimerOptions, callback: AsyncCallback): void; function createTimer(options: TimerOptions): Promise; /** * Starts a timer. - * + *@since 7 * @Param timer The timer ID. * @Param 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. + * 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. + * @systemapi Hide this for inner system use. */ function startTimer(timer: number, triggerTime: number, callback: AsyncCallback): void; function startTimer(timer: number, triggerTime: number): Promise; /** * Stops a timer. + * @since 7 * @Param timer The timer ID. + * @systemapi Hide this for inner system use. */ function stopTimer(timer: number, callback: AsyncCallback): void; function stopTimer(timer: number): Promise; /** - * Destroy a timer. + * Clears a timer. + * @since 7 * @Param timer The timer ID. + * @systemapi Hide this for inner system use. */ function destroyTimer(timer: number, callback: AsyncCallback): void; function destroyTimer(timer: number): 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 { /** * timer type. */ type: number; - + /** * Indicates a repeating timer */ -- Gitee From 8c82e85186941721995bac3fbb058f6105b2aad8 Mon Sep 17 00:00:00 2001 From: guduhanyan Date: Fri, 24 Dec 2021 17:12:26 +0800 Subject: [PATCH 3/3] 20211224sdklts01 Signed-off-by: guduhanyan --- api/@ohos.systemTime.d.ts | 1 + api/@ohos.systemTimer.d.ts | 23 ++++++++++------------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/api/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts index 70037ed806..9071438b0e 100755 --- a/api/@ohos.systemTime.d.ts +++ b/api/@ohos.systemTime.d.ts @@ -31,6 +31,7 @@ declare namespace systemTime { */ function setTime(time : number, callback : AsyncCallback) : void; function setTime(time : number) : Promise; + /** * Obtains the number of milliseconds that have elapsed since the Unix epoch. * @since 8 diff --git a/api/@ohos.systemTimer.d.ts b/api/@ohos.systemTimer.d.ts index 435aa603bd..987f9067a8 100644 --- a/api/@ohos.systemTimer.d.ts +++ b/api/@ohos.systemTimer.d.ts @@ -46,51 +46,48 @@ declare namespace systemTimer { /** * Creates a timer. - * @since 7 * @Param options Indicates the timer options. * @Return timer ID. - * - * @systemapi Hide this for inner system use. */ function createTimer(options: TimerOptions, callback: AsyncCallback): void; function createTimer(options: TimerOptions): Promise; /** * Starts a timer. - *@since 7 + * * @Param timer The timer ID. * @Param 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. - * @systemapi Hide this for inner system use. + * 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. */ function startTimer(timer: number, triggerTime: number, callback: AsyncCallback): void; function startTimer(timer: number, triggerTime: number): Promise; /** * Stops a timer. - * @since 7 * @Param timer The timer ID. - * @systemapi Hide this for inner system use. */ function stopTimer(timer: number, callback: AsyncCallback): void; function stopTimer(timer: number): Promise; /** - * Clears a timer. - * @since 7 + * Destroy a timer. * @Param timer The timer ID. - * @systemapi Hide this for inner system use. */ function destroyTimer(timer: number, callback: AsyncCallback): void; function destroyTimer(timer: number): 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 { /** * timer type. */ type: number; - + /** * Indicates a repeating timer */ -- Gitee