diff --git a/interfaces/kits/js/declaration/api/@ohos.systemTime.d.ts b/interfaces/kits/js/declaration/api/@ohos.systemTime.d.ts index 70037ed..9071438 100644 --- a/interfaces/kits/js/declaration/api/@ohos.systemTime.d.ts +++ b/interfaces/kits/js/declaration/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/interfaces/kits/js/declaration/api/@ohos.systemtimer.d.ts b/interfaces/kits/js/declaration/api/@ohos.systemtimer.d.ts index 3246cb4..987f906 100644 --- a/interfaces/kits/js/declaration/api/@ohos.systemtimer.d.ts +++ b/interfaces/kits/js/declaration/api/@ohos.systemtimer.d.ts @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AsyncCallback, ErrorCallback } from './basic'; import { WantAgent } from './@ohos.wantAgent'; @@ -45,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, 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 */ diff --git a/interfaces/kits/js/napi/system_time/src/js_systemtime.cpp b/interfaces/kits/js/napi/system_time/src/js_systemtime.cpp index 97ae0dc..cbeda24 100644 --- a/interfaces/kits/js/napi/system_time/src/js_systemtime.cpp +++ b/interfaces/kits/js/napi/system_time/src/js_systemtime.cpp @@ -732,7 +732,7 @@ napi_value SystemTimeExport(napi_env env, napi_value exports) DECLARE_NAPI_FUNCTION("getRealTime", JSSystemTimeGetRealTime), DECLARE_NAPI_FUNCTION("getRealTimeNs", JSSystemTimeGetRealTimeNs), DECLARE_NAPI_FUNCTION("getDate", JSSystemTimeGetDate), - DECLARE_NAPI_FUNCTION("getTimeZone", JSSystemTimeGetTimeZone), + DECLARE_NAPI_FUNCTION("getTimezone", JSSystemTimeGetTimeZone), }; NAPI_CALL(env, napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc)); return exports;