diff --git a/BUILD.gn b/BUILD.gn index fcf53893829e4a51e0b8b4b3f833e71b0d639a76..faeb6f51919a7413ed54673e7bcec0529be64552 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -210,6 +210,16 @@ ohos_copy("system_api") { module_install_name = "" } +ohos_copy("config") { + sources = [ + "api/config/css", + "api/config/hml", + ] + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + ohos_copy("form_declaration") { sources = [ "api/form/action", diff --git a/api/@internal/js/global.js.d.ts b/api/@internal/js/global.js.d.ts deleted file mode 100644 index 2d6a6cfcd5bd22b1e674e9880ee230b7c4685f6d..0000000000000000000000000000000000000000 --- a/api/@internal/js/global.js.d.ts +++ /dev/null @@ -1,334 +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 declare class Image { - src: string; - width?: number; - height?: number; - onload?: () => void; - onerror?: () => void; -} -export declare class ImageData { - width: number; - height: number; - data: Uint8ClampedArray; -} -export interface FocusParamObj { - focus: boolean; -} -export interface AnimateStyle { - width: number; - height: number; - backgroundColor: string; - opacity: number; - backgroundPosition: string; - transformOrigin: string; - transform: object; - offset?: number; -} -export interface AnimateOptions { - duration: number; - easing: string; - delay: number; - iterations: number | string; - fill: "none" | "forwards"; -} -export interface AnimationResult { - finished: boolean; - pending: boolean; - playstate: string; - startTime: number; - play(): void; - finish(): void; - pause(): void; - cancel(): void; - reverse(): void; - onfinish: () => void; - oncancel: () => void; -} -export interface Element { - focus(obj?: FocusParamObj): void; - rotation(obj?: FocusParamObj): void; - animate( - keyframes: Array, - options: AnimateOptions - ): AnimationResult; -} -export interface AnimationElement extends Element { - play(): void; - finish(): void; - pause(): void; - cancel(): void; - reverse(): void; -} -export interface ListScrollByOptions { - dx?: number; - dy?: number; - smooth?: boolean; -} -export interface CurrentOffsetResultValue { - x: number; - y: number; -} -export interface ListScrollToOptions { - index: number; -} -export interface ListElement extends Element { - scrollTo(position: ListScrollToOptions): void; - scrollBy(data: ListScrollByOptions): void; - scrollTop(param: { smooth: boolean }): void; - scrollBottom(param: { smooth: boolean }): void; - scrollPage(params: { reverse: boolean; smooth: boolean }): void; - scrollArrow(params: { reverse: boolean; smooth: boolean }): void; - collapseGroup(param: { - groupid: string; - }): void; - expandGroup(param: { - groupid: string; - }): void; - currentOffset(): CurrentOffsetResultValue; -} -export interface SwiperElement extends Element { - swipeTo(position: { - index: number; - }): void; - showNext(): void; - showPrevious(): void; -} -export interface DialogElement extends Element { - show(): void; - close(): void; -} -export interface ImageAnimatorElement extends Element { - start(): void; - pause(): void; - stop(): void; - resume(): void; - getState(): "Playing" | "Paused" | "Stopped"; -} -export interface MarqueeElement extends Element { - start(): void; - stop(): void; -} -export interface MenuElement extends Element { - show(position: { x: number; y: number }): void; -} -export interface ChartElement extends Element { - append(params: { - serial: number; - data: Array; - }): void; -} -export interface InputElement extends Element { - focus(param: { focus: boolean }): void; - showError(param: { error: string }): void; -} -export interface ButtonElement extends Element { - setProgress(param: { progress: number }): void; -} -export interface TextAreaElement extends Element { - focus(param: { focus: boolean }): void; -} -export interface PickerElement extends Element { - show(): void; -} -export interface VideoElement extends Element { - start(): void; - pause(): void; - setCurrentTime(param: { currenttime: number }): void; - requestFullscreen(param: { screenOrientation: "default" }): void; - exitFullscreen(): void; -} -export interface TextMetrics { - width: number; -} -export interface CanvasRenderingContext2D { - fillRect(x: number, y: number, width: number, height: number): void; - fillStyle?: string | CanvasGradient | CanvasPattern; - clearRect(x: number, y: number, width: number, height: number): void; - strokeRect(x: number, y: number, width: number, height: number): void; - fillText(text: string, x: number, y: number): void; - strokeText(text: string, x: number, y: number): void; - measureText(text: string): TextMetrics; - lineWidth?: number; - strokeStyle?: string | CanvasGradient | CanvasPattern; - stroke(): void; - beginPath(): void; - moveTo(x: number, y: number): void; - lineTo(x: number, y: number): void; - closePath(): void; - lineCap: string; - lineJoin: string; - miterLimit: number; - font: string; - textAlign: "left" | "right" | "center" | "start" | "end"; - textBaseline: string; - createLinearGradient( - x0: number, - y0: number, - x1: number, - y1: number - ): CanvasGradient; - createPattern(image: Image, repetition: string): object; - bezierCurveTo( - cp1x: number, - cp1y: number, - cp2x: number, - cp2y: number, - x: number, - y: number - ): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - arc( - x: number, - y: number, - radius: number, - startAngle: number, - endAngel: number, - anticlockwise?: boolean - ): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - rect(x: number, y: number, width: number, height: number): void; - fill(): void; - clip(): void; - rotate(rotate: number): void; - scale(x: number, y: number): void; - transform( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number - ): void; - setTransform( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number - ): void; - translate(x: number, y: number): void; - globalAlpha: number; - drawImage( - image: Image, - dx: number, - dy: number, - dWidth: number, - dHeight: number, - sx: number, - sy: number, - sWidth: number, - sHeight: number - ): void; - restore: () => void; - save: () => void; - createImageData(width: number, height: number): ImageData; - createImageData(imagedata: ImageData): ImageData; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - putImageData(imageData: ImageData, dx: number, dy: number): void; - putImageData( - imageData: ImageData, - dx: number, - dy: number, - dirtyX: number, - dirtyY: number, - dirtyWidth: number, - dirtyHeight: number - ): void; - setLineDash(segments: Array): void; - getLineDash(): Array; - lineDashOffset: number; - globalCompositeOperation: string; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; -} -export interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -export interface CanvasElement extends Element { - getContext(param: string): CanvasRenderingContext2D; -} -export interface Application { - $def: object; -} -export interface ViewModel { - $app: Application; - $t(path: string, params?: object | Array): string; - $tc(path: string, count: number): string; - $r(path: string): string; - $set(key: string, value: any): void; - $delete(key: string): void; - $element( - id?: string - ): AnimationElement & - CanvasElement & - object & - ListElement & - SwiperElement & - DialogElement & - ImageAnimatorElement & - MarqueeElement & - MenuElement & - ChartElement & - InputElement & - ButtonElement & - TextAreaElement & - PickerElement & - VideoElement; - $root(): ViewModel & object; - $parent(): ViewModel & object; - $child(id: string): ViewModel & object; - $watch(data: string, callback: string): void; - $refs: ElementReferences; - $emit(event: string, params?: object): void; -} -export interface ElementReferences { - [k: string]: AnimationElement & - CanvasElement & - object & - ListElement & - SwiperElement & - DialogElement & - ImageAnimatorElement & - MarqueeElement & - MenuElement & - ChartElement & - InputElement & - ButtonElement & - TextAreaElement & - PickerElement & - VideoElement; -} -export interface Options> { - data?: Data; - onInit?(): void; - onReady?(): void; - onShow?(): void; - onHide?(): void; - onDestroy?(): void; - onBackPress?(): boolean; - onCreate?(): void; -} -type DefaultData = object; -type CombinedOptions = object & - Options & - ThisType; -export declare function extendViewModel( - options: CombinedOptions -): ViewModel & Data; diff --git a/api/@internal/js/globaljs.d.ts b/api/@internal/js/globaljs.d.ts deleted file mode 100644 index f98e82b37c79a35f09390e5f457b18f1db25135c..0000000000000000000000000000000000000000 --- a/api/@internal/js/globaljs.d.ts +++ /dev/null @@ -1,552 +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 declare class Image { - src: string; - width?: number; - height?: number; - onload?: () => void; - onerror?: () => void; -} -export declare class ImageData { - width: number; - height: number; - data: Uint8ClampedArray; -} -export interface FocusParamObj { - focus: boolean; -} -export interface ContextAttrOptions { - antialias: boolean; -} -export interface CanvasRenderingContext2DSettings { - alpha?: boolean; - desynchronized?: boolean; -} -export interface ImageBitmapRenderingContextSettings { - alpha?: boolean; -} -export interface AnimateStyle { - width: number; - height: number; - left: number; - top: number; - right: number; - bottom: number; - backgroundColor: string; - opacity: number; - backgroundPosition: string; - transformOrigin: string; - transform: "none" | TransformObject; - offset?: number; -} -export interface TransformObject { - matrix(scaleX: number, skewX: number, skewY: number, - scaleY: number, translateX: number, translateY: number): void; - matrix3d(n00: number, n01: number, n02: number, n03: number, - n10: number, n11: number, n12: number, n13: number, - n20: number, n21: number, n22: number, n23: number, - n30: number, n31: number, n32: number, n33: number): void; - translate(x: number, y: number): void; - translate3d(x: number, y: number, z: number): void; - translateX(x: number): void; - translateY(y: number): void; - translateZ(z: number): void; - scale(x: number, y: number): void; - scale3d(x: number, y: number, z: number): void; - scaleX(x: number): void; - scaleY(y: number): void; - scaleZ(z: number): void; - rotate(angle: number): void; - rotate3d(x: number, y: number, z: number, angle: number): void; - rotateX(angle: number): void; - rotateY(angle: number): void; - rotateZ(angle: number): void; - skew(xAngle: number, yAngle: number): void; - skewX(angle: number): void; - skewY(angle: number): void; - perspective(verticalDistance: number): void; -} -export interface AnimateOptions { - duration: number; - easing: string; - delay: number; - iterations: number | string; - fill: "none" | "forwards"; -} -export interface AnimationResult { - finished: boolean; - pending: boolean; - playstate: string; - startTime: number; - play(): void; - finish(): void; - pause(): void; - cancel(): void; - reverse(): void; - onfinish: () => void; - oncancel: () => void; -} -export interface Element { - focus(obj?: FocusParamObj): void; - rotation(obj?: FocusParamObj): void; - animate( - keyframes: Array, - options: AnimateOptions - ): AnimationResult; -} -export interface AnimationElement extends Element { - play(): void; - finish(): void; - pause(): void; - cancel(): void; - reverse(): void; -} -export interface ListScrollByOptions { - dx?: number; - dy?: number; - smooth?: boolean; -} -export interface CurrentOffsetResultValue { - x: number; - y: number; -} -export interface ListScrollToOptions { - index: number; -} -export interface ListElement extends Element { - scrollTo(position: ListScrollToOptions): void; - scrollBy(data: ListScrollByOptions): void; - scrollTop(param: { smooth: boolean }): void; - scrollBottom(param: { smooth: boolean }): void; - scrollPage(params: { reverse: boolean; smooth: boolean }): void; - scrollArrow(params: { reverse: boolean; smooth: boolean }): void; - collapseGroup(param: { - groupid: string; - }): void; - expandGroup(param: { - groupid: string; - }): void; - currentOffset(): CurrentOffsetResultValue; -} -export interface SwiperElement extends Element { - swipeTo(position: { - index: number; - }): void; - showNext(): void; - showPrevious(): void; -} -export interface WebElement extends Element { - reload(): void; -} -export interface DialogElement extends Element { - show(): void; - close(): void; -} -export interface ImageAnimatorElement extends Element { - start(): void; - pause(): void; - stop(): void; - resume(): void; - getState(): "Playing" | "Paused" | "Stopped"; -} -export interface MarqueeElement extends Element { - start(): void; - stop(): void; -} -export interface MenuElement extends Element { - show(position: { x: number; y: number }): void; -} -export interface ChartElement extends Element { - append(params: { - serial: number; - data: Array; - }): void; -} -export interface InputElement extends Element { - focus(param: { focus: boolean }): void; - showError(param: { error: string }): void; -} -export interface ButtonElement extends Element { - setProgress(param: { progress: number }): void; -} -export interface TextAreaElement extends Element { - focus(param: { focus: boolean }): void; -} -export interface PickerElement extends Element { - show(): void; -} -export interface VideoElement extends Element { - start(): void; - pause(): void; - setCurrentTime(param: { currenttime: number }): void; - requestFullscreen(param: { screenOrientation: "default" }): void; - exitFullscreen(): void; -} -export interface TextMetrics { - width: number; -} -export interface CanvasRenderingContext2D { - fillRect(x: number, y: number, width: number, height: number): void; - fillStyle?: string | CanvasGradient | CanvasPattern; - clearRect(x: number, y: number, width: number, height: number): void; - strokeRect(x: number, y: number, width: number, height: number): void; - fillText(text: string, x: number, y: number): void; - strokeText(text: string, x: number, y: number): void; - measureText(text: string): TextMetrics; - lineWidth?: number; - strokeStyle?: string | CanvasGradient | CanvasPattern; - stroke(): void; - stroke(path: Path2D): void; - beginPath(): void; - moveTo(x: number, y: number): void; - lineTo(x: number, y: number): void; - closePath(): void; - lineCap: string; - lineJoin: string; - miterLimit: number; - font: string; - textAlign: "left" | "right" | "center" | "start" | "end"; - textBaseline: string; - createLinearGradient( - x0: number, - y0: number, - x1: number, - y1: number - ): CanvasGradient; - createRadialGradient( - x0: number, - y0: number, - r0: number, - x1: number, - y1: number, - r1: number - ): CanvasGradient; - createPattern(image: Image, repetition: string): CanvasPattern; - createPath2D(path?: Path2D): Path2D; - createPath2D(cmds?: string): Path2D; - bezierCurveTo( - cp1x: number, - cp1y: number, - cp2x: number, - cp2y: number, - x: number, - y: number - ): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - arc( - x: number, - y: number, - radius: number, - startAngle: number, - endAngel: number, - anticlockwise?: boolean - ): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - ellipse( - x: number, - y: number, - radiusX: number, - radiusY: number, - rotation: number, - startAngle: number, - endAngle: number, - anticlockwise?: number - ): void; - rect(x: number, y: number, width: number, height: number): void; - fill(): void; - clip(): void; - rotate(rotate: number): void; - scale(x: number, y: number): void; - transform( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number - ): void; - setTransform( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number - ): void; - translate(x: number, y: number): void; - globalAlpha: number; - drawImage( - image: Image, - dx: number, - dy: number, - dWidth: number, - dHeight: number, - sx: number, - sy: number, - sWidth: number, - sHeight: number - ): void; - restore: () => void; - save: () => void; - createImageData(width: number, height: number): ImageData; - createImageData(imagedata: ImageData): ImageData; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - putImageData(imageData: ImageData, dx: number, dy: number): void; - putImageData( - imageData: ImageData, - dx: number, - dy: number, - dirtyX: number, - dirtyY: number, - dirtyWidth: number, - dirtyHeight: number - ): void; - setLineDash(segments: Array): void; - getLineDash(): Array; - lineDashOffset: number; - globalCompositeOperation: string; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; -} -export interface CanvasGradient { - addColorStop(offset: number, color: string): void; -} -export interface CanvasPattern { - setTransform( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number - ): void; -} -export interface Path2D { - addPath(path: Path2D): void; - setTransform( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number - ): void; - closePath(): void; - moveTo(x: number, y: number): void; - lineTo(x: number, y: number): void; - bezierCurveTo( - cp1x: number, - cp1y: number, - cp2x: number, - cp2y: number, - x: number, - y: number - ): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - arc( - x: number, - y: number, - radius: number, - startAngle: number, - endAngel: number, - anticlockwise?: boolean - ): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - ellipse( - x: number, - y: number, - radiusX: number, - radiusY: number, - rotation: number, - startAngle: number, - endAngle: number, - anticlockwise?: number - ): void; - rect(x: number, y: number, width: number, height: number): void; -} -export class OffscreenCanvasRenderingContext2D { - readonly canvas: OffscreenCanvas; - globalAlpha: number; - globalCompositeOperation: string; - filter: string; - imageSmoothingEnabled: boolean; - imageSmoothingQuality: "high" | "low" | "medium"; - direction: "inherit" | "ltr" | "rtl"; - font: string; - textAlign: "center" | "end" | "left" | "right" | "start"; - textBaseline: "alphabetic" | "bottom" | "hanging" | "ideographic" | "middle" | "top"; - shadowBlur: number; - shadowColor: string; - shadowOffsetX: number; - shadowOffsetY: number; - lineCap: "butt" | "round" | "square"; - lineDashOffset: number; - lineJoin: CanvasLineJoin; - lineWidth: number; - miterLimit: number; - getLineDash(): number[]; - setLineDash(segments: number[]): void; - drawImage(image: Image, dx: number, dy: number): void; - drawImage(image: Image, dx: number, dy: number, dw: number, dh: number): void; - drawImage(image: Image, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void; - beginPath(): void; - clip(fillRule?: "evenodd" | "nonzero"): void; - clip(path: Path2D, fillRule?: "evenodd" | "nonzero"): void; - fill(fillRule?: "evenodd" | "nonzero"): void; - fill(path: Path2D, fillRule?: "evenodd" | "nonzero"): void; - isPointInPath(x: number, y: number, fillRule?: "evenodd" | "nonzero"): boolean; - isPointInPath(path: Path2D, x: number, y: number, fillRule?: "evenodd" | "nonzero"): boolean; - isPointInStroke(x: number, y: number): boolean; - isPointInStroke(path: Path2D, x: number, y: number): boolean; - stroke(): void; - stroke(path: Path2D): void; - fillStyle: string | CanvasGradient | CanvasPattern; - strokeStyle: string | CanvasGradient | CanvasPattern; - createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient; - createPattern(image: Image, repetition: string): CanvasPattern; - createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient; - createImageData(sw: number, sh: number): ImageData; - createImageData(imagedata: ImageData): ImageData; - getImageData(sx: number, sy: number, sw: number, sh: number): ImageData; - putImageData(imagedata: ImageData, dx: number, dy: number): void; - putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void; - arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void; - bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void; - closePath(): void; - ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void; - lineTo(x: number, y: number): void; - moveTo(x: number, y: number): void; - quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void; - rect(x: number, y: number, w: number, h: number): void; - clearRect(x: number, y: number, w: number, h: number): void; - fillRect(x: number, y: number, w: number, h: number): void; - strokeRect(x: number, y: number, w: number, h: number): void; - fillText(text: string, x: number, y: number, maxWidth?: number): void; - measureText(text: string): TextMetrics; - strokeText(text: string, x: number, y: number, maxWidth?: number): void; - resetTransform(): void; - rotate(angle: number): void; - scale(x: number, y: number): void; - setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void; - transform(a: number, b: number, c: number, d: number, e: number, f: number): void; - translate(x: number, y: number): void; - restore(): void; - save(): void; - commit(): void; -} -export class ImageBitmapRenderingContext { - transferFromImageBitmap(bitmap: ImageBitmap): void; -} -export class ImageBitmap { - readonly height: number; - readonly width: number; - close(): void; -} -export class OffscreenCanvas { - width: number; - height: number; - getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D; - toDataURL(type?: string, quality?: number): string; - transferToImageBitmap(): ImageBitmap; -} -export interface CanvasElement extends Element { - getContext(contextId: "2d", options?: ContextAttrOptions): CanvasRenderingContext2D; - getContext(contextId: "bitmaprenderer", options?: ImageBitmapRenderingContextSettings): ImageBitmapRenderingContext; - toDataURL(type?: string, quality?: number): string; -} -export interface ScrollOptions { - duration?: number; - position?: number; - id?: string; - timingFunction?: string; - success?: (data: string) => void; - fail?: (data: string) => void; - complete?: (data: string) => void; -} -export interface Application { - $def: object; -} -export interface ViewModel { - $app: Application; - $t(path: string, params?: object | Array): string; - $tc(path: string, count: number): string; - $r(path: string): string; - $set(key: string, value: any): void; - $delete(key: string): void; - $element( - id?: string - ): AnimationElement & - CanvasElement & - object & - WebElement & - ListElement & - SwiperElement & - DialogElement & - ImageAnimatorElement & - MarqueeElement & - MenuElement & - ChartElement & - InputElement & - ButtonElement & - TextAreaElement & - PickerElement & - VideoElement; - $root(): ViewModel & object; - $parent(): ViewModel & object; - $child(id: string): ViewModel & object; - $watch(data: string, callback: string): void; - $refs: ElementReferences; - $emit(event: string, params?: object): void; - scrollTo(options: ScrollOptions): void; -} -export interface ElementReferences { - [k: string]: AnimationElement & - CanvasElement & - object & - WebElement & - ListElement & - SwiperElement & - DialogElement & - ImageAnimatorElement & - MarqueeElement & - MenuElement & - ChartElement & - InputElement & - ButtonElement & - TextAreaElement & - PickerElement & - VideoElement; -} -export interface Options> { - data?: Data; - onInit?(): void; - onReady?(): void; - onShow?(): void; - onHide?(): void; - onDestroy?(): void; - onBackPress?(): boolean; - onCreate?(): void; -} -type DefaultData = object; -type CombinedOptions = object & - Options & - ThisType; -export declare function extendViewModel( - options: CombinedOptions -): ViewModel & Data; diff --git a/api/@internal/js/index.d.ts b/api/@internal/js/index.d.ts deleted file mode 100644 index 4a56d000e8f66f658a1bb96be20076746b0fb6b8..0000000000000000000000000000000000000000 --- a/api/@internal/js/index.d.ts +++ /dev/null @@ -1,17 +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 * from './globaljs'; -export * from './global'; \ No newline at end of file diff --git a/api/device-define/phone.json b/api/device-define/phone.json new file mode 100644 index 0000000000000000000000000000000000000000..23513a932be9efcfcad0b0d9c2090750c1c14d95 --- /dev/null +++ b/api/device-define/phone.json @@ -0,0 +1,16 @@ +{ + "SysCaps": [ + "SystemCapability.ArkUI.ArkUI.Full", + "SystemCapability.ArkUI.ArkUI.Lite", + "SystemCapability.ArkUI.ArkUI.Napi", + "SystemCapability.ArkUI.ArkUI.Libuv", + "SystemCapability.BundleManager.BundleFramework", + "SystemCapability.BundleManager.DistributedBundleFramework", + "SystemCapability.BundleManager.BundleTool", + "SystemCapability.BundleManager.Zlib", + "SystemCapability.BundleManager.PackingTool", + "SystemCapability.Graphic.Graphic2D.WebGL", + "SystemCapability.Graphic.Graphic2D.WebGL2", + "SystemCapability.WindowManager.WindowManager.Core" + ] +} \ No newline at end of file diff --git a/api/phone/@internal/console.d.ts b/api/phone/@internal/console.d.ts deleted file mode 100644 index a89f67bb0d4c1a7891e03c9c5aef61c6bfc04e57..0000000000000000000000000000000000000000 --- a/api/phone/@internal/console.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2020 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export declare class console { - /** - * Prints "debug" logs. - * @param message Text to print. - */ - static debug(message: string, ...arguments: any[]): void; - - /** - * Prints "log" logs. - * @param message Text to print. - */ - static log(message: string, ...arguments: any[]): void; - - /** - * Prints "info" logs. - * @param message Text to print. - */ - static info(message: string, ...arguments: any[]): void; - - /** - * Prints "warn" logs. - * @param message Text to print. - */ - static warn(message: string, ...arguments: any[]): void; - - /** - * Prints "error" logs. - * @param message Text to print. - */ - static error(message: string, ...arguments: any[]): void; -} diff --git a/api/phone/@internal/global.d.ts b/api/phone/@internal/global.d.ts deleted file mode 100644 index 85ca2417a74924517b154f5c8dd25cc9384d6038..0000000000000000000000000000000000000000 --- a/api/phone/@internal/global.d.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2020 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * Sets the interval for repeatedly calling a function. - * @param handler Indicates the function to be called repeatedly at the interval. - * @param delay Indicates the interval between each two calls, in milliseconds. The function will be called after this delay. - * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. - * @returns Returns the timer ID. - */ -export declare function setInterval(handler: TimerHandler, delay: number, ...arguments: any[]): number; - -/** - * Sets a timer after which a function will be executed. - * @param handler Indicates the function to be called after the timer goes off. - * @param delay Indicates the delay (in milliseconds) after which the function will be called. If this parameter is left empty, default value "0" will be used, which means that the function will be called immediately or as soon as possible. - * @param arguments Indicates additional arguments to pass to "handler" when the timer goes off. - * @returns Returns the timer ID. - */ -export declare function setTimeout(handler: TimerHandler, delay?: number, ...arguments: any[]): number; - -/** - * Cancels the interval set by " setInterval()". - * @param intervalID Indicates the timer ID returned by "setInterval()". - */ -export declare function clearInterval(intervalID?: number): void; - -/** - * Cancels the timer set by "setTimeout()". - * @param timeoutID Indicates the timer ID returned by "setTimeout()". - */ -export declare function clearTimeout(timeoutID?: number): void; - -/** - * Obtain the objects exposed in app.js - * @since 6 - */ -export declare function getApp(): object; - -/** - * You can create an Image object by calling new Image(). - */ -export declare class Image { - /** - * Network address or local resource. The internal URI is supported. - */ - src: string; - /** - * Image width. - */ - width?: number; - /** - * Image height. - */ - height?: number; - /** - * Called when an image is successfully loaded. This function has no parameter. - */ - onload?: () => void; - /** - * Called when an image fails to be loaded. This function has no parameter. - */ - onerror?: () => void; -} - -/** - * An ImageData object is a common object that stores the actual pixel data of a Canvas object. - */ -export declare class ImageData { - /** - * Actual width of the ImageData object, in pixels. - */ - width: number; - /** - * Actual height of the ImageData object, in pixels. - */ - height: number; - /** - * A one-dimensional array of color values. The color values are sorted in the RGBA order and represented by integers from 0 to 255. - */ - data: Uint8ClampedArray; -} - -/** - * OffscreenCanvas provides a Canvas object that can be rendered off-screen. - * It works in both window and Web worker environments. - */ -export declare class OffscreenCanvas { - /** - * The width of the offScreen Canvas object - * The height of the offScreen Canvas object - */ - constructor(width: number, height: number); - - /** - * The width of the offScreen Canvas object - */ - width: number; - - /** - * The height of the offScreen Canvas object - */ - height: number; - - /** - * Gets the context object for off-screen drawing. - * @param contextId creates a CanvasRenderingContext2D object representing a two-dimensional rendering context. - * @param options object representing a three-dimensional rendering context. - * @returns a render canvas for the offScreen Canvas object. - */ - getContext(contextId: "2d", options?: CanvasRenderingContext2DSettings): OffscreenCanvasRenderingContext2D; - - /** - * Converts the draw contents of the current off-screen draw object to a string in the form of a Blob. - * @param type indicating the image format. - * @param quality between 0 and 1 indicating image quality if the type option is image/jpeg or image/webp. - * @returns A Promise returning a Blob object representing the image contained in the canvas. - */ - toDataURL(type?: string, quality?: number): string; - - /** - * Converts the draw content in the current off-screen draw object to a Bitmap object. - * @returns Returns An ImageBitmap object. - */ - transferToImageBitmap(): ImageBitmap; -} - -export declare class ImageBitmap { - /** - * The height of the Image Bitmap object - */ - readonly height: number; - - /** - * The width of the Image Bitmap object - */ - readonly width: number; -} \ No newline at end of file diff --git a/api/phone/@internal/index.d.ts b/api/phone/@internal/index.d.ts deleted file mode 100644 index 8712a2be0c6d8bd7db0dfa187cd0f1cfc2af817c..0000000000000000000000000000000000000000 --- a/api/phone/@internal/index.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Copyright (c) 2020 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export * from './viewmodel'; -export * from './featureability'; -export * from './console'; -export * from './global'; \ No newline at end of file diff --git a/api/phone/@internal/viewmodel.d.ts b/api/phone/@internal/viewmodel.d.ts deleted file mode 100644 index 1a9a57fc5468280a1dd7e74fdecaf97c06bf1fdc..0000000000000000000000000000000000000000 --- a/api/phone/@internal/viewmodel.d.ts +++ /dev/null @@ -1,2334 +0,0 @@ -/* - * Copyright (c) 2020 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { Image, ImageData } from "./global"; -import { WebGLContextAttributes, WebGLRenderingContext } from "../webgl/webgl"; -import { WebGL2RenderingContext } from "../webgl/webgl2"; - -export interface FocusParamObj { - focus: boolean; -} - -export interface RectObj { - width: number; - - height: number; - - left: number; - - top: number; -} - -export interface ContextAttrOptions { - antialias: boolean; -} - -export interface AnimateStyle { - /** - * Width value applied to the component after the animation is executed. - */ - width: number; - /** - * Height value applied to the component after the animation is executed. - */ - height: number; - /** - * left offset applied to the component after the animation is executed. - */ - left: number; - /** - * top offset applied to the component after the animation is executed. - */ - top: number; - /** - * right offset applied to the component after the animation is executed. - */ - right: number; - /** - * bottom offset applied to the component after the animation is executed. - */ - bottom: number; - /** - * Background color applied to the component after the animation is executed. - * The default value is none. - */ - backgroundColor: string; - /** - * Opacity applied to the component. The value ranges from 0 to 1. - * The default value is 1. - */ - opacity: number; - /** - * The value format is "x y", in percentage or pixels. - * The first value indicates the horizontal position, and the second value indicates the vertical position. - * If only one value is specified, the other value is 50% by default. - */ - backgroundPosition: string; - /** - * Origin position of the transformed element. - * The first value indicates the x-axis position. The value can be left, center, right, a length, or percentage. - * The second value indicates the y-axis position. The value can be top, center, bottom, a length, or a percentage. - */ - transformOrigin: string; - /** - * Transformation type applied to an element. - */ - transform: "none" | TransformObject; - /** - * The value of offset must be within (0.0,1.0] and sorted in ascending order if it is provided. - * If there are only two frames, offset can be left empty. - * If there are more than two frames, offset is mandatory. - */ - offset?: number; -} - -export interface TransformObject { - /** - * Defines a 2D transformation, using a matrix of six values.. - * @param scaleX the scale value for x-axis - * @param skewX the skew value for y-axis - * @param skewY the skew value for x-axis - * @param scaleY the scale value for y-axis - * @param translateX the translate value for x-axis - * @param translateY the translate value for y-axis - */ - matrix( - scaleX: number, - skewX: number, - skewY: number, - scaleY: number, - translateX: number, - translateY: number): void; - /** - * Defines a 3D transformation using a 4x4 matrix of 16 values. - * @param n00 the value of the 0 row and 0 column of the 4x4 matrix - * @param n01 the value of the 0 row and 1 column of the 4x4 matrix - * @param n02 the value of the 0 row and 2 column of the 4x4 matrix - * @param n03 the value of the 0 row and 3 column of the 4x4 matrix - * @param n10 the value of the 1 row and 0 column of the 4x4 matrix - * @param n11 the value of the 1 row and 1 column of the 4x4 matrix - * @param n12 the value of the 1 row and 2 column of the 4x4 matrix - * @param n13 the value of the 1 row and 3 column of the 4x4 matrix - * @param n20 the value of the 2 row and 0 column of the 4x4 matrix - * @param n21 the value of the 2 row and 1 column of the 4x4 matrix - * @param n22 the value of the 2 row and 2 column of the 4x4 matrix - * @param n23 the value of the 2 row and 3 column of the 4x4 matrix - * @param n30 the value of the 3 row and 0 column of the 4x4 matrix - * @param n31 the value of the 3 row and 1 column of the 4x4 matrix - * @param n32 the value of the 3 row and 2 column of the 4x4 matrix - * @param n33 the value of the 3 row and 3 column of the 4x4 matrix - * @devices tv, phone, tablet, wearable - */ - matrix3d(n00: number, n01: number, n02: number, n03: number, - n10: number, n11: number, n12: number, n13: number, - n20: number, n21: number, n22: number, n23: number, - n30: number, n31: number, n32: number, n33: number): void; - /** - * Defines 2D transformations for translation of the X and Y axes - * @param x the translate value for x-axis - * @param y the translate value for y-axis - */ - translate(x: number, y: number): void; - /** - * Defines 3D transformations for translation of the X / Y / Z axes - * @param x the translate value for x-axis - * @param y the translate value for y-axis - * @param z the translate value for z-axis - */ - translate3d(x: number, y: number, z: number): void; - /** - * Defines 2D transformations for translation of the X axes - * @param x the translate value for x-axis - */ - translateX(x: number): void; - /** - * Defines 2D transformations for translation of the Y axes - * @param y the translate value for y-axis - */ - translateY(y: number): void; - /** - * Defines 3D transformations for translation of the Z axes - * @param z the translate value for z-axis - */ - translateZ(z: number): void; - /** - * Defines 2D transformations for scaling of the X and Y axes - * @param x the scale value for x-axis - * @param y the scale value for y-axis - */ - scale(x: number, y: number): void; - /** - * Defines 3D transformations for scaling of the X / Y / Z axes - * @param x the scale value for x-axis - * @param y the scale value for y-axis - * @param z the scale value for z-axis - */ - scale3d(x: number, y: number, z: number): void; - /** - * Defines 2D transformations for scaling of the X axes - * @param x the scale value for x-axis - */ - scaleX(x: number): void; - /** - * Defines 2D transformations for scaling of the Y axes - * @param y the scale value for y-axis - */ - scaleY(y: number): void; - /** - * Defines 3D transformations for scaling of the Z axes - * @param z the scale value for z-axis - */ - scaleZ(z: number): void; - /** - * Define the 2D rotation and specify the angle in the parameters. - * @param angle the rotate value for z-axis - */ - rotate(angle: number): void; - /** - * Defines a 3D transformation for rotating the X / Y / Z axes. - * @param x the vector value of the x-axis - * @param y the vector value of the y-axis - * @param z the vector value of the z-axis - * @param angle the rotate value for x&y&z vector. - */ - rotate3d(x: number, y: number, z: number, angle: number): void; - /** - * Defines 3D transformations for rotating of the X axes. - * @param x the scale value for x-axis - */ - rotateX(angle: number): void; - /** - * Defines 3D transformations for rotating of the Y axes. - * @param y the scale value for y-axis - */ - rotateY(angle: number): void; - /** - * Defines 3D transformations for rotating of the Z axes. - * @param z the scale value for z-axis - */ - rotateZ(angle: number): void; - /** - * Defines the 2D skew transition along the X and Y axes. - * @param xAngle the angle of inclination along the x axis. - * @param yAngle the angle of inclination along the y axis. - */ - skew(xAngle: number, yAngle: number): void; - /** - * Defines the 2D skew transition along the X axes. - * @param angle the angle of inclination along the x axis. - */ - skewX(angle: number): void; - /** - * Defines the 2D skew transition along the Y axes. - * @param angle the angle of inclination along the y axis. - */ - skewY(angle: number): void; - /** - * Defines a perspective view for the 3D transformation element. - * @param n the vertical distance from the observation point to the component plane. - */ - perspective(verticalDistance: number): void; -} - -export interface AnimateOptions { - /** - * Duration of the animation, in milliseconds. - * The default value is 0. - */ - duration: number; - - /** - * Time curve of the animation. For details about the supported types. - * linear The animation speed keeps unchanged. - * ease The animation starts and ends at a low speed, cubic-bezier(0.25, 0.1, 0.25, 1.0). - * ease-in The animation starts at a low speed, cubic-bezier(0.42, 0.0, 1.0, 1.0). - * ease-out The animation ends at a low speed, cubic-bezier(0.0, 0.0, 0.58, 1.0). - * ease-in-out The animation starts and ends at a low speed, cubic-bezier(0.42, 0.0, 0.58, 1.0). - * fast-out-slow-in Standard curve, cubic-bezier(0.4, 0.0, 0.2, 1.0). - * linear-out-slow-in Deceleration curve, cubic-bezier(0.0, 0.0, 0.2, 1.0). - * fast-out-linear-in Acceleration curve, cubic-bezier(0.4, 0.0, 1.0, 1.0). - * friction Damping curve, cubic-bezier(0.2, 0.0, 0.2, 1.0). - * extreme-deceleration Extreme deceleration curve, cubic-bezier(0.0, 0.0, 0.0, 1.0). - * sharp Sharp curve, cubic-bezier(0.33, 0.0, 0.67, 1.0). - * rhythm Rhythm curve, cubic-bezier(0.7, 0.0, 0.2, 1.0). - * smooth Smooth curve, cubic-bezier(0.4, 0.0, 0.4, 1.0). - * cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1. - * Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end. - * The default value is ease. - */ - easing: string; - - /** - * Delay for the animation start. The default value indicates no delay. - * The default value is 0. - */ - delay: number; - - /** - * Number of times the animation will be played. number indicates a fixed number of playback operations, and Infinity indicates an unlimited number of playback operations. - * The default value is 1. - */ - iterations: number | string; - - /** - * The animation playback mode. - * The default value is "normal". - */ - direction: "normal" | "reverse" | "alternate" | "alternate-reverse"; - - /** - * Whether to resume to the initial state after the animation is executed. - * none: The initial state is restored after the animation is executed. - * forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed. - */ - fill: "none" | "forwards" | "backwards" | "both"; -} - -export interface AnimationResult { - /** - * Read-only attribute, which indicates whether the animation playback is complete. - */ - finished: boolean; - /** - * Read-only attribute, which indicates whether an animation is waiting for the completion of other asynchronous operations (for example, start an animation with a delay). - */ - pending: boolean; - /** - * Animation running state: - * idle: The animation is not running (playback ended or not started). - * running: The animation is running. - * paused: The animation is paused. - * finished: Animation playback ends. - */ - playstate: string; - /** - * Animation start time. This attribute is similar to that of delay in the options parameters. - */ - startTime: number; - /** - * Starts the animation. - */ - play(): void; - /** - * Ends the animation. - */ - finish(): void; - /** - * Pauses the animation. - */ - pause(): void; - /** - * Cancels the animation. - */ - cancel(): void; - /** - * Plays the animation in reverse direction. - */ - reverse(): void; - /** - * The animation is started. - */ - onstart: () => void; - /** - * The animation is finished. - */ - onfinish: () => void; - /** - * The animation is canceled. - */ - oncancel: () => void; - /** - * The animation is repeated. - */ - onrepeat: () => void; -} - -export interface Element { - /** - * Requests or cancels the focus for a component. - * If focus is set to true, the focus is requested for the component. - * If focus is set to false, the focus is canceled for the component. - * This attribute can be defaulted to true. - * @param obj { focus: true | false } - */ - focus(obj?: FocusParamObj): void; - - /** - * Requests or cancels the crown rotation focus for a component. - * If focus is set to true, the crown event focus is requested. - * If focus is set to false, the crown event focus is canceled. - * This attribute can be defaulted to true. - * @param obj { focus: true | false } - */ - rotation(obj?: FocusParamObj): void; - - /** - * Creates and runs an animation shortcut on the component. Specify the keyframes and options required for the animation. - * @param keyframes keyframes is used to describe key frame parameters of the animation. - * @param options Options. is used to describe animation parameters. - * @returns This method returns the animation object. - */ - animate( - keyframes: Array, - options: AnimateOptions - ): AnimationResult; - - /** - * Obtains the size and position of the element. - * @returns RectObj the size position of the element. - */ - getBoundingClientRect(): RectObj; - - /** - * Obtains attributes of the element. - * @returns attributes of the element in json string. - */ - getInspector(): string; - - /** - * If 0.5 is returned, 50% of the current component is visible. - * @param radios Scope of Monitoring components. - */ - createIntersectionObserver(param: { ratios: Array }): observer; -} - -export interface observer { - /** - * Turn on the listener. - */ - observe(callback: string): void; - - /** - * Turn off the listenerr. - */ - unobserve(): void; -} - -/** - * animation element - */ -export interface AnimationElement extends Element { - /** - * Starts the animation. - */ - play(): void; - /** - * Ends the animation. - */ - finish(): void; - /** - * Pauses the animation. - */ - pause(): void; - /** - * Cancels the animation. - */ - cancel(): void; - /** - * Plays the animation in reverse direction. - */ - reverse(): void; -} - -export interface CurrentOffsetResultValue { - /** - * Scrolling offset in the x-axis, in px. - */ - x: number; - - /** - * Scrolling offset in the y-axis, in px. - */ - y: number; -} - -/** - * The component provides a list container. - */ -export interface ListElement extends Element { - /** - * Scrolls the list to the position of the item at the specified index. - */ - scrollTo(position: { - /** - * specified position. - */ - index: number; - }): void; - - /** - * If smooth is set to false (default value), the list is directly scrolled to the top. - * If smooth is set to true, the list is smoothly scrolled to the top. - * @param param - */ - scrollTop(param: { smooth: boolean }): void; - - /** - * If smooth is set to false (default value), the list is directly scrolled to the bottom. - * If smooth is set to true, the list is smoothly scrolled to the bottom. - * @param param - */ - scrollBottom(param: { smooth: boolean }): void; - - /** - * If reverse is set to false (default value), the next page is displayed. If there is no next page, the list scrolls to the bottom. - * If reverse is set to true, the previous page is displayed. If there is no previous page, the list scrolls to the top. - * If smooth is set to false (default value), the list is directly scrolled to another page. - * If smooth is set to true, the list is smoothly scrolled to another page. - * @param params - */ - scrollPage(params: { reverse: boolean; smooth: boolean }): void; - - /** - * If reverse is set to false (default value), the list scrolls towards the bottom for a certain distance. If there is no sufficient distance, the list scrolls to the bottom. - * If reverse is set to true, the list scrolls towards the top for a certain distance. If there is no sufficient distance, the list scrolls to the top. - * If smooth is set to false (default value), the list is directly scrolled. - * If smooth is set to true, the list is smoothly scrolled. - * @param params - */ - scrollArrow(params: { reverse: boolean; smooth: boolean }): void; - - /** - * Collapses a group. - * @param param - */ - collapseGroup(param: { - /** - * groupid: ID of the group to collapse. - * All groups are collapsed when groupid is not specified. - */ - groupid: string; - }): void; - - /** - * Expands a group. - * @param param - */ - expandGroup(param: { - /** - * groupid: ID of the group to expand. - * All groups are expanded when groupid is not specified. - */ - groupid: string; - }): void; - - /** - * Returns the offset of the current scrolling. The return value type is Object. - */ - currentOffset(): CurrentOffsetResultValue; -} - -/** - * The component provides a swiper container. - */ -export interface SwiperElement extends Element { - /** - * Scrolls the child component to the position at the specified index. - */ - swipeTo(position: { - /** - * specified position. - */ - index: number; - }): void; - - /** - * Shows the next child component. - */ - showNext(): void; - - /** - * Shows the previous child component. - */ - showPrevious(): void; -} - -export interface CameraTakePhotoOptions { - /** - * Picture quality. - */ - quality: "high" | "normal" | "low"; - - /** - * Callback function for successful interface invocation. - * @param result the request execution result. - */ - success?: (result: Object) => void; - - /** - * Callback function for interface invocation failure. - * @param result the request execution result. - */ - fail?: (result: Object) => void; - - /** - * Callback function at the end of the interface invoking (executed both successfully and unsuccessfully). - * @param result the request execution result. - */ - complete?: (result: Object) => void; -} - -/** - * The component provides preview and photographing functions.. - */ -export interface CameraElement extends Element { - /** - * Take photos with specified parameters. - * @param options the parameters of camera. - */ - takePhoto(options: CameraTakePhotoOptions): void; -} - -/** - * The component is a container for displaying web page content. - */ -export interface WebElement extends Element { - /** - * Reload the web page content - */ - reload(): void; -} - -/** - * The component is a custom pop-up container. - */ -export interface DialogElement extends Element { - /** - * Shows a dialog box. - */ - show(): void; - /** - * Closes a dialog box. - */ - close(): void; -} - -/** - * The component is used to provide an image frame animator. - */ -export interface ImageAnimatorElement extends Element { - /** - * Starts to play the frame animation of an image. If this method is called again, the playback starts from the first frame. - */ - start(): void; - /** - * Pauses the frame animation playback of an image. - */ - pause(): void; - /** - * Stops the frame animation playback of an image. - */ - stop(): void; - /** - * Resumes the frame animation playback of an image. - */ - resume(): void; - /** - * Obtains the playback state. Available values are as follows: - * Playing - * Paused - * Stopped - */ - getState(): string; -} - -/** - * The component inserts scrolling text, which is displayed in a single line by default. - * When the text length exceeds the display area of the component, the marquee effect is displayed. - */ -export interface MarqueeElement extends Element { - /** - * Starts scrolling. - */ - start(): void; - - /** - * Stops scrolling. - */ - stop(): void; -} - -/** - * The component provides menus as temporary pop-up windows to display operations that can be performed by users. - */ -export interface MenuElement extends Element { - /** - * Displays the menu. - * x and y specify the position of the displayed menu. - * x indicates the X-axis coordinate from the left edge of the visible area, and does not include any scrolling offset. - * y indicates the Y-axis coordinate from the upper edge of the visible area, and does not include any scrolling offset or a status bar. - * The menu is preferentially displayed in the lower right corner. - * When the visible space on the right is insufficient, the menu is moved leftward. - * When the visible space in the lower part is insufficient, the menu is moved upward. - * @param position - */ - show(position: { x: number; y: number }): void; -} - -/** - * The component displays line charts, gauge charts, and bar charts. - */ -export interface ChartElement extends Element { - /** - * Data is dynamically added to an existing data sequence. - * The target sequence is specified based on serial, which is the subscript of the datasets array and starts from 0. - * datasets[index].data is not updated. Only line charts support this attribute. - * The value is incremented by 1 based on the horizontal coordinate and is related to the xAxis min/max setting. - */ - append(params: { - /** - * Set the data subscript of the line chart to be updated. - */ - serial: number; - /** - * Set the new data. - */ - data: Array; - }): void; -} - -/** - * The component provides an interactive interface to receive user input, which is displayed in a single line by default. - */ -export interface InputElement extends Element { - /** - * Obtains or loses the focus of a component. - * When the component type is set to text, email, date, time, number, or password, the input method can be displayed or collapsed. - * @param param If focus is not passed, the default value true is used. - */ - focus(param: { focus: boolean }): void; - - /** - * Displays the error message. - * This attribute is available when the component type is set to text, email, date, time, number, or password. - * @param param - */ - showError(param: { error: string }): void; - - /** - * Deletes the previous character at the cursor position. - */ - delete(): void; -} - -/** - * The