diff --git a/BUILD.gn b/BUILD.gn index e1f24e6f1..9e3164720 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -120,6 +120,35 @@ ohos_copy("common_api") { module_install_name = "" } +template("ohos_declaration_template") { + forward_variables_from(invoker, "*") + action_with_pydeps(target_name) { + script = "//interface/sdk-js/remove_internal.py" + outputs = [ root_out_dir + "/$target_name/" ] + args = [ + "--input", + rebase_path("//interface/sdk-js/api", root_build_dir), + "--output", + rebase_path(root_out_dir + "/ohos_declaration/$target_name/", + root_build_dir), + ] + } + _module_info_target = "/ohos_declaration/${target_name}_info" + _target_name = target_name + generate_module_info(_module_info_target) { + module_type = "jsdoc" + module_install_name = "" + module_name = _target_name + module_source_dir = root_out_dir + "/ohos_declaration/$_target_name" + install_enable = false + } +} + +ohos_declaration_template("ohos_declaration_ets") { +} +ohos_declaration_template("ohos_declaration_phone") { +} + ohos_copy("ace_platform") { sources = [ "api/config", @@ -129,3 +158,14 @@ ohos_copy("ace_platform") { module_source_dir = target_out_dir + "/$target_name" module_install_name = "" } + +ohos_copy("form_declaration") { + sources = [ + "api/form/action", + "api/form/css", + "api/form/hml", + ] + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} diff --git a/api/phone/@ohos.account.distributedaccount.d.ts b/api/@ohos.account.distributedaccount.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.account.distributedaccount.d.ts rename to api/@ohos.account.distributedaccount.d.ts diff --git a/api/phone/@ohos.batteryinfo.d.ts b/api/@ohos.batteryinfo.d.ts similarity index 100% rename from api/phone/@ohos.batteryinfo.d.ts rename to api/@ohos.batteryinfo.d.ts diff --git a/api/phone/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts similarity index 100% rename from api/phone/@ohos.brightness.d.ts rename to api/@ohos.brightness.d.ts diff --git a/api/phone/@ohos.bundle_mgr.d.ts b/api/@ohos.bundle_mgr.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.bundle_mgr.d.ts rename to api/@ohos.bundle_mgr.d.ts diff --git a/api/phone/@ohos.commonevent.d.ts b/api/@ohos.commonevent.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.commonevent.d.ts rename to api/@ohos.commonevent.d.ts diff --git a/api/phone/@ohos.data.distributeddata.d.ts b/api/@ohos.data.distributeddata.d.ts similarity index 100% rename from api/phone/@ohos.data.distributeddata.d.ts rename to api/@ohos.data.distributeddata.d.ts diff --git a/api/phone/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts similarity index 100% rename from api/phone/@ohos.data.storage.d.ts rename to api/@ohos.data.storage.d.ts diff --git a/api/phone/@ohos.deviceinfo.d.ts b/api/@ohos.deviceinfo.d.ts similarity index 100% rename from api/phone/@ohos.deviceinfo.d.ts rename to api/@ohos.deviceinfo.d.ts diff --git a/api/phone/@ohos.distributedHardware.deviceManager.d.ts b/api/@ohos.distributedHardware.deviceManager.d.ts similarity index 100% rename from api/phone/@ohos.distributedHardware.deviceManager.d.ts rename to api/@ohos.distributedHardware.deviceManager.d.ts diff --git a/api/phone/@ohos.feature_ability.d.ts b/api/@ohos.feature_ability.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.feature_ability.d.ts rename to api/@ohos.feature_ability.d.ts diff --git a/api/phone/@ohos.fileio.d.ts b/api/@ohos.fileio.d.ts similarity index 100% rename from api/phone/@ohos.fileio.d.ts rename to api/@ohos.fileio.d.ts diff --git a/api/phone/@ohos.intl.d.ts b/api/@ohos.intl.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.intl.d.ts rename to api/@ohos.intl.d.ts diff --git a/api/phone/@ohos.multimedia.audio.d.ts b/api/@ohos.multimedia.audio.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.multimedia.audio.d.ts rename to api/@ohos.multimedia.audio.d.ts diff --git a/api/phone/@ohos.multimedia.media.d.ts b/api/@ohos.multimedia.media.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.multimedia.media.d.ts rename to api/@ohos.multimedia.media.d.ts diff --git a/api/phone/@ohos.napi_ability_manager.d.ts b/api/@ohos.napi_ability_manager.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.napi_ability_manager.d.ts rename to api/@ohos.napi_ability_manager.d.ts diff --git a/api/phone/@ohos.power.d.ts b/api/@ohos.power.d.ts similarity index 100% rename from api/phone/@ohos.power.d.ts rename to api/@ohos.power.d.ts diff --git a/api/phone/@ohos.resourceManager.d.ts b/api/@ohos.resourceManager.d.ts similarity index 100% rename from api/phone/@ohos.resourceManager.d.ts rename to api/@ohos.resourceManager.d.ts diff --git a/api/phone/@ohos.runninglock.d.ts b/api/@ohos.runninglock.d.ts similarity index 100% rename from api/phone/@ohos.runninglock.d.ts rename to api/@ohos.runninglock.d.ts diff --git a/api/phone/@ohos.systemTime.d.ts b/api/@ohos.systemTime.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.systemTime.d.ts rename to api/@ohos.systemTime.d.ts diff --git a/api/phone/@ohos.systemparameter.d.ts b/api/@ohos.systemparameter.d.ts similarity index 100% rename from api/phone/@ohos.systemparameter.d.ts rename to api/@ohos.systemparameter.d.ts diff --git a/api/phone/@ohos.telephony.call.d.ts b/api/@ohos.telephony.call.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.call.d.ts rename to api/@ohos.telephony.call.d.ts diff --git a/api/phone/@ohos.telephony.data.d.ts b/api/@ohos.telephony.data.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.data.d.ts rename to api/@ohos.telephony.data.d.ts diff --git a/api/phone/@ohos.telephony.observer.d.ts b/api/@ohos.telephony.observer.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.observer.d.ts rename to api/@ohos.telephony.observer.d.ts diff --git a/api/phone/@ohos.telephony.radio.d.ts b/api/@ohos.telephony.radio.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.radio.d.ts rename to api/@ohos.telephony.radio.d.ts diff --git a/api/phone/@ohos.telephony.sim.d.ts b/api/@ohos.telephony.sim.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.sim.d.ts rename to api/@ohos.telephony.sim.d.ts diff --git a/api/phone/@ohos.telephony.sms.d.ts b/api/@ohos.telephony.sms.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.telephony.sms.d.ts rename to api/@ohos.telephony.sms.d.ts diff --git a/api/phone/@ohos.update.d.ts b/api/@ohos.update.d.ts similarity index 100% rename from api/phone/@ohos.update.d.ts rename to api/@ohos.update.d.ts diff --git a/api/phone/@ohos.wifi.d.ts b/api/@ohos.wifi.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/@ohos.wifi.d.ts rename to api/@ohos.wifi.d.ts diff --git a/api/phone/@ohos.window.d.ts b/api/@ohos.window.d.ts similarity index 100% rename from api/phone/@ohos.window.d.ts rename to api/@ohos.window.d.ts diff --git a/api/@system.app.d.ts b/api/@system.app.d.ts deleted file mode 100755 index dfc8fb3f0..000000000 --- a/api/@system.app.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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 { - appName: string; - versionName: string; - versionCode: number; -} -export interface RequestFullWindowOptions { - duration?: number -} -export interface ScreenOnVisibleOptions { - visible?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class App { - static getInfo(): AppResponse; - static terminate(): void; - static screenOnVisible(options?: ScreenOnVisibleOptions): void; - static requestFullWindow(options?: RequestFullWindowOptions): void; -} diff --git a/api/@system.battery.d.ts b/api/@system.battery.d.ts deleted file mode 100755 index 819668896..000000000 --- a/api/@system.battery.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2021 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 BatteryResponse { - charging: boolean; - level: number; -} -export interface GetStatusOptions { - success?: (data: BatteryResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class Battery { - static getStatus(options?: GetStatusOptions): void; -} diff --git a/api/@system.brightness.d.ts b/api/@system.brightness.d.ts deleted file mode 100755 index 8b7348232..000000000 --- a/api/@system.brightness.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2021 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 BrightnessResponse { - value: number; -} -export interface GetBrightnessOptions { - success?: (data: BrightnessResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetBrightnessOptions { - value: number; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface BrightnessModeResponse { - mode: number; -} -export interface GetBrightnessModeOptions { - success?: (data: BrightnessModeResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetBrightnessModeOptions { - mode: number; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetKeepScreenOnOptions { - keepScreenOn: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class Brightness { - static getValue(options?: GetBrightnessOptions): void; - static setValue(options: SetBrightnessOptions): void; - static getMode(options?: GetBrightnessModeOptions): void; - static setMode(options: SetBrightnessModeOptions): void; - static setKeepScreenOn(options: SetKeepScreenOnOptions): void; -} diff --git a/api/@system.cipher.d.ts b/api/@system.cipher.d.ts deleted file mode 100755 index 3fa74e43c..000000000 --- a/api/@system.cipher.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 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 CipherResponse { - text: string; -} -export interface CipherRsaOptions { - action: string; - text: string; - key: string; - transformation?: string; - success: (data: CipherResponse) => void; - fail: (data: string, code: number) => void; - complete: () => void; -} -export interface CipherAesOptions { - action: string; - text: string; - key: string; - transformation?: string; - iv?: string; - ivOffset?: string; - ivLen?: string; - success: (data: CipherResponse) => void; - fail: (data: string, code: number) => void; - complete: () => void; -} -export default class Cipher { - static rsa(options: CipherRsaOptions): void; - static aes(options: CipherAesOptions): void; -} diff --git a/api/@system.device.d.ts b/api/@system.device.d.ts deleted file mode 100755 index 83aa8c6ec..000000000 --- a/api/@system.device.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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 DeviceResponse { - brand: string; - manufacturer: string; - model: string; - product: string; - language: string; - region: string; - windowWidth: number; - windowHeight: number; - screenDensity: number; - screenShape: "rect" | "circle"; -} -export interface GetDeviceOptions { - success?: (data: DeviceResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export default class Device { - static getInfo(options?: GetDeviceOptions): void; -} diff --git a/api/@system.fetch.d.ts b/api/@system.fetch.d.ts deleted file mode 100755 index b210f0edf..000000000 --- a/api/@system.fetch.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 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 FetchResponse { - code: number; - data: string | object; - headers: Object; -} -export interface FetchOptions { - url: string; - data?: string | object; - header?: Object; - method?: "OPTIONS" | "GET" | "HEAD" | "POST" | "PUT" | "DELETE" | "TRACE"; - responseType?: string; - success?: (data: FetchResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export default class Fetch { - static fetch(options: FetchOptions): void; -} diff --git a/api/@system.file.d.ts b/api/@system.file.d.ts deleted file mode 100755 index fa9fd86df..000000000 --- a/api/@system.file.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2021 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 { - uri: string; - length: number; - lastModifiedTime: number; - type: "dir" | "file"; - subFiles?: Array; -} -export interface FileMoveOption { - srcUri: string; - dstUri: string; - success?: (uri: string) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileListResponse { - fileList: Array; -} -export interface FileListOption { - uri: string; - success?: (data: FileListResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileCopyOption { - srcUri: string; - dstUri: string; - success?: (uri: string) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileGetOption { - uri: string; - recursive?: boolean; - success?: (file: FileResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileDeleteOption { - uri: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileWriteTextOption { - uri: string; - text: string; - encoding?: string; - append?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileReadTextResponse { - text: string; -} -export interface FileReadTextOption { - uri: string; - encoding?: string; - position?: number; - length?: number; - success?: (data: FileReadTextResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileWriteArrayBufferOption { - uri: string; - buffer: Uint8Array; - position?: number; - append?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileReadArrayBufferResponse { - buffer: Uint8Array; -} -export interface FileReadArrayBufferOption { - uri: string; - position?: number; - length?: number; - success?: (data: FileReadArrayBufferResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileAccessOption { - uri: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileMkdirOption { - uri: string; - recursive?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface FileRmdirOption { - uri: string; - recursive?: boolean; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class File { - static move(options: FileMoveOption): void; - static copy(options: FileCopyOption): void; - static list(options: FileListOption): void; - static get(options: FileGetOption): void; - static delete(options: FileDeleteOption): void; - static writeText(options: FileWriteTextOption): void; - static readText(options: FileReadTextOption): void; - static writeArrayBuffer(options: FileWriteArrayBufferOption): void; - static readArrayBuffer(options: FileReadArrayBufferOption): void; - static access(options: FileAccessOption): void; - static mkdir(options: FileMkdirOption): void; - static rmdir(options: FileRmdirOption): void; -} diff --git a/api/@system.geolocation.d.ts b/api/@system.geolocation.d.ts deleted file mode 100755 index e2ca9ac56..000000000 --- a/api/@system.geolocation.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 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 GeolocationResponse { - longitude: number; - latitude: number; - altitude: number; - accuracy: number; - time: number; -} -export interface GetLocationOption { - timeout?: number; - coordType?: string; - success?: (data: GeolocationResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface GetLocationTypeResponse { - types: Array; -} -export interface GetLocationTypeOption { - success?: (data: GetLocationTypeResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SubscribeLocationOption { - coordType?: string; - success: (data: GeolocationResponse) => void; - fail?: (data: string, code: number) => void; -} -export default class Geolocation { - static getLocation(options?: GetLocationOption): void; - static getLocationType(options?: GetLocationTypeOption): void; - static subscribe(options: SubscribeLocationOption): void; - static unsubscribe(): void; - static getSupportedCoordTypes(): Array; -} diff --git a/api/@system.network.d.ts b/api/@system.network.d.ts deleted file mode 100755 index 85edb3608..000000000 --- a/api/@system.network.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 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 NetworkResponse { - type: string; - metered: boolean; -} -export interface GetNetworkTypeOptions { - success?: (data: NetworkResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export interface SubscribeNetworkOptions { - success?: (data: NetworkResponse) => void; - fail?: (data: any, code: number) => void; -} -export default class Network { - static getType(options?: GetNetworkTypeOptions): void; - static subscribe(options?: SubscribeNetworkOptions): void; - static unsubscribe(): void; -} diff --git a/api/@system.notification.d.ts b/api/@system.notification.d.ts deleted file mode 100755 index be1f0fc35..000000000 --- a/api/@system.notification.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2021 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 ActionResult { - bundleName: string; - abilityName: string; - uri: string; -} -export interface ShowNotificationOptions { - contentTitle?: string; - contentText?: string; - clickAction?: ActionResult; -} -export default class Notification { - static show(options?: ShowNotificationOptions): void; -} diff --git a/api/@system.prompt.d.ts b/api/@system.prompt.d.ts deleted file mode 100755 index 2c395c5c0..000000000 --- a/api/@system.prompt.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2021 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 ShowToastOptions { - message: string; - duration?: number; -} -export interface Button { - text: string; - color: string; -} -export interface ShowDialogSuccessResponse { - index: number; -} -export interface ShowDialogOptions { - title?: string; - message?: string; - buttons?: [Button, Button?, Button?]; - success?: (data: ShowDialogSuccessResponse) => void; - cancel?: (data: string, code: string) => void; - complete?: (data: string) => void; -} -export default class Prompt { - static showToast(options: ShowToastOptions): void; - static showDialog(options: ShowDialogOptions): void; -} diff --git a/api/@system.request.d.ts b/api/@system.request.d.ts deleted file mode 100755 index 13bfc0536..000000000 --- a/api/@system.request.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2021 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 UploadResponse { - code: number; - data: string; - headers: Object; -} -export interface DownloadResponse { - token: string; -} -export interface OnDownloadCompleteResponse { - uri: string; -} -export interface RequestFile { - filename?: string; - name?: string; - uri: string; - type?: string; -} -export interface RequestData { - name: string; - value: string; -} -export interface UploadRequestOptions { - url: string; - data?: Array; - files: Array; - header?: Object; - method?: string; - success?: (data: UploadResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export interface DownloadRequestOptions { - url: string; - filename?: string; - header?: string; - description?: string; - success?: (data: DownloadResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export interface OnDownloadCompleteOptions { - token: string; - success?: (data: OnDownloadCompleteResponse) => void; - fail?: (data: any, code: number) => void; - complete?: () => void; -} -export default class Request { - static upload(options: UploadRequestOptions): void; - static download(options: DownloadRequestOptions): void; - static onDownloadComplete(options: OnDownloadCompleteOptions): void; -} diff --git a/api/@system.router.d.ts b/api/@system.router.d.ts deleted file mode 100755 index 8cb0efc2a..000000000 --- a/api/@system.router.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 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: string; - params?: Object; -} -export interface BackRouterOptions { - path?: string; -} -export interface RouterState { - index: number; - name: string; - path: string; -} -export default class Router { - static push(options: RouterOptions): void; - static replace(options: RouterOptions): void; - static back(options?: BackRouterOptions): void; - static clear(): void; - static getLength(): string; - static getState(): RouterState; -} diff --git a/api/@system.sensor.d.ts b/api/@system.sensor.d.ts deleted file mode 100755 index be6b11bbe..000000000 --- a/api/@system.sensor.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2021 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 AccelerometerResponse { - x: number; - y: number; - z: number; -} -export interface subscribeAccelerometerOptions { - interval: string; - success: (data: AccelerometerResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface CompassResponse { - direction: number; -} -export interface SubscribeCompassOptions { - success: (data: CompassResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface ProximityResponse { - distance: number; -} -export interface SubscribeProximityOptions { - success: (data: ProximityResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface LightResponse { - intensity: number; -} -export interface SubscribeLightOptions { - success: (data: LightResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface StepCounterResponse { - steps: number; -} -export interface SubscribeStepCounterOptions { - success: (data: StepCounterResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface BarometerResponse { - pressure: number; -} -export interface SubscribeBarometerOptions { - success: (data: BarometerResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface HeartRateResponse { - heartRate: number; -} -export interface SubscribeHeartRateOptions { - success: (data: HeartRateResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface OnBodyStateResponse { - value: boolean; -} -export interface SubscribeOnBodyStateOptions { - success: (data: OnBodyStateResponse) => void; - fail?: (data: string, code: number) => void; -} -export interface GetOnBodyStateOptions { - success: (data: OnBodyStateResponse) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class Sensor { - static subscribeAccelerometer(options: subscribeAccelerometerOptions): void; - static unsubscribeAccelerometer(): void; - static subscribeCompass(options: SubscribeCompassOptions): void; - static unsubscribeCompass(): void; - static subscribeProximity(options: SubscribeProximityOptions): void; - static unsubscribeProximity(): void; - static subscribeLight(options: SubscribeLightOptions): void; - static unsubscribeLight(): void; - static subscribeStepCounter(options: SubscribeStepCounterOptions): void; - static unsubscribeStepCounter(): void; - static subscribeBarometer(options: SubscribeBarometerOptions): void; - static unsubscribeBarometer(): void; - static subscribeHeartRate(options: SubscribeHeartRateOptions): void; - static unsubscribeHeartRate(): void; - static subscribeOnBodyState(options: SubscribeOnBodyStateOptions): void; - static unsubscribeOnBodyState(): void; - static getOnBodyState(options: GetOnBodyStateOptions): void; -} diff --git a/api/@system.storage.d.ts b/api/@system.storage.d.ts deleted file mode 100755 index 7ea651f9c..000000000 --- a/api/@system.storage.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2021 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 GetStorageOptions { - key: string; - default?: string; - success?: (data: any) => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface SetStorageOptions { - key: string; - value: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface ClearStorageOptions { - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export interface DeleteStorageOptions { - key: string; - success?: () => void; - fail?: (data: string, code: number) => void; - complete?: () => void; -} -export default class Storage { - static get(options: GetStorageOptions): void; - static set(options: SetStorageOptions): void; - static clear(options?: ClearStorageOptions): void; - static delete(options: DeleteStorageOptions): void; -} diff --git a/api/phone/app/abilityinfo.d.ts b/api/app/abilityinfo.d.ts similarity index 100% rename from api/phone/app/abilityinfo.d.ts rename to api/app/abilityinfo.d.ts diff --git a/api/phone/app/abilitymissioninfo.d.ts b/api/app/abilitymissioninfo.d.ts similarity index 100% rename from api/phone/app/abilitymissioninfo.d.ts rename to api/app/abilitymissioninfo.d.ts diff --git a/api/phone/app/applicationinfo.d.ts b/api/app/applicationinfo.d.ts similarity index 100% rename from api/phone/app/applicationinfo.d.ts rename to api/app/applicationinfo.d.ts diff --git a/api/phone/app/appprocessstate.ts b/api/app/appprocessstate.ts similarity index 100% rename from api/phone/app/appprocessstate.ts rename to api/app/appprocessstate.ts diff --git a/api/phone/app/bundleinfo.d.ts b/api/app/bundleinfo.d.ts similarity index 100% rename from api/phone/app/bundleinfo.d.ts rename to api/app/bundleinfo.d.ts diff --git a/api/phone/app/common.d.ts b/api/app/common.d.ts similarity index 100% rename from api/phone/app/common.d.ts rename to api/app/common.d.ts diff --git a/api/phone/app/elementname.d.ts b/api/app/elementname.d.ts similarity index 100% rename from api/phone/app/elementname.d.ts rename to api/app/elementname.d.ts diff --git a/api/phone/app/installresult.d.ts b/api/app/installresult.d.ts similarity index 100% rename from api/phone/app/installresult.d.ts rename to api/app/installresult.d.ts diff --git a/api/phone/app/moduleinfo.d.ts b/api/app/moduleinfo.d.ts similarity index 100% rename from api/phone/app/moduleinfo.d.ts rename to api/app/moduleinfo.d.ts diff --git a/api/phone/app/processinfo.d.ts b/api/app/processinfo.d.ts similarity index 100% rename from api/phone/app/processinfo.d.ts rename to api/app/processinfo.d.ts diff --git a/api/phone/app/want.d.ts b/api/app/want.d.ts similarity index 100% rename from api/phone/app/want.d.ts rename to api/app/want.d.ts diff --git a/api/phone/basic.d.ts b/api/basic.d.ts old mode 100755 new mode 100644 similarity index 100% rename from api/phone/basic.d.ts rename to api/basic.d.ts diff --git a/api/phone/commonevent/commoneventdata.d.ts b/api/commonevent/commoneventdata.d.ts similarity index 100% rename from api/phone/commonevent/commoneventdata.d.ts rename to api/commonevent/commoneventdata.d.ts diff --git a/api/phone/commonevent/commoneventpublishdata.d.ts b/api/commonevent/commoneventpublishdata.d.ts similarity index 100% rename from api/phone/commonevent/commoneventpublishdata.d.ts rename to api/commonevent/commoneventpublishdata.d.ts diff --git a/api/phone/commonevent/commoneventsubscribeinfo.d.ts b/api/commonevent/commoneventsubscribeinfo.d.ts similarity index 100% rename from api/phone/commonevent/commoneventsubscribeinfo.d.ts rename to api/commonevent/commoneventsubscribeinfo.d.ts diff --git a/api/phone/commonevent/commoneventsubscriber.d.ts b/api/commonevent/commoneventsubscriber.d.ts similarity index 100% rename from api/phone/commonevent/commoneventsubscriber.d.ts rename to api/commonevent/commoneventsubscriber.d.ts diff --git a/api/phone/data/distributeddata/kvmanager_config.d.ts b/api/data/distributeddata/kvmanager_config.d.ts similarity index 100% rename from api/phone/data/distributeddata/kvmanager_config.d.ts rename to api/data/distributeddata/kvmanager_config.d.ts diff --git a/api/phone/data/distributeddata/kvstore.d.ts b/api/data/distributeddata/kvstore.d.ts similarity index 100% rename from api/phone/data/distributeddata/kvstore.d.ts rename to api/data/distributeddata/kvstore.d.ts diff --git a/api/phone/data/distributeddata/plain_ordinary_js_objects.d.ts b/api/data/distributeddata/plain_ordinary_js_objects.d.ts similarity index 100% rename from api/phone/data/distributeddata/plain_ordinary_js_objects.d.ts rename to api/data/distributeddata/plain_ordinary_js_objects.d.ts diff --git a/api/phone/data/distributeddata/single_kvstore.d.ts b/api/data/distributeddata/single_kvstore.d.ts similarity index 100% rename from api/phone/data/distributeddata/single_kvstore.d.ts rename to api/data/distributeddata/single_kvstore.d.ts diff --git a/api/form/action/form-schema.json b/api/form/action/form-schema.json new file mode 100644 index 000000000..cc2104a42 --- /dev/null +++ b/api/form/action/form-schema.json @@ -0,0 +1,18 @@ +{ + "type": "object", + "additionalProperties": false, + "properties":{ + "data": { + "type": "object", + "description": "Defines variables." + }, + "actions": { + "type": "object", + "description": "Defines events." + }, + "apiVersion": { + "type": "object", + "description": "Defines api version compatibility information." + } + } +} diff --git a/api/form/css/css-json-schema.json b/api/form/css/css-json-schema.json new file mode 100644 index 000000000..40ef282b6 --- /dev/null +++ b/api/form/css/css-json-schema.json @@ -0,0 +1,283 @@ +{ + "type": "object", + "properties": { + "properties": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "supportedDevices": { + "type": "array", + "description": "本字段非必填,如果为空,表示该属性支持所有的设备类型", + "items": { + "type": "string", + "enum": ["tv", "phone", "tablet", "wearable", "liteWearable", "smartVision"] + } + }, + "syntax": { + "type": "array", + "description": "语法", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "支持