提交 c3a12b7f 编写于 作者: 雪洛's avatar 雪洛

feat: 初始化uni-app-harmony

上级 8205b393
......@@ -2,3 +2,4 @@ node_modules
dist
temp
coverage
packages/uni-app-harmony/types
\ No newline at end of file
......@@ -22,3 +22,4 @@ packages/vite-plugin-uni/lib
packages/uni-uts-vite/lib
packages/uni-cli-shared/src/checkUpdate.ts
packages/uni-uts-v1/lib
packages/uni-app-harmony/types
[
{
"input": {
"src/service/index.ts": "dist/uni.runtime.esm.js"
},
"output": {
"freeze": false
},
"replacements": {
"process.env.NODE_ENV": "'production'",
"__X__": "false",
"__PLATFORM__": "'harmonyos'",
"__APP_VIEW__": "false",
"__VUE_OPTIONS_API__": "true",
"__VUE_PROD_DEVTOOLS__": "false",
"__VUE_PROD_HYDRATION_MISMATCH_DETAILS__": "false",
"__UNI_FEATURE_WX__": "true",
"__UNI_FEATURE_PROMISE__": "false",
"__UNI_FEATURE_I18N_EN__": "true",
"__UNI_FEATURE_I18N_ES__": "true",
"__UNI_FEATURE_I18N_FR__": "true",
"__UNI_FEATURE_I18N_ZH_HANS__": "true",
"__UNI_FEATURE_I18N_ZH_HANT__": "true"
},
"external": [
"vue",
{
"source": "^@ohos.*"
}
]
}
]
\ No newline at end of file
此差异已折叠。
///// <reference path="./types/ohos/component/common.d.ts" /> // TODO Component变量命名冲突
declare function vp2px(value: number): number
declare function lpx2px(value: number): number
{
"name": "@dcloudio/uni-app-plus",
"version": "3.0.0-alpha-4010120240402001",
"description": "@dcloudio/uni-app-plus",
"files": [
"dist",
"lib",
"style"
],
"sideEffects": [
"lib/automator.js"
],
"repository": {
"type": "git",
"url": "git+https://github.com/dcloudio/uni-app.git",
"directory": "packages/uni-app-plus"
},
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/dcloudio/uni-app/issues"
},
"gitHead": "33e807d66e1fe47e2ee08ad9c59247e37b8884da",
"uni-app": {
"name": "uni-app-plus",
"apply": [
"app"
],
"uvue": true,
"main": "dist/uni.compiler.js"
},
"dependencies": {
"debug": "^4.3.3",
"fs-extra": "^10.0.0",
"licia": "^1.29.0",
"postcss-selector-parser": "^6.0.6"
},
"devDependencies": {
"@dcloudio/uni-cli-shared": "3.0.0-alpha-4010120240402001",
"@dcloudio/uni-components": "3.0.0-alpha-4010120240402001",
"@dcloudio/uni-i18n": "3.0.0-alpha-4010120240402001",
"@dcloudio/uni-shared": "3.0.0-alpha-4010120240402001",
"@types/pako": "1.0.2",
"@vue/compiler-sfc": "3.4.21",
"autoprefixer": "^10.4.18",
"pako": "^1.0.11",
"postcss": "^8.4.21",
"vue": "3.4.21"
}
}
export * from './service/index'
export { getBaseSystemInfo } from '../service/api/base/getBaseSystemInfo'
export { inflateRaw, deflateRaw } from 'pako'
export * from './todo'
import { extend } from '@vue/shared'
import type {
AddIntersectionObserverArgs,
AddMediaQueryObserverArgs,
RemoveIntersectionObserverArgs,
RemoveMediaQueryObserverArgs,
SelectorQueryNodeInfo,
SelectorQueryRequest,
SetPageMetaOptions,
} from '@dcloudio/uni-api'
import type { ComponentPublicInstance } from 'vue'
import { type LaunchOptions, createLaunchOptions } from '@dcloudio/uni-core'
export function operateVideoPlayer(
videoId: string,
pageId: number,
type: string,
data?: unknown
) {
// TODO: Implement
}
export function operateMap(
id: string,
pageId: number,
type: string,
data?: unknown,
operateMapCallback?: (res: any) => void
) {
// TODO: Implement
}
export const TEMP_PATH = '' // TODO 需要从applicationContext获取
export function addIntersectionObserver(
{ reqId, component, options, callback }: AddIntersectionObserverArgs,
_pageId: number
) {
// TODO: Implement
}
export function removeIntersectionObserver(
{ reqId, component }: RemoveIntersectionObserverArgs,
_pageId: number
) {
// TODO: Implement
}
export function addMediaQueryObserver(
{ reqId, component, options, callback }: AddMediaQueryObserverArgs,
_pageId: number
) {
// TODO: Implement
}
export function removeMediaQueryObserver(
{ reqId, component }: RemoveMediaQueryObserverArgs,
_pageId: number
) {
// TODO: Implement
}
export function requestComponentInfo(
pageVm: ComponentPublicInstance,
reqs: Array<SelectorQueryRequest>,
callback: (result: Array<SelectorQueryNodeInfo | null>) => void
) {
// TODO: Implement
}
export function setCurrentPageMeta(
page: ComponentPublicInstance,
options: SetPageMetaOptions
) {
// TODO: Implement
}
const enterOptions: LaunchOptions = /*#__PURE__*/ createLaunchOptions()
const launchOptions: LaunchOptions = /*#__PURE__*/ createLaunchOptions()
export function getLaunchOptions() {
// TODO: Implement
return extend({}, launchOptions)
}
export function getEnterOptions() {
// TODO: Implement
return extend({}, enterOptions)
}
export function getRealPath(filepath: string) {
// TODO: Implement
return filepath
}
/**
* 简易版systemInfo,主要为upx2px,i18n服务
* @returns
*/
export function getBaseSystemInfo() {
return {
platform: 'harmonyos',
pixelRatio: vp2px(1),
windowWidth: lpx2px(720), // TODO designWidth可配置
}
}
import { getBaseSystemInfo } from '../base/getBaseSystemInfo'
export function getSystemInfoSync() {
// TODO: implement
return getBaseSystemInfo()
}
export * from './media/index'
export * from './ui/index'
export * from './device/index'
import picker from '@ohos.file.picker'
import fs from '@ohos.file.fs'
import promptAction from '@ohos.promptAction'
import type { BusinessError } from '@ohos.base'
import {
API_CHOOSE_IMAGE,
type API_TYPE_CHOOSE_IMAGE,
ChooseImageOptions,
ChooseImageProtocol,
defineAsyncApi,
} from '@dcloudio/uni-api'
import { initI18nChooseImageMsgsOnce, useI18n } from '@dcloudio/uni-core'
async function openAlbum(
count: number = 9
): Promise<UniApp.ChooseImageSuccessCallbackResult> {
return new Promise((resolve, reject) => {
try {
const photoSelectOptions = new picker.PhotoSelectOptions()
photoSelectOptions.MIMEType = picker.PhotoViewMIMETypes.IMAGE_TYPE
photoSelectOptions.maxSelectNumber = count
const photoPicker = new picker.PhotoViewPicker()
photoPicker
.select(photoSelectOptions)
.then((photoSelectResult: picker.PhotoSelectResult) => {
resolve({
tempFilePaths: photoSelectResult.photoUris,
tempFiles: photoSelectResult.photoUris.map((uri) => {
const file = fs.openSync(uri, fs.OpenMode.READ_ONLY)
const stat = fs.statSync(file.fd)
fs.closeSync(file)
return {
path: uri,
size: stat.size,
}
}),
})
console.info(
'PhotoViewPicker.select successfully, PhotoSelectResult uri: ' +
JSON.stringify(photoSelectResult)
)
})
.catch((error: BusinessError) => {
console.error(
'PhotoViewPicker.select failed with err: ' + JSON.stringify(error)
)
reject(error)
})
} catch (error) {
reject(error as Error)
}
})
}
async function openCamera(): Promise<UniApp.ChooseImageSuccessCallbackResult> {
return {
tempFilePaths: [],
tempFiles: [],
}
}
async function chooseSourceType(): Promise<string> {
initI18nChooseImageMsgsOnce()
const { t } = useI18n()
return new Promise((resolve, reject) => {
try {
promptAction.showActionMenu(
{
title: '',
buttons: [
{
text: t('uni.chooseImage.sourceType.camera'),
color: '#000000',
},
{
text: t('uni.chooseImage.sourceType.album'),
color: '#000000',
},
],
},
(err, data) => {
if (err) {
console.info(
`showActionMenu fail callback, error code: ${err.code}, error message: ${err.message}`
)
reject(err)
}
console.info(
'showActionMenu success callback, click button: ' + data.index
)
switch (data.index) {
case 0:
resolve('camera')
return
case 1:
resolve('album')
return
default:
break
}
}
)
} catch (error) {
reject(error as Error)
}
})
}
export const chooseImage: API_TYPE_CHOOSE_IMAGE =
defineAsyncApi<API_TYPE_CHOOSE_IMAGE>(
API_CHOOSE_IMAGE,
function ({ count, sourceType } = {}, { resolve, reject }) {
return Promise.resolve()
.then(async () => {
let realSourceType: string = ''
if (sourceType && sourceType.length === 1) {
if (sourceType!.includes('album')) {
realSourceType = 'album'
} else if (sourceType!.includes('camera')) {
realSourceType = 'camera'
}
}
if (!realSourceType) {
realSourceType = await chooseSourceType()
}
switch (realSourceType) {
case 'album':
return openAlbum(count)
case 'camera':
return openCamera()
default:
break
}
})
.then(resolve)
.catch(reject)
},
ChooseImageProtocol,
ChooseImageOptions
)
export function getLocale() {
return 'zh-CN'
}
import * as uni from './api/index'
;(globalThis as any).uni = uni
export { uni }
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"target": "ESNext",
"paths": {
"@dcloudio/*": ["packages/*/src"],
"@dcloudio/uni-platform": ["packages/uni-app-harmony/src/platform/index.ts"],
"@ohos.*": ["packages/uni-app-harmony/types/ohos/api/@ohos.*.d.ts"]
}
}
}
\ No newline at end of file
/*
* Copyright (c) 2022-2023 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.
*/
/**
* Describes an opaque object of a template, which is created using the createPattern() method.
*
* @interface CanvasPattern
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Describes an opaque object of a template, which is created using the createPattern() method.
*
* @interface CanvasPattern
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Describes an opaque object of a template, which is created using the createPattern() method.
*
* @interface CanvasPattern
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
export interface CanvasPattern {
/**
* Adds the matrix transformation effect to the current template.
*
* @param { Matrix2D } [transform] - transformation matrix
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Adds the matrix transformation effect to the current template.
*
* @param { Matrix2D } [transform] - transformation matrix
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Adds the matrix transformation effect to the current template.
*
* @param { Matrix2D } [transform] - transformation matrix
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
setTransform(transform?: Matrix2D): void;
}
/**
* 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* 2D transformation matrix, supporting rotation, translation, and scaling of the X-axis and Y-axis
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
export class Matrix2D {
/**
* Horizontal Zoom
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Horizontal Zoom
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Horizontal Zoom
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
scaleX?: number;
/**
* Vertical Tilt
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Vertical Tilt
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Vertical Tilt
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
rotateY?: number;
/**
* Horizontal Tilt
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Horizontal Tilt
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Horizontal Tilt
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
rotateX?: number;
/**
* Vertical Zoom
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Vertical Zoom
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Vertical Zoom
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
scaleY?: number;
/**
* Horizontal movement
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Horizontal movement
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Horizontal movement
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
translateX?: number;
/**
* Vertical movement
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Vertical movement
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Vertical movement
*
* @type { ?number }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
translateY?: number;
/**
* Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
* translation scaling effect)
*
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
* translation scaling effect)
*
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Transforms the current 2D matrix back to the identity matrix (i.e., without any rotational
* translation scaling effect)
*
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
identity(): Matrix2D;
/**
* Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
* is the opposite effect of the original)
*
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
* is the opposite effect of the original)
*
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Transform the current 2D matrix into an inverse matrix (that is, the transformation effect
* is the opposite effect of the original)
*
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
invert(): Matrix2D;
/**
* The matrix is superimposed in right multiplication mode. When the input parameter is empty,
* the matrix is superimposed.
*
* @param { Matrix2D } [other] - Matrix to be superimposed
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* The matrix is superimposed in right multiplication mode. When the input parameter is empty,
* the matrix is superimposed.
*
* @param { Matrix2D } [other] - Matrix to be superimposed
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* The matrix is superimposed in right multiplication mode. When the input parameter is empty,
* the matrix is superimposed.
*
* @param { Matrix2D } [other] - Matrix to be superimposed
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
multiply(other?: Matrix2D): Matrix2D;
/**
* Adds the rotation effect of the X and Y axes to the current matrix.
*
* @param { number } [rx] - Rotation effect of the X axis
* @param { number } [ry] - Rotation effect of the Y-axis
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Adds the rotation effect of the X and Y axes to the current matrix.
*
* @param { number } [rx] - Rotation effect of the X axis
* @param { number } [ry] - Rotation effect of the Y-axis
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Adds the rotation effect of the X and Y axes to the current matrix.
*
* @param { number } [rx] - Rotation effect of the X axis
* @param { number } [ry] - Rotation effect of the Y-axis
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
rotate(rx?: number, ry?: number): Matrix2D;
/**
* Adds the translation effect of the X and Y axes to the current matrix.
*
* @param { number } [tx] - X-axis translation effect
* @param { number } [ty] - Y-axis translation effect
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Adds the translation effect of the X and Y axes to the current matrix.
*
* @param { number } [tx] - X-axis translation effect
* @param { number } [ty] - Y-axis translation effect
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Adds the translation effect of the X and Y axes to the current matrix.
*
* @param { number } [tx] - X-axis translation effect
* @param { number } [ty] - Y-axis translation effect
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
translate(tx?: number, ty?: number): Matrix2D;
/**
* Adds the scaling effect of the X and Y axes to the current matrix.
*
* @param { number } [sx] - X-axis scaling effect
* @param { number } [sy] - Y-axis scaling effect
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Adds the scaling effect of the X and Y axes to the current matrix.
*
* @param { number } [sx] - X-axis scaling effect
* @param { number } [sy] - Y-axis scaling effect
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Adds the scaling effect of the X and Y axes to the current matrix.
*
* @param { number } [sx] - X-axis scaling effect
* @param { number } [sy] - Y-axis scaling effect
* @returns { Matrix2D }
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
scale(sx?: number, sy?: number): Matrix2D;
/**
* Constructs a 2D change matrix object. The default value is the unit matrix.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 8
*/
/**
* Constructs a 2D change matrix object. The default value is the unit matrix.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 9
* @form
*/
/**
* Constructs a 2D change matrix object. The default value is the unit matrix.
*
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @atomicservice
* @since 11
* @form
*/
constructor();
}
/*
* 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.
*/
/**
* @typedef Result
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface Result {
/**
* Result code.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
code: number;
/**
* Returned data.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
data: object;
}
/**
* @typedef SubscribeMessageResponse
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface SubscribeMessageResponse {
/**
* Peer device ID.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
deviceId: string;
/**
* Name of the bundle where the peer ability has been located. The name is case sensitive.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
bundleName: string;
/**
* Peer ability name, which is case sensitive.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityName: string;
/**
* Messages received from the device.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
message: string;
}
/**
* @typedef CallAbilityParam
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface CallAbilityParam {
/**
* Name of the bundle where the ability has been located. The name is case sensitive and must be the same as that on the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
bundleName: string;
/**
* Ability name, which is case sensitive and must be the same as that on the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityName: string;
/**
* Ability operation code, which defines the service function of an AA and must be consistent with the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
messageCode: number;
/**
* Ability type. Different types of abilities have different implementation on the AA side.
* 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background.
* 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityType: number;
/**
* Data sent to the ability. The data to carry differs depending on the service to be processed and its field name must be consistent with the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
data?: object;
/**
* Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities.
* 0: Synchronous mode (default value)
* 1: Asynchronous mode
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
syncOption?: number;
}
/**
* @typedef SubscribeAbilityEventParam
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface SubscribeAbilityEventParam {
/**
* Name of the bundle where the ability has been located. The name is case sensitive and must be the same as that on the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
bundleName: string;
/**
* Ability name, which is case sensitive and must be the same as that on the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityName: string;
/**
* Ability operation code, which defines the service function of an AA and must be consistent with the AA side.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
messageCode: number;
/**
* Ability type. Different types of abilities have different implementation on the AA side.
* 0: Ability, which has an independent lifecycle. The FA starts and requests an AA through an RPC. Such type of abilities are used to provide basic services for multiple FAs to call or are used when the abilities should run in the background.
* 1: Internal ability, which shares the same process with the FA and communicates with it by calling internal functions. Such type of abilities are used in scenarios that require low response latency and cannot be called by other FAs.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityType: number;
/**
* Whether the request is synchronous or asynchronous. The synchronous mode is used by default. Currently, the asynchronous mode is available only for internal abilities.
* 0: Synchronous mode (default value)
* 1: Asynchronous mode
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
syncOption?: number;
}
/**
* @typedef SendMessageOptions
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface SendMessageOptions {
/**
* Destination device ID.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
deviceId: string;
/**
* Name of the destination bundle where the ability has been located. The name is case sensitive.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
bundleName: string;
/**
* Destination ability name, which is case sensitive.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityName: string;
/**
* Messages sent to the destination device.
* A maximum of 1 KB of data can be transmitted at a time.
* If more than 1 KB of data needs to be transmitted, split the messages into multiple parts to transmit.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
message?: string;
/**
* Called when the messages are sent successfully.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
success?: () => void;
/**
* Called when the messages fail to be sent.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
fail?: (data: string, code: number) => void;
/**
* Called when the execution is completed.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
complete?: () => void;
}
/**
* @typedef SubscribeMessageOptions
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface SubscribeMessageOptions {
/**
* Called when the messages are sent successfully.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
success?: (data: SubscribeMessageResponse) => void;
/**
* Called when the messages fail to be sent.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
fail?: (data: string, code: number) => void;
}
/**
* @typedef RequestParams
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface RequestParams {
/**
* The name of the bundle to start. It should be used with abilityname and case sensitive.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
bundleName?: string;
/**
* Ability name, which is case sensitive.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
abilityName?: string;
/**
* The list of entities to which the FA to be called. If it is not filled in, all entity lists will be found by default. It should be used with action.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
entities?: Array<string>;
/**
* Without specifying the bundle name and ability name, you can start the application according to other properties with action.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
action?: string;
/**
* If more than one FA meets the conditions, the user can select the device from the popup.
* 0: Default. Select the FA to start from the local and remote devices.
* 1: start FA from the local device.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
deviceType?: number;
/**
* Data sent to the ability which need to be serializable.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
data?: object;
/**
* Configuration switch when start FA.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
flag?: number;
/**
* Specify the url of the page which the FA to be called. Use home page directly by default.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
url?: string;
}
/**
* @typedef FinishWithResultParams
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
export interface FinishWithResultParams {
/**
* Result code.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
code: number;
/**
* Returned data.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
result: object;
}
/**
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
* @useinstead ohos.ability.featureAbility.FeatureAbility
*/
export declare class FeatureAbility {
/**
* Start a FA without callback result.
* @param { RequestParams } request - Indicates the request param.
* @returns { Promise<Result> } A Promise object is returned, which contains the result of whether to call Ability's interface successfully.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
* @useinstead ohos.ability.featureAbility.FeatureAbility#startAbility
*/
static startAbility(request: RequestParams): Promise<Result>;
/**
* Start a FA with callback result.
* @param { RequestParams } request - Indicates the request param.
* @returns { Promise<Result> } A Promise object is returned, which contains the result of the data FA returned.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
* @useinstead ohos.ability.featureAbility.FeatureAbility#startAbilityForResult
*/
static startAbilityForResult(request: RequestParams): Promise<Result>;
/**
* FA call the interface to destroy itself and set the result as parameters.
* @param { FinishWithResultParams } param - Indicates the request param.
* @returns { Promise<Result> } A Promise object is returned, which contains the result whether to callback successfully.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
* @useinstead ohos.ability.featureAbility.FeatureAbility#terminateSelfWithResult
*/
static finishWithResult(param: FinishWithResultParams): Promise<Result>;
/**
* Get device information list.
* @param { number } flag - Default 0, get the information list of all devices in the network.
* @returns { Promise<Result> } A Promise object is returned, which contains the result whether the device information list is obtained successfully.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static getDeviceList(flag: number): Promise<Result>;
/**
* Calls an AA.
* @param { CallAbilityParam } param - Indicates the request param.
* @returns { Promise<string> } A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static callAbility(param: CallAbilityParam): Promise<string>;
/**
* Start FA migration.
* @returns { Promise<Result> } A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static continueAbility(): Promise<Result>;
/**
* Subscribe to events of an AA.
* @param { SubscribeAbilityEventParam } param - Indicates the request param.
* @param { Function } func - Indicates the event reporting callback.
* @returns { Promise<string> } A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static subscribeAbilityEvent(param: SubscribeAbilityEventParam, func: Function): Promise<string>;
/**
* Unsubscribe from events of an AA.
* @param { SubscribeAbilityEventParam } param - Indicates the request param.
* @returns { Promise<string> } A Promise object is returned, which contains the result data returned by the AA. The result is a JSON string.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static unsubscribeAbilityEvent(param: SubscribeAbilityEventParam): Promise<string>;
/**
* Sends messages to the destination device.
* @param { SendMessageOptions } options - Options.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static sendMsg(options: SendMessageOptions): void;
/**
* Listens for messages sent from other devices.
* @param { SubscribeMessageOptions } options - Options.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static subscribeMsg(options: SubscribeMessageOptions): void;
/**
* Cancel the listening for messages sent from other devices.
* @syscap SystemCapability.ArkUI.ArkUI.Lite
* @since 5
* @deprecated since 8
*/
static unsubscribeMsg(): void;
}
/*
* 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 * from './featureability';
export * from './global';
export * from './lifecycle';
/*
* Copyright (c) 2022 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 IMEKit
*/
import Want from './@ohos.app.ability.Want';
import type InputMethodExtensionContext from './@ohos.InputMethodExtensionContext';
/**
* The extension ability class of input method.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
export default class InputMethodExtensionAbility {
/**
* Indicates input method extension ability context.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
context: InputMethodExtensionContext;
/**
* Called back when a input method extension is started for initialization.
*
* @param { Want } want - Indicates the want of created service extension.
* @throws { BusinessError } 401 - parameter error.
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
onCreate(want: Want): void;
/**
* Called back before a input method extension is destroyed.
*
* @throws { BusinessError } 401 - parameter error.
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
onDestroy(): void;
}
/*
* Copyright (c) 2022 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 IMEKit
*/
import { AsyncCallback } from './@ohos.base';
import ExtensionContext from './application/ExtensionContext';
/**
* The extension context class of input method.
*
* @extends ExtensionContext
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
export default class InputMethodExtensionContext extends ExtensionContext {
/**
* Destroy the input method extension.
*
* @param { AsyncCallback<void> } callback - the callback of destroy.
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
destroy(callback: AsyncCallback<void>): void;
/**
* Destroy the input method extension.
*
* @returns { Promise<void> } the promise returned by the function.
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @StageModelOnly
* @since 9
*/
destroy(): Promise<void>;
}
/*
* Copyright (c) 2022 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 IMEKit
*/
/**
* Input method subtype
*
* @interface InputMethodSubtype
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
export default interface InputMethodSubtype {
/**
* The label of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly label?: string;
/**
* The label id of input method subtype.
*
* @type { ?number }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
readonly labelId?: number;
/**
* The name of input method.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly name: string;
/**
* The id of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly id: string;
/**
* The mode of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly mode?: 'upper' | 'lower';
/**
* The locale of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly locale: string;
/**
* The language of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly language: string;
/**
* The icon of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly icon?: string;
/**
* The icon id of input method subtype.
*
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
readonly iconId?: number;
/**
* The extra info of input method subtype.
*
* @type { object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 9
*/
/**
* The extra info of input method subtype.
*
* @type { ?object }
* @syscap SystemCapability.MiscServices.InputMethodFramework
* @since 10
*/
extra?: object;
}
/*
* Copyright (c) 2023 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 ArkUI
*/
import type BaseContext from './application/BaseContext';
/**
* Picture In Picture Window Manager
*
* @namespace PiPWindow
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
declare namespace PiPWindow {
/**
* If picture-in-picture enabled in current OS.
*
* @returns { boolean } true if PictureInPicture enabled, otherwise false
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
function isPiPEnabled(): boolean;
/**
* Create picture-in-picture controller
*
* @param { PiPConfiguration } config - Params for picture-in-picture controller creation
* @returns { Promise<PiPController> } - The promise returned by the function
* @throws { BusinessError } 401 - Params error, invalid or illegal parameter in PiPConfiguration
* @throws { BusinessError } 801 - Capability not supported
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
function create(config: PiPConfiguration): Promise<PiPController>;
/**
* PiPConfiguration
*
* @interface PiPConfiguration
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
interface PiPConfiguration {
/**
* Indicates window context.
*
* @type { BaseContext }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
context: BaseContext;
/**
* Indicates the origin XComponentController.
*
* @type { XComponentController }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
componentController: XComponentController;
/**
* Indicates navigation ID.
*
* @type { ?string }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
navigationId?: string;
/**
* Picture-in-picture template type.
*
* @type { ?PiPTemplateType }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
templateType?: PiPTemplateType;
/**
* Describes the width of content to be displayed in PiP window. For adjusting PiP window aspect ratio.
*
* @type { ?number }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
contentWidth?: number;
/**
* Describes the height of content to be displayed in PiP window. For adjusting PiP window aspect ratio.
*
* @type { ?number }
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
contentHeight?: number;
}
/**
* Describe the type of picture-in-picture.
*
* @enum { number }.
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
enum PiPTemplateType {
/**
* Indicates the content to show in picture-in-picture window is video play
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_PLAY,
/**
* Indicates the content to show in picture-in-picture window is video call
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_CALL,
/**
* Indicates the content to show in picture-in-picture window is video meeting
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_MEETING,
/**
* Indicates the content to show in picture-in-picture window is video live
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
VIDEO_LIVE
}
/**
* Enum for PiP window callback event type.
*
* @enum { number }.
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
enum PiPState {
/**
* PiP window is about to start.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ABOUT_TO_START = 1,
/**
* PiP window started.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
STARTED = 2,
/**
* PiP window is about to stop.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ABOUT_TO_STOP = 3,
/**
* PiP window stopped.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
STOPPED = 4,
/**
* Restore the original page from PiP window
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ABOUT_TO_RESTORE = 5,
/**
* Error message during start/stop.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
ERROR = 6
}
/**
* Describe picture-in-picture action event type.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
type PiPActionEventType = PiPVideoActionEvent | PiPCallActionEvent | PiPMeetingActionEvent | PiPLiveActionEvent;
/**
* Describe picture-in-picture video template action event type.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
type PiPVideoActionEvent = 'playbackStateChanged' | 'nextVideo' | 'previousVideo';
/**
* Describe picture-in-picture call template action event type.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
type PiPCallActionEvent = 'hangUp' | 'micStateChanged' | 'videoStateChanged';
/**
* Describe picture-in-picture meeting template action event type.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
type PiPMeetingActionEvent = 'hangUp' | 'voiceStateChanged' | 'videoStateChanged';
/**
* Describe picture-in-picture live template action event type.
*
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
type PiPLiveActionEvent = 'playbackStateChanged';
/**
* PiPController
*
* @interface PiPController
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
interface PiPController {
/**
* Start picture-in-picture
* @returns { Promise<void> } - The promise returned by the function
* @throws { BusinessError } 1300012 - If PiP window state is abnormal.
* @throws { BusinessError } 1300013 - Create PiP window failed.
* @throws { BusinessError } 1300014 - Error when load PiP window content or show PiP window
* @throws { BusinessError } 1300015 - If window has created
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
startPiP(): Promise<void>;
/**
* Stop picture-in-picture.
* @returns { Promise<void> } - The promise returned by the function.
* @throws { BusinessError } 1300011 - Stop PiP window failed.
* @throws { BusinessError } 1300012 - If PiP window state is abnormal.
* @throws { BusinessError } 1300015 - If window is stopping
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
stopPiP(): Promise<void>;
/**
* Set if auto start picture-in-picture when back home
* @param { boolean } enable - Enable auto start picture-in-picture when back home
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
setAutoStartEnabled(enable: boolean): void;
/**
* Update source content size to adjust PiP window aspect ratio.
* @param { number } width - Indicates the width of the content.
* @param { number } height - Indicates the height of the content.
* @throws { BusinessError } 401 - Params error, invalid width or height.
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
updateContentSize(width: number, height: number): void;
/**
* Register picture-in-picture control event listener.
* @param { 'stateChange' } type - Registration type, PiP lifecycle state change, 'stateChange'
* @param { function } callback - Used to handle {'stateChange'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
on(type: 'stateChange', callback: (state: PiPState, reason: string) => void): void;
/**
* Unregister picture-in-picture lifecycle event listener.
* @param { 'stateChange' } type - Used to unregister listener for {'stateChange'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
off(type: 'stateChange'): void;
/**
* Register picture-in-picture control event listener.
* @param { 'controlPanelActionEvent' } type - Registration type, user action event, 'controlPanelActionEvent'
* @param { function } callback - Used to handle {'controlPanelActionEvent'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
on(type: 'controlPanelActionEvent', callback: (event: PiPActionEventType) => void): void;
/**
* Unregister picture-in-picture lifecycle event listener
* @param { 'controlPanelActionEvent' } type - Used to unregister listener for {'controlPanelActionEvent'} command
* @syscap SystemCapability.Window.SessionManager
* @since 11
*/
off(type: 'controlPanelActionEvent'): void;
}
}
export default PiPWindow;
/*
* Copyright (c) 2022-2023 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 BackgroundTasksKit
*/
import workScheduler from './@ohos.resourceschedule.workScheduler';
import _WorkSchedulerExtensionContext from './application/WorkSchedulerExtensionContext';
/**
* The context of work scheduler extension. It allows access to
* WorkSchedulerExtensionContext-specific resources.
*
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
* @StageModelOnly
* @since 10
*/
export type WorkSchedulerExtensionContext = _WorkSchedulerExtensionContext;
/**
* Class of the work scheduler extension ability.
*
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
* @StageModelOnly
* @since 9
*/
export default class WorkSchedulerExtensionAbility {
/**
* Indicates work scheduler extension ability context.
*
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
* @StageModelOnly
* @since 10
*/
context: WorkSchedulerExtensionContext;
/**
* Called back when a work is started.
*
* @param {workScheduler.WorkInfo} work - The info of work.
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
* @StageModelOnly
* @since 9
*/
onWorkStart(work: workScheduler.WorkInfo): void;
/**
* Called back when a work is stopped.
*
* @param {workScheduler.WorkInfo} work - The info of work.
* @syscap SystemCapability.ResourceSchedule.WorkScheduler
* @StageModelOnly
* @since 9
*/
onWorkStop(work: workScheduler.WorkInfo): void;
}
/*
* Copyright (c) 2022-2023 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 AbilityKit
*/
import { DataAbilityHelper as _DataAbilityHelper } from './ability/dataAbilityHelper';
import { PacMap as _PacMap } from './ability/dataAbilityHelper';
import { DataAbilityOperation as _DataAbilityOperation } from './ability/dataAbilityOperation';
import { DataAbilityResult as _DataAbilityResult } from './ability/dataAbilityResult';
import { AbilityResult as _AbilityResult } from './ability/abilityResult';
import { ConnectOptions as _ConnectOptions } from './ability/connectOptions';
import { StartAbilityParameter as _StartAbilityParameter } from './ability/startAbilityParameter';
/**
* The class of an ability.
*
* @namespace ability
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @FAModelOnly
* @since 9
*/
/**
* The class of an ability.
*
* @namespace ability
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @since 11
*/
declare namespace ability {
/**
* DataAbilityHelper
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 9
*/
export type DataAbilityHelper = _DataAbilityHelper;
/**
* Defines a PacMap object for storing a series of values.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 9
*/
/**
* Defines a PacMap object for storing a series of values.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @since 11
*/
export type PacMap = _PacMap;
/**
* DataAbilityOperation secondary module.Define the DataAbility data operation method,
* which can be used as an input parameter for [executeBatch] to manipulate database information.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 9
*/
export type DataAbilityOperation = _DataAbilityOperation;
/**
* DataAbilityResult secondary module.Define the DataAbility data operation result.
* When operating the database through [executeBatch], the operation result is returned
* using the DataAbility Result object.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 9
*/
export type DataAbilityResult = _DataAbilityResult;
/**
* AbilityResult secondary module.The result code and data returned after the ability is pulled
* up and exited can be defined. The ability result object returned after the ability is pulled
* up and exited can be obtained through [startAbilityForResult], and the ability object pulled up
* by startAbilityForResult can be returned through [terminateSelfWithResult].
*
* @syscap SystemCapability.Ability.AbilityBase
* @FAModelOnly
* @since 9
*/
export type AbilityResult = _AbilityResult;
/**
* ConnectOptions secondary module.As an input parameter when connecting to a specified backend service,
* used to receive state changes during the connection process
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @FAModelOnly
* @since 9
*/
export type ConnectOptions = _ConnectOptions;
/**
* StartAbilityParameter secondary module.Define the Start Ability parameter, which can be used as
* an input parameter to call [startAbility] to start the specified Ability.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 9
*/
export type StartAbilityParameter = _StartAbilityParameter;
}
export default ability;
/*
* Copyright (c) 2021-2023 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 AbilityKit
*/
/**
* A utility class used for handling objects that use the DataAbilityHelper scheme.
*
* @namespace dataUriUtils
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 7
* @deprecated since 9
* @useinstead ohos.app.ability.dataUriUtils/dataUriUtils
*/
declare namespace dataUriUtils {
/**
* Obtains the ID attached to the end of the path component of the given uri.
*
* @param { string } uri - Indicates the uri object from which the ID is to be obtained.
* @returns { number } Returns the ID attached to the end of the path component;
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 7
* @deprecated since 9
* @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#getId
*/
function getId(uri: string): number;
/**
* Attaches the given ID to the end of the path component of the given uri.
*
* @param { string } uri - Indicates the uri string from which the ID is to be obtained.
* @param { number } id - Indicates the ID to attach.
* @returns { string } Returns the uri object with the given ID attached.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 7
* @deprecated since 9
* @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#attachId
*/
function attachId(uri: string, id: number): string;
/**
* Deletes the ID from the end of the path component of the given uri.
*
* @param { string } uri - Indicates the uri object from which the ID is to be deleted.
* @returns { string } Returns the uri object with the ID deleted.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 7
* @deprecated since 9
* @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#deleteId
*/
function deleteId(uri: string): string;
/**
* Updates the ID in the specified uri
*
* @param { string } uri - Indicates the uri object to be updated.
* @param { number } id - Indicates the new ID.
* @returns { string } Returns the updated uri object.
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 7
* @deprecated since 9
* @useinstead ohos.app.ability.dataUriUtils/dataUriUtils#updateId
*/
function updateId(uri: string, id: number): string;
}
export default dataUriUtils;
/*
* Copyright (c) 2022-2023 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 AbilityKit
*/
/**
* Defines error codes used when starting an ability, for example, featureAbility.ErrorCode.NO_ERROR.
*
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 6
*/
export enum ErrorCode {
/**
* Permission denied.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 6
*/
PERMISSION_DENY = -3,
/**
* Ability not found.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 6
*/
ABILITY_NOT_FOUND = -2,
/**
* Invalid parameter.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 6
*/
INVALID_PARAMETER = -1,
/**
* No error.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @since 6
*/
NO_ERROR = 0
}
/*
* Copyright (c) 2021-2023 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 AbilityKit
*/
import { AsyncCallback } from './@ohos.base';
import Want from './@ohos.app.ability.Want';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { AbilityResult } from './ability/abilityResult';
import { AppVersionInfo as _AppVersionInfo } from './app/appVersionInfo';
import { Context as _Context } from './app/context';
import { DataAbilityHelper } from './ability/dataAbilityHelper';
import { ConnectOptions } from './ability/connectOptions';
import { ProcessInfo as _ProcessInfo } from './app/processInfo';
import window from './@ohos.window';
/**
* A Feature Ability represents an ability with a UI and is designed to interact with users.
*
* @namespace featureAbility
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 6
*/
declare namespace featureAbility {
/**
* Obtain the want sent from the source ability.
*
* @param { AsyncCallback<Want> } callback - Indicates the ability to start.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 6
*/
function getWant(callback: AsyncCallback<Want>): void;
/**
* Obtain the want sent from the source ability.
*
* @returns { Promise<Want> } The promise form returns the Want result
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 6
*/
function getWant(): Promise<Want>;
/**
* Starts a new ability.
*
* @param { StartAbilityParameter } parameter - Indicates the ability to start.
* @param { AsyncCallback<number> } callback - Returns the result of starting Ability in the form of callback.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 6
*/
function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void;
/**
* Starts a new ability.
*
* @param { StartAbilityParameter } parameter - Indicates the ability to start.
* @returns { Promise<number> } The promise form returns the Ability result
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 6
*/
function startAbility(parameter: StartAbilityParameter): Promise<number>;
/**
* Obtains the application context.
*
* @returns { Context } Returns the application context.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 6
*/
function getContext(): Context;
/**
* Starts an ability and returns the execution result when the ability is destroyed.
*
* @param { StartAbilityParameter } parameter - Indicates the ability to start.
* @param { AsyncCallback<AbilityResult> } callback - Returns the result of starting Ability in the form of callback.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void;
/**
* Starts an ability and returns the execution result when the ability is destroyed.
*
* @param { StartAbilityParameter } parameter - Indicates the ability to start.
* @returns { Promise<AbilityResult> } Returns the {@link AbilityResult}.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>;
/**
* Destroys the Page ability while returning the specified result code and data to the caller.
*
* @param { AbilityResult } parameter - Indicates the result to return.
* @param { AsyncCallback<void> } callback - Return the result of stopping Ability in the form of callback.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void;
/**
* Destroys the Page ability while returning the specified result code and data to the caller.
*
* @param { AbilityResult } parameter - Indicates the result to return.
* @returns { Promise<void> } the promise returned by the function.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
/**
* Destroys this Page ability.
*
* @param { AsyncCallback<void> } callback - Returns the stop ability result in the form of a callback.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function terminateSelf(callback: AsyncCallback<void>): void;
/**
* Destroys this Page ability.
*
* @returns { Promise<void> } the promise returned by the function.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function terminateSelf(): Promise<void>;
/**
* Obtains the dataAbilityHelper.
*
* @param { string } uri - Indicates the path of the file to open.
* @returns { DataAbilityHelper } Returns the dataAbilityHelper.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function acquireDataAbilityHelper(uri: string): DataAbilityHelper;
/**
* Checks whether the main window of this ability has window focus.
*
* @param { AsyncCallback<boolean> } callback - Returns the result in the form of callback.If this ability currently
* has window focus,return true otherwise,return false.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function hasWindowFocus(callback: AsyncCallback<boolean>): void;
/**
* Checks whether the main window of this ability has window focus.
*
* @returns { Promise<boolean> } Returns {@code true} if this ability currently has window focus;
* returns {@code false} otherwise.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function hasWindowFocus(): Promise<boolean>;
/**
* Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template.
*
* @param { Want } request - The element name of the service ability
* @param { ConnectOptions } options - The remote object instance
* @returns { number } Returns the number code of the ability connected
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function connectAbility(request: Want, options: ConnectOptions): number;
/**
* Disconnects ability to a Service ability.
*
* @param { number } connection - The number code of the ability connected
* @param { AsyncCallback<void> } callback - Returns the disconnection result in the form of callback.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function disconnectAbility(connection: number, callback: AsyncCallback<void>): void;
/**
* Disconnects ability to a Service ability.
*
* @param { number } connection - The number code of the ability connected
* @returns { Promise<void> } the promise returned by the function.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function disconnectAbility(connection: number): Promise<void>;
/**
* Obtains the window corresponding to the current ability.
*
* @param { AsyncCallback<window.Window> } callback - Returns the window corresponding to the current ability
* in the form of callback.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function getWindow(callback: AsyncCallback<window.Window>): void;
/**
* Obtains the window corresponding to the current ability.
*
* @returns { Promise<window.Window> } Returns the window corresponding to the current ability.
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
function getWindow(): Promise<window.Window>;
/**
* Enum for the window configuration.
*
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
export enum AbilityWindowConfiguration {
/**
* Undefined window format.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
WINDOW_MODE_UNDEFINED = 0,
/**
* Full screen.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
WINDOW_MODE_FULLSCREEN = 1,
/**
* If the screen is horizontally oriented, it indicates left split, and if the screen is vertically oriented,
* it indicates upper split.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
WINDOW_MODE_SPLIT_PRIMARY = 100,
/**
* If the screen is horizontally oriented, it indicates right split, and if the screen is vertically oriented,
* it indicates bottom split.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
WINDOW_MODE_SPLIT_SECONDARY = 101,
/**
* Suspended window.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
WINDOW_MODE_FLOATING = 102
}
/**
* Enum for the special start setting used in starting ability.
*
* @enum { string }
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
export enum AbilityStartSetting {
/**
* The parameter name for the window display size attribute.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
BOUNDS_KEY = 'abilityBounds',
/**
* The parameter name of the window display mode attribute.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
WINDOW_MODE_KEY = 'windowMode',
/**
* The window displays the parameter name of the device ID attribute.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
DISPLAY_ID_KEY = 'displayId'
}
/**
* Enum for the error code.
*
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
export enum ErrorCode {
/**
* There are no errors.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
NO_ERROR = 0,
/**
* Invalid parameter.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
INVALID_PARAMETER = -1,
/**
* Unable to find ABILITY.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
ABILITY_NOT_FOUND = -2,
/**
* Permission denied.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
PERMISSION_DENY = -3
}
/**
* Enum for the operation type of data.
*
* @enum { number }
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
export enum DataAbilityOperationType {
/**
* Insert type.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
TYPE_INSERT = 1,
/**
* Modify the type.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
TYPE_UPDATE = 2,
/**
* Delete type.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
TYPE_DELETE = 3,
/**
* Declaration type.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
* @since 7
*/
TYPE_ASSERT = 4
}
/**
* The context of an ability or an application. It allows access to
* application-specific resources, request and verification permissions.
* Can only be obtained through the ability.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @FAModelOnly
* @since 9
*/
export type Context = _Context;
/**
* Defines an AppVersionInfo object.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @FAModelOnly
* @since 9
*/
export type AppVersionInfo = _AppVersionInfo;
/**
* This process information about an application.
*
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @FAModelOnly
* @since 9
*/
export type ProcessInfo = _ProcessInfo;
}
export default featureAbility;
/*
* Copyright (c) 2022 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 AccessibilityKit
*/
import type { GesturePoint } from './@ohos.accessibility.GesturePoint';
/**
* Indicates the path of the gesture.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
export declare class GesturePath {
/**
* A constructor used to create a GesturePath object.
*
* @param { number } durationTime - Indicates the duration of the gesture.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
constructor(durationTime: number);
/**
* Indicates the position of the points that make up the gesture.
*
* @type { Array<GesturePoint> }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
points: Array<GesturePoint>;
/**
* Indicates the duration of the gesture.
*
* @type { number }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
durationTime: number;
}
/*
* Copyright (c) 2022 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 AccessibilityKit
*/
/**
* Indicates the point of the gesture.
*
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
export declare class GesturePoint {
/**
* A constructor used to create a GesturePoint object.
*
* @param { number } positionX - Indicates the X coordinate of point.
* @param { number } positionY - Indicates the Y coordinate of point.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
constructor(positionX: number, positionY: number);
/**
* Indicates the X coordinate of point.
*
* @type { number }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
positionX: number;
/**
* Indicates the Y coordinate of point.
*
* @type { number }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 9
*/
positionY: number;
}
/*
* Copyright (c) 2023 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 AdsKit
*/
import advertising from './@ohos.advertising';
/**
* Defines the ad component.
* @syscap SystemCapability.Advertising.Ads
* @since 11
*/
@Component
declare struct AdComponent {
/**
* The ads to display.
* @type { Advertisement[] }
* @syscap SystemCapability.Advertising.Ads
* @since 11
*/
ads: advertising.Advertisement[];
/**
* The interaction options info for displaying ads.
* @type { AdDisplayOptions }
* @syscap SystemCapability.Advertising.Ads
* @since 11
*/
displayOptions: advertising.AdDisplayOptions;
/**
* The interaction listener to be registered that use to show ads.
* @type { AdInteractionListener }
* @syscap SystemCapability.Advertising.Ads
* @since 11
*/
interactionListener: advertising.AdInteractionListener;
/**
* The method to build ad component.
* @syscap SystemCapability.Advertising.Ads
* @since 11
*/
build(): void;
}
export { AdComponent };
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册