From cb8479870af2c5ac47b88d62b88f75974158e55d Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Wed, 16 Mar 2022 10:39:37 +0800 Subject: [PATCH] houhaoyu@huawei.com adjust interface structure Signed-off-by: houhaoyu Change-Id: Ia2a611651903abdecfc14e1ffee0e89d2b863020 --- BUILD.gn | 31 +- api/{common => }/@system.app.d.ts | 0 api/{common => }/@system.cipher.d.ts | 0 api/{common => }/@system.configuration.d.ts | 0 api/{common => }/@system.file.d.ts | 0 api/{common => }/@system.mediaquery.d.ts | 0 api/{common => }/@system.notification.d.ts | 0 api/{common => }/@system.prompt.d.ts | 0 api/{common => }/@system.router.d.ts | 6 +- api/common/{@internal => full}/console.d.ts | 2 +- api/common/{@internal => full}/dom.d.ts | 0 api/common/{@internal => full}/global.d.ts | 4 +- api/common/{@internal => full}/index.d.ts | 0 api/common/{@internal => full}/viewmodel.d.ts | 0 .../@internal => common/lite}/console.d.ts | 0 .../@internal => common/lite}/global.d.ts | 6 + .../@internal => common/lite}/index.d.ts | 0 .../@internal => common/lite}/viewmodel.d.ts | 0 api/liteWearable/@system.app.d.ts | 81 --- api/liteWearable/@system.configuration.d.ts | 46 -- api/liteWearable/@system.file.d.ts | 570 ------------------ api/liteWearable/@system.router.d.ts | 47 -- interface_config.gni | 13 +- 23 files changed, 36 insertions(+), 770 deletions(-) rename api/{common => }/@system.app.d.ts (100%) rename api/{common => }/@system.cipher.d.ts (100%) rename api/{common => }/@system.configuration.d.ts (100%) rename api/{common => }/@system.file.d.ts (100%) rename api/{common => }/@system.mediaquery.d.ts (100%) rename api/{common => }/@system.notification.d.ts (100%) rename api/{common => }/@system.prompt.d.ts (100%) rename api/{common => }/@system.router.d.ts (98%) rename api/common/{@internal => full}/console.d.ts (96%) rename api/common/{@internal => full}/dom.d.ts (100%) rename api/common/{@internal => full}/global.d.ts (98%) rename api/common/{@internal => full}/index.d.ts (100%) rename api/common/{@internal => full}/viewmodel.d.ts (100%) rename api/{liteWearable/@internal => common/lite}/console.d.ts (100%) rename api/{liteWearable/@internal => common/lite}/global.d.ts (92%) rename api/{liteWearable/@internal => common/lite}/index.d.ts (100%) rename api/{liteWearable/@internal => common/lite}/viewmodel.d.ts (100%) delete mode 100644 api/liteWearable/@system.app.d.ts delete mode 100644 api/liteWearable/@system.configuration.d.ts delete mode 100644 api/liteWearable/@system.file.d.ts delete mode 100644 api/liteWearable/@system.router.d.ts diff --git a/BUILD.gn b/BUILD.gn index d0736d097..f120e5ee0 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -163,10 +163,11 @@ ohos_declaration_template("ohos_declaration_common") { ohos_copy("internal_full") { sources = [ - "api/common/@internal/console.d.ts", - "api/common/@internal/global.d.ts", - "api/common/@internal/index.d.ts", - "api/common/@internal/viewmodel.d.ts", + "api/common/full/console.d.ts", + "api/common/full/dom.d.ts", + "api/common/full/global.d.ts", + "api/common/full/index.d.ts", + "api/common/full/viewmodel.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -175,10 +176,10 @@ ohos_copy("internal_full") { ohos_copy("internal_lite") { sources = [ - "api/liteWearable/@internal/console.d.ts", - "api/liteWearable/@internal/global.d.ts", - "api/liteWearable/@internal/index.d.ts", - "api/liteWearable/@internal/viewmodel.d.ts", + "api/common/lite/console.d.ts", + "api/common/lite/global.d.ts", + "api/common/lite/index.d.ts", + "api/common/lite/viewmodel.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" @@ -194,13 +195,13 @@ ohos_copy("syscap_check") { ohos_copy("system_api") { sources = [ - "api/common/@system.app.d.ts", - "api/common/@system.cipher.d.ts", - "api/common/@system.configuration.d.ts", - "api/common/@system.file.d.ts", - "api/common/@system.mediaquery.d.ts", - "api/common/@system.prompt.d.ts", - "api/common/@system.router.d.ts", + "api/@system.app.d.ts", + "api/@system.cipher.d.ts", + "api/@system.configuration.d.ts", + "api/@system.file.d.ts", + "api/@system.mediaquery.d.ts", + "api/@system.prompt.d.ts", + "api/@system.router.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" diff --git a/api/common/@system.app.d.ts b/api/@system.app.d.ts similarity index 100% rename from api/common/@system.app.d.ts rename to api/@system.app.d.ts diff --git a/api/common/@system.cipher.d.ts b/api/@system.cipher.d.ts similarity index 100% rename from api/common/@system.cipher.d.ts rename to api/@system.cipher.d.ts diff --git a/api/common/@system.configuration.d.ts b/api/@system.configuration.d.ts similarity index 100% rename from api/common/@system.configuration.d.ts rename to api/@system.configuration.d.ts diff --git a/api/common/@system.file.d.ts b/api/@system.file.d.ts similarity index 100% rename from api/common/@system.file.d.ts rename to api/@system.file.d.ts diff --git a/api/common/@system.mediaquery.d.ts b/api/@system.mediaquery.d.ts similarity index 100% rename from api/common/@system.mediaquery.d.ts rename to api/@system.mediaquery.d.ts diff --git a/api/common/@system.notification.d.ts b/api/@system.notification.d.ts similarity index 100% rename from api/common/@system.notification.d.ts rename to api/@system.notification.d.ts diff --git a/api/common/@system.prompt.d.ts b/api/@system.prompt.d.ts similarity index 100% rename from api/common/@system.prompt.d.ts rename to api/@system.prompt.d.ts diff --git a/api/common/@system.router.d.ts b/api/@system.router.d.ts similarity index 98% rename from api/common/@system.router.d.ts rename to api/@system.router.d.ts index 124af8658..27f7c7835 100644 --- a/api/common/@system.router.d.ts +++ b/api/@system.router.d.ts @@ -155,6 +155,10 @@ export interface DisableAlertBeforeBackPageOptions { complete?: () => void; } +type ParamsInterface = { + [key: string]: Object; +}; + /** * Defines the Router interface. * @syscap SystemCapability.ArkUI.ArkUI.Lite @@ -191,7 +195,7 @@ export default class Router { * @returns Page params. * @since 7 */ - static getParams(): Object; + static getParams(): ParamsInterface; /** * Clears all historical pages and retains only the current page at the top of the stack. diff --git a/api/common/@internal/console.d.ts b/api/common/full/console.d.ts similarity index 96% rename from api/common/@internal/console.d.ts rename to api/common/full/console.d.ts index 2c5c44309..4aac0b1c9 100644 --- a/api/common/@internal/console.d.ts +++ b/api/common/full/console.d.ts @@ -14,7 +14,7 @@ */ /** - * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 3 */ export declare class console { diff --git a/api/common/@internal/dom.d.ts b/api/common/full/dom.d.ts similarity index 100% rename from api/common/@internal/dom.d.ts rename to api/common/full/dom.d.ts diff --git a/api/common/@internal/global.d.ts b/api/common/full/global.d.ts similarity index 98% rename from api/common/@internal/global.d.ts rename to api/common/full/global.d.ts index 208039014..a4e0509c1 100644 --- a/api/common/@internal/global.d.ts +++ b/api/common/full/global.d.ts @@ -53,7 +53,7 @@ export declare function cancelAnimationFrame(requestId: number): void; /** * Cancels the interval set by " setInterval()". - * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param intervalID Indicates the timer ID returned by "setInterval()". * @since 3 */ @@ -61,7 +61,7 @@ export declare function clearInterval(intervalID?: number): void; /** * Cancels the timer set by "setTimeout()". - * @syscap SystemCapability.ArkUI.ArkUI.Lite + * @syscap SystemCapability.ArkUI.ArkUI.Full * @param timeoutID Indicates the timer ID returned by "setTimeout()". * @since 3 */ diff --git a/api/common/@internal/index.d.ts b/api/common/full/index.d.ts similarity index 100% rename from api/common/@internal/index.d.ts rename to api/common/full/index.d.ts diff --git a/api/common/@internal/viewmodel.d.ts b/api/common/full/viewmodel.d.ts similarity index 100% rename from api/common/@internal/viewmodel.d.ts rename to api/common/full/viewmodel.d.ts diff --git a/api/liteWearable/@internal/console.d.ts b/api/common/lite/console.d.ts similarity index 100% rename from api/liteWearable/@internal/console.d.ts rename to api/common/lite/console.d.ts diff --git a/api/liteWearable/@internal/global.d.ts b/api/common/lite/global.d.ts similarity index 92% rename from api/liteWearable/@internal/global.d.ts rename to api/common/lite/global.d.ts index f0013e4bf..343958fda 100644 --- a/api/liteWearable/@internal/global.d.ts +++ b/api/common/lite/global.d.ts @@ -60,3 +60,9 @@ export declare const STANDARD: string; * Conditional compilation for lite equipment */ export declare const LITE: string; + +/** + * Defining syscap function. + * @since 8 + */ +export declare function canIUse(syscap: string): boolean; diff --git a/api/liteWearable/@internal/index.d.ts b/api/common/lite/index.d.ts similarity index 100% rename from api/liteWearable/@internal/index.d.ts rename to api/common/lite/index.d.ts diff --git a/api/liteWearable/@internal/viewmodel.d.ts b/api/common/lite/viewmodel.d.ts similarity index 100% rename from api/liteWearable/@internal/viewmodel.d.ts rename to api/common/lite/viewmodel.d.ts diff --git a/api/liteWearable/@system.app.d.ts b/api/liteWearable/@system.app.d.ts deleted file mode 100644 index 1da69498d..000000000 --- a/api/liteWearable/@system.app.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface AppResponse { - /** - * Application name - * @since 3 - */ - appName: string; - - /** - * Application version name - * @since 3 - */ - versionName: string; - - /** - * Application version - * @since 3 - */ - versionCode: number; -} - -export interface ScreenOnVisibleOptions { - /** - * Whether to keep the application visible. The default value is false. - * @since 3 - */ - visible?: boolean; - - /** - * Called when the application always keeps visible. - * @since 3 - */ - success?: () => void; - - /** - * Called when the application fails to keep visible. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; -} - -/** - * @syscap SystemCapability.ArkUI.ArkUI.Lite - */ -export default class App { - /** - * Obtains the declared information in the config.json file of an application. - */ - static getInfo(): AppResponse; - - /** - * Destroys the current ability. - */ - static terminate(): void; - - /** - * Keeps the application visible after the screen is woken up. - * This method prevents the system from returning to the home screen when the screen is locked. - */ - static screenOnVisible(options?: ScreenOnVisibleOptions): void; -} diff --git a/api/liteWearable/@system.configuration.d.ts b/api/liteWearable/@system.configuration.d.ts deleted file mode 100644 index 1d774e43b..000000000 --- a/api/liteWearable/@system.configuration.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface LocaleResponse { - /** - * Current language of the application. Example: zh. - * @since 3 - */ - language: string; - - /** - * Country or region. Example: CN - * @since 3 - */ - countryOrRegion: string; - - /** - * Text layout direction. Available values are as follows: - * 1. ltr: The text direction is from left to right. - * 2. rtl: The text direction is from right to left. - * @since 3 - */ - dir: "ltr" | "rtl"; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class Configuration { - /** - * Obtains the current locale of the application, which is the same as the system locale. - */ - static getLocale(): LocaleResponse; -} diff --git a/api/liteWearable/@system.file.d.ts b/api/liteWearable/@system.file.d.ts deleted file mode 100644 index fdbce9868..000000000 --- a/api/liteWearable/@system.file.d.ts +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface FileResponse { - /** - * File URI. - * @since 3 - */ - uri: string; - - /** - * File size, in bytes. - * If type is dir, the length value is fixed to 0. - * @since 3 - */ - length: number; - - /** - * Timestamp when the file is stored, which is the number of milliseconds elapsed since 1970/01/01 00:00:00 GMT. - * For lite wearables, the value is fixed to 0, because this parameter is restricted by the underlying file system. - * @since 3 - */ - lastModifiedTime: number; - - /** - * File type. Available values are as follows: - * dir: directory - * file: file - * @since 3 - */ - type: "dir" | "file"; - - /** - * File list. - * When the recursive value is true and the type is dir, the file information under the subdirectory will be returned. - * Otherwise, no value will be returned. - * @since 3 - */ - subFiles?: Array; -} - -/** - * @Syscap SysCap.ACE.UIEngineLite - */ -export default class File { - /** - * Moves a specified file to a given location. - * @param options Options. - */ - static move(options: { - /** - * URI of the file to move. - * Restricted by the underlying file system of lite wearabless, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - srcUri: string; - - /** - * URI of the location to which the file is to move. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - dstUri: string; - - /** - * Called when the source file is moved to the specified location successfully. - * This function returns the URI of the file moved to the target location. - * @since 3 - */ - success?: (uri: string) => void; - - /** - * Called when moving fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Copies a file and save the copy to a specified location. - * @param options Options. - */ - static copy(options: { - /** - * URI of the file to copy. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - srcUri: string; - - /** - * URI of the location to which the copy is to save. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - dstUri: string; - - /** - * Called when the source file is copied and saved to the specified location successfully. - * This function returns the URI of the file saved to the target location. - * @since 3 - */ - success?: (uri: string) => void; - - /** - * Called when the copy or save operation fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains the list of all files in a specified directory. - * @param options Options. - */ - static list(options: { - /** - * URI of the directory. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Called when the list is obtained successfully. - * @since 3 - */ - success?: (data: { fileList: Array }) => void; - - /** - * Called when the list fails to be obtained. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Obtains information about a specified local file. - * @param options Options. - */ - static get(options: { - /** - * File URI, which cannot be an application resource path. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Whether to recursively obtain the file list under a subdirectory. - * The default value is false. - * @since 3 - */ - recursive?: boolean; - - /** - * Called when file information is obtained successfully. - * @since 3 - */ - success?: (file: FileResponse) => void; - - /** - * Called when file information fails to be obtained. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Deletes a local file. - * @param options Options. - */ - static delete(options: { - /** - * URI of the file to be deleted, which cannot be an application resource path. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Called when local files are deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the deletion fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Writes texts into a specified file. - * @param options Options. - */ - static writeText(options: { - /** - * URI of a local file. If it does not exist, a file will be created. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Character string to write into the local file. - * @since 3 - */ - text: string; - - /** - * Encoding format. The default format is UTF-8. - * Currently, only UTF-8 is supported. - * @since 3 - */ - encoding?: string; - - /** - * Whether to enable the append mode. - * The default value is false. - * @since 3 - */ - append?: boolean; - - /** - * Called when texts are written into a file successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when texts fail to be written into a file. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Reads texts from a specified file. - * @param options Options. - */ - static readText(options: { - /** - * URI of a local file. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Encoding format. The default format is UTF-8. - * Currently, only UTF-8 is supported. - * @since 3 - */ - encoding?: string; - - /** - * Position where the reading starts. - * The default value is the start position of the file. - * @since 3 - */ - position?: number; - - /** - * Position where the reading starts. - * The default value is the start position of the file. - * @since 3 - */ - length?: number; - - /** - * Called when texts are read successfully. - * @since 3 - */ - success?: (data: { text: string }) => void; - - /** - * Called when texts fail to be read. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Writes buffer data into a specified file. - * @param options Options. - */ - static writeArrayBuffer(options: { - /** - * URI of a local file. If it does not exist, a file will be created. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Buffer from which the data is derived. - * @since 3 - */ - buffer: Uint8Array; - - /** - * Offset to the position where the writing starts. - * The default value is 0. - * @since 3 - */ - position?: number; - - /** - * Whether to enable the append mode. The default value is false. - * If the value is true, the position parameter will become invalid. - * @since 3 - */ - append?: boolean; - - /** - * Called when data from a buffer is written into a file successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when data from a buffer fails to be written into a file. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Reads buffer data from a specified file. - * @param options Options. - */ - static readArrayBuffer(options: { - /** - * URI of a local file. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Position where the reading starts. - * The default value is the start position of the file. - * @since 3 - */ - position?: number; - - /** - * Length of the content to read. - * If this parameter is not set, all content of the file will be read. - * @since 3 - */ - length?: number; - - /** - * Called when the buffer data is read successfully. - * @since 3 - */ - success?: (data: { buffer: Uint8Array }) => void; - - /** - * Called when the buffer data fails to be read. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Checks whether a specified file or directory exists. - * @param options Options. - */ - static access(options: { - /** - * URI of the directory or file. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Called when the check result is obtained successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the check fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Create a specified directory. - * @param options Options. - */ - static mkdir(options: { - /** - * URI of the directory. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * 3. A maximum of five recursions are allowed for creating the directory. - * @since 3 - */ - uri: string; - - /** - * Whether to recursively create upper-level directories of the specified directory. - * The default value is false. - * @since 3 - */ - recursive?: boolean; - - /** - * Called when the directory is created successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the creation fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; - - /** - * Deletes a specified directory. - * @param options Options. - */ - static rmdir(options: { - /** - * URI of the directory. - * Restricted by the underlying file system of lite wearables, the value must meet the following requirements: - * 1. The URI cannot contain special characters such as \/"*+,:;<=>?[]|\x7F. - * 2. The maximum number of characters allowed is 128. - * @since 3 - */ - uri: string; - - /** - * Whether to recursively delete sub files and subdirectories of the specified directory. - * The default value is false. - * @since 3 - */ - recursive?: boolean; - - /** - * Called when the directory is deleted successfully. - * @since 3 - */ - success?: () => void; - - /** - * Called when the deletion fails. - * @since 3 - */ - fail?: (data: string, code: number) => void; - - /** - * Called when the execution is completed. - * @since 3 - */ - complete?: () => void; - }): void; -} diff --git a/api/liteWearable/@system.router.d.ts b/api/liteWearable/@system.router.d.ts deleted file mode 100644 index 100ba9998..000000000 --- a/api/liteWearable/@system.router.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2020 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. - */ - -export interface RouterOptions { - /** - * URI of the destination page, which supports the following formats: - * 1. Absolute path of the page, which is provided by the pages list in the config.json file. - * Example: - * a. pages/index/index - * b. pages/detail/detail - * 2. Particular path. If the URI is a slash (/), the home page is displayed. - * @since 3 - */ - uri: string; - - /** - * Data that needs to be passed to the destination page during navigation. - * After the destination page is displayed, the parameter can be directly used for the page. - * For example, this.data1 (data1 is the key value of the params used for page navigation.) - * @since 3 - */ - params?: object; -} - -/** - * @syscap SystemCapability.ArkUI.ArkUI.Lite - */ -export default class Router { - /** - * Replaces the current page with another one in the application. - * The current page is destroyed after replacement. - * @param route route options. - */ - static replace(route: RouterOptions): void; -} diff --git a/interface_config.gni b/interface_config.gni index f28ccc612..e5d3bd01f 100644 --- a/interface_config.gni +++ b/interface_config.gni @@ -12,11 +12,10 @@ # limitations under the License. common_api_src = [ - "//interface/sdk-js/api/@ohos.wifi.d.ts", - "//interface/sdk-js/api/common/@system.app.d.ts", - "//interface/sdk-js/api/common/@system.configuration.d.ts", - "//interface/sdk-js/api/common/@system.file.d.ts", - "//interface/sdk-js/api/common/@system.mediaquery.d.ts", - "//interface/sdk-js/api/common/@system.prompt.d.ts", - "//interface/sdk-js/api/common/@system.router.d.ts", + "//interface/sdk-js/api/@system.app.d.ts", + "//interface/sdk-js/api/@system.configuration.d.ts", + "//interface/sdk-js/api/@system.file.d.ts", + "//interface/sdk-js/api/@system.mediaquery.d.ts", + "//interface/sdk-js/api/@system.prompt.d.ts", + "//interface/sdk-js/api/@system.router.d.ts", ]