refactor d.ts files and mark sdk8

Signed-off-by: yan-shuifeng <yanshuifeng@huawei.com>
This commit is contained in:
yan-shuifeng 2021-10-27 09:33:28 +08:00
parent 133edcc9ed
commit ceb6308ac7
81 changed files with 4291 additions and 5932 deletions

View File

@ -29,7 +29,6 @@ ohos_copy("ets_internal_api") {
ohos_copy("ets_component") {
sources = [
"api/@internal/component/ets/ability_component.d.ts",
"api/@internal/component/ets/action_sheet.d.ts",
"api/@internal/component/ets/alert_dialog.d.ts",
"api/@internal/component/ets/alphabet_indexer.d.ts",
"api/@internal/component/ets/animator.d.ts",
@ -37,22 +36,22 @@ ohos_copy("ets_component") {
"api/@internal/component/ets/blank.d.ts",
"api/@internal/component/ets/button.d.ts",
"api/@internal/component/ets/calendar.d.ts",
"api/@internal/component/ets/camera.d.ts",
"api/@internal/component/ets/circle.d.ts",
"api/@internal/component/ets/column.d.ts",
"api/@internal/component/ets/column_split.d.ts",
"api/@internal/component/ets/common.d.ts",
"api/@internal/component/ets/counter.d.ts",
"api/@internal/component/ets/custom_dialog_controller.d.ts",
"api/@internal/component/ets/datapanel.d.ts",
"api/@internal/component/ets/datePicker.d.ts",
"api/@internal/component/ets/data_panel.d.ts",
"api/@internal/component/ets/date_picker.d.ts",
"api/@internal/component/ets/divider.d.ts",
"api/@internal/component/ets/ellipse.d.ts",
"api/@internal/component/ets/enums.d.ts",
"api/@internal/component/ets/flex.d.ts",
"api/@internal/component/ets/forEach.d.ts",
"api/@internal/component/ets/form_component.d.ts",
"api/@internal/component/ets/gauge.d.ts",
"api/@internal/component/ets/geometryView.d.ts",
"api/@internal/component/ets/geometry_view.d.ts",
"api/@internal/component/ets/gesture.d.ts",
"api/@internal/component/ets/grid.d.ts",
"api/@internal/component/ets/gridItem.d.ts",
@ -65,12 +64,10 @@ ohos_copy("ets_component") {
"api/@internal/component/ets/line.d.ts",
"api/@internal/component/ets/list.d.ts",
"api/@internal/component/ets/listItem.d.ts",
"api/@internal/component/ets/loadingProgress.d.ts",
"api/@internal/component/ets/loading_progress.d.ts",
"api/@internal/component/ets/marquee.d.ts",
"api/@internal/component/ets/menu.d.ts",
"api/@internal/component/ets/navigation.d.ts",
"api/@internal/component/ets/navigator.d.ts",
"api/@internal/component/ets/navigatorView.d.ts",
"api/@internal/component/ets/option.d.ts",
"api/@internal/component/ets/pageTransition.d.ts",
"api/@internal/component/ets/panel.d.ts",
"api/@internal/component/ets/path.d.ts",
@ -96,10 +93,11 @@ ohos_copy("ets_component") {
"api/@internal/component/ets/tab_content.d.ts",
"api/@internal/component/ets/tabs.d.ts",
"api/@internal/component/ets/text.d.ts",
"api/@internal/component/ets/textPicker.d.ts",
"api/@internal/component/ets/textarea.d.ts",
"api/@internal/component/ets/textinput.d.ts",
"api/@internal/component/ets/text_area.d.ts",
"api/@internal/component/ets/text_input.d.ts",
"api/@internal/component/ets/text_picker.d.ts",
"api/@internal/component/ets/toggle.d.ts",
"api/@internal/component/ets/units.d.ts",
"api/@internal/component/ets/video.d.ts",
"api/@internal/component/ets/web.d.ts",
]

View File

@ -1,119 +1,107 @@
/*
* 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.
*/
import {CommonMethod} from "./common";
import {Want} from "../api/common/ability/want";
/**
* controller of ability.
* @devices phone, tablet, car.
* @since 7
*/
export declare class AbilityController {
/**
* constructor.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* load the ability in the AbilityComponent.
* Want: Capability description to be loaded
* @devices phone, tablet, car.
* @since 7
*/
startAbility(value: Want);
/**
* Perform a return operation inside the AbilityComponent.
* @devices phone, tablet, car.
* @since 7
*/
performBackPress();
/**
* Obtains the number of tasks in the internal task stack of the AbilityComponent.
* @devices phone, tablet, car.
* @since 7
*/
getStackCount();
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class AbilityComponentExtend<T> extends AbilityComponentAttribute<T> {
}
/**
* AbilityComponent inheritance abilitycomponentattribute.
* Want: Capability description to be loaded.
* controller: Ability Controller.
* @devices phone, tablet, car.
* @since 7
*/
interface AbilityComponent extends AbilityComponentAttribute<AbilityComponent> {
(value: { want: Want, controller?: AbilityController }): AbilityComponent;
}
/**
* The attribute of ability.
* @devices phone, tablet, car.
* @since 7
*/
declare class AbilityComponentAttribute<T> extends CommonMethod<T> {
/**
* Callback when the abilityComponent environment starts up, after which the abilityController methods can be used.
* @devices phone, tablet, car.
* @since 7
*/
onReady(event: () => void): T;
/**
* Callback when the abilityComponent environment is destroyed.
* @devices phone, tablet, car.
* @since 7
*/
onDestroy(event: () => void): T;
/**
* This event is triggered when the abilityComponent loads the mobility. Name indicates the Ability name.
* @devices phone, tablet, car.
* @since 7
*/
onAbilityCreated(event: (name: string) => void): T;
/**
* Internal to the AbilityComponent, which is triggered when the Ability moves to the foreground.
* @devices phone, tablet, car.
* @since 7
*/
onAbilityMoveToFront(event: () => void): T;
/**
* Internal to the AbilityComponent, which is triggered before the Mobility is removed.
* @devices phone, tablet, car.
* @since 7
*/
onAbilityWillRemove(event: () => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const AbilityComponentInterface: AbilityComponent;
/*
* 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.
*/
import { CommonMethod } from "./common";
import { Want } from "../api/common/ability/want";
/**
* controller of ability.
* @since 7
* @systemapi
*/
export declare class AbilityController {
/**
* constructor.
*/
constructor();
/**
* load the ability in the AbilityComponent.
* Want: Capability description to be loaded
*/
startAbility(value: Want);
/**
* Perform a return operation inside the AbilityComponent.
*/
performBackPress();
/**
* Obtains the number of tasks in the internal task stack of the AbilityComponent.
*/
getStackCount();
}
/**
* AbilityComponent constructor params.
* @since 7
* @systemapi
*/
export declare interface AbilityComponentOptions {
/**
* Capability description to be loaded.
*/
want: Want;
/**
* controller: Ability Controller.
*/
controller?: AbilityController;
}
/**
* AbilityComponent inheritance abilitycomponentattribute.
* @since 7
* @systemapi
*/
interface AbilityComponent extends AbilityComponentAttribute<AbilityComponent> {
(value: AbilityComponentOptions): AbilityComponent;
}
/**
* The attribute of ability.
* @since 7
* @systemapi
*/
declare class AbilityComponentAttribute<T> extends CommonMethod<T> {
/**
* Callback when the abilityComponent environment starts up, after which the abilityController methods can be used.
*/
onReady(event: () => void): T;
/**
* Callback when the abilityComponent environment is destroyed.
*/
onDestroy(event: () => void): T;
/**
* This event is triggered when the abilityComponent loads the mobility. Name indicates the Ability name.
*/
onAbilityCreated(event: (name: string) => void): T;
/**
* Internal to the AbilityComponent, which is triggered when the Ability moves to the foreground.
*/
onAbilityMoveToFront(event: () => void): T;
/**
* Internal to the AbilityComponent, which is triggered before the Mobility is removed.
*/
onAbilityWillRemove(event: () => void): T;
}
// Used for IDE.
export declare class AbilityComponentExtend<T> extends AbilityComponentAttribute<T> {}
export declare const AbilityComponentInterface: AbilityComponent;

View File

@ -1,93 +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.
*/
import { DialogAlignment } from "./alert_dialog";
import {CommonMethod, Resource} from "./common"
/**
* The information of sheet.
* @devices phone, tablet, car.
* @since 7
*/
interface SheetInfo {
/**
* Title Properties
* @devices phone, tablet, car.
* @since 7
*/
title: string | Resource;
/**
* Icon Properties.
* @devices phone, tablet, car.
* @since 7
*/
icon?: string | Resource;
/**
* Callback method after the operation.
* @devices phone, tablet, car.
* @since 7
*/
action: () => void;
}
/**
* Callback method after the operation.
* @devices phone, tablet, car.
* @since 7
*/
export declare class ActionSheetExtend<T> extends ActionSheetAttribute<T> {
}
/**
* create ActionSheet.
* @devices phone, tablet, car.
* @since 7
*/
interface ActionSheet extends ActionSheetAttribute<ActionSheet> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ActionSheetAttribute<T> extends CommonMethod<T> {
/**
* Invoking method display.
* @devices phone, tablet, car.
* @since 7
*/
show(value: {
title: string | Resource;
message: string | Resource;
confirm?: {
value: string | Resource;
action: () => void;
};
cancel?: () => void;
sheets: Array<SheetInfo>;
autoCancel?: boolean;
alignment?: DialogAlignment;
offset?: { dx: number | string | Resource, dy: number | string | Resource };
});
}
/**
* Definitions ActionSheetInterface.
* @devices phone, tablet, car.
* @since 7
*/
export declare const ActionSheetInterface: ActionSheet;

View File

@ -1,219 +1,205 @@
/*
* 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.
*/
import {CommonMethod, Resource} from "./common"
/**
* The alignment of dialog,
* @devices phone, tablet, car.
* @since 7
*/
export declare enum DialogAlignment {
/**
* Vertical top alignment.
* @devices phone, tablet, car.
* @since 7
*/
Top,
/**
* Align vertically to the center.
* @devices phone, tablet, car.
* @since 7
*/
Center,
/**
* Vertical bottom alignment.
* @devices phone, tablet, car.
* @since 7
*/
Bottom,
/**
* Default alignment.
* @devices phone, tablet, car.
* @since 7
*/
Default
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface AlertDialog {
/**
* Invoking method display.
* @devices phone, tablet, car.
* @since 7
*/
show(value: {
/**
* Title Properties
* @devices phone, tablet, car.
* @since 7
*/
title?: string | Resource;
/**
* message Properties
* @devices phone, tablet, car.
* @since 7
*/
message: string | Resource;
/**
* Allows users to click the mask layer to exit.
* @devices phone, tablet, car.
* @since 7
*/
autoCancel?: boolean;
/**
* Invoke the commit function.
* @devices phone, tablet, car.
* @since 7
*/
confirm?: {
/**
* Text content of the confirmation button.
* @devices phone, tablet, car.
* @since 7
*/
value: string | Resource;
/**
* Method executed by the callback.
* @devices phone, tablet, car.
* @since 7
*/
action: () => void;
};
/**
* Execute Cancel Function.
* @devices phone, tablet, car.
* @since 7
*/
cancel?: () => void;
/**
* Alignment in the vertical direction.
* @devices phone, tablet, car.
* @since 7
*/
alignment?: DialogAlignment;
/**
* Offset of the pop-up window relative to the alignment position.
* @devices phone, tablet, car.
* @since 7
*/
offset?: { dx: number | string | Resource, dy: number | string | Resource };
} | {
/**
* Title Properties
* @devices phone, tablet, car.
* @since 7
*/
title?: string | Resource;
/**
* message Properties
* @devices phone, tablet, car.
* @since 7
*/
message: string | Resource;
/**
* Allows users to click the mask layer to exit.
* @devices phone, tablet, car.
* @since 7
*/
autoCancel?: boolean;
/**
* First button.
* @devices phone, tablet, car.
* @since 7
*/
primaryButton: {
/**
* Text content of the confirmation button.
* @devices phone, tablet, car.
* @since 7
*/
value: string | Resource;
/**
* Method executed by the callback.
* @devices phone, tablet, car.
* @since 7
*/
action: () => void;
};
/**
* Second button.
* @devices phone, tablet, car.
* @since 7
*/
secondaryButton: {
/**
* Text content of the confirmation button.
* @devices phone, tablet, car.
* @since 7
*/
value: string | Resource;
/**
* Method executed by the callback.
* @devices phone, tablet, car.
* @since 7
*/
action: () => void;
};
/**
* Execute Cancel Function.
* @devices phone, tablet, car.
* @since 7
*/
cancel?: () => void;
/**
* Alignment in the vertical direction.
* @devices phone, tablet, car.
* @since 7
*/
alignment?: DialogAlignment;
/**
* Offset of the pop-up window relative to the alignment position.
* @devices phone, tablet, car.
* @since 7
*/
offset?: { dx: number | string | Resource, dy: number | string | Resource };
});
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const AlertDialogInterface: AlertDialog;
/*
* 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.
*/
import { ResourceColor } from ".";
import { Offset, ResourceStr } from "./units";
/**
* The alignment of dialog,
* @since 7
*/
export declare enum DialogAlignment {
/**
* Vertical top alignment.
* @since 7
*/
Top,
/**
* Align vertically to the center.
* @since 7
*/
Center,
/**
* Vertical bottom alignment.
* @since 7
*/
Bottom,
/**
* Default alignment.
* @since 7
*/
Default,
}
/**
* Base param used for AlertDialog.show method.
* @since 7
*/
export declare interface AlertDialogParam {
/**
* Title Properties
* @since 7
*/
title?: ResourceStr;
/**
* message Properties
* @since 7
*/
message: ResourceStr;
/**
* Allows users to click the mask layer to exit.
* @since 7
*/
autoCancel?: boolean;
/**
* Execute Cancel Function.
* @since 7
*/
cancel?: () => void;
/**
* Alignment in the vertical direction.
* @since 7
*/
alignment?: DialogAlignment;
/**
* Offset of the pop-up window relative to the alignment position.
* @since 7
*/
offset?: Offset;
/**
* Grid count of dialog.
* @since 7
*/
gridCount?: number;
}
/**
* Defines the AlertDialog with confirm button.
* @since 7
*/
export declare interface AlertDialogParamWithConfirm extends AlertDialogParam {
/**
* Invoke the commit function.
* @since 7
*/
confirm?: {
/**
* Text content of the confirmation button.
* @since 7
*/
value: ResourceStr;
/**
* Text color of the confirmation button.
* @since 7
*/
fontColor?: ResourceColor;
/**
* Backgound color of the confirmation button.
* @since 7
*/
backgroundColor?: ResourceColor;
/**
* Method executed by the callback.
* @since 7
*/
action: () => void;
};
}
export declare interface AlertDialogParamWithButtons extends AlertDialogParam {
/**
* First button.
* @since 7
*/
primaryButton: {
/**
* Text content of the confirmation button.
* @since 7
*/
value: ResourceStr;
/**
* Text color of the confirmation button.
* @since 7
*/
fontColor?: ResourceColor;
/**
* Backgound color of the confirmation button.
* @since 7
*/
backgroundColor?: ResourceColor;
/**
* Method executed by the callback.
* @since 7
*/
action: () => void;
};
/**
* Second button.
* @since 7
*/
secondaryButton: {
/**
* Text content of the confirmation button.
* @since 7
*/
value: ResourceStr;
/**
* Text color of the confirmation button.
* @since 7
*/
fontColor?: ResourceColor;
/**
* Backgound color of the confirmation button.
* @since 7
*/
backgroundColor?: ResourceColor;
/**
* Method executed by the callback.
* @since 7
*/
action: () => void;
};
}
/**
* Defines AlertDialog which uses show method to show alert dialog.
* @since 7
*/
export declare class AlertDialog {
/**
* Invoking method display.
* @since 7
*/
static show(value: AlertDialogParamWithConfirm | AlertDialogParamWithButtons);
}

View File

@ -13,144 +13,117 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common";
import {FontWeight, FontStyle} from "./text";
import { CommonMethod } from "./common";
import { ResourceColor, Font } from "./units";
/**
* @devices phone, tablet, car.
* indexer align property.
* @since 7
*/
export declare enum IndexerAlign {
/**
* A dialog box is displayed on the right of the index bar.
* @devices phone, tablet, car.
* @since 7
*/
Left,
/**
* A dialog box is displayed on the left of the index bar.
* @devices phone, tablet, car.
* @since 7
*/
Right
Right,
}
/**
* Alphabet index bar.
* @devices phone, tablet, car.
* @since 7
*/
export declare class AlphabetIndexerExtend<T> extends AlphabetIndexerAttribute<T> {
}
/**
* Alphabet index bar.
* @devices phone, tablet, car.
* @since 7
*/
interface AlphabetIndexer extends AlphabetIndexerAttribute<AlphabetIndexer> {
/**
* ArrayValue: Alphabetical index string array.
* selected: ID of the selected item.
* @devices phone, tablet, car.
* @since 7
*/
(value: {ArrayValue : Array<string>, selected : number}): AlphabetIndexer;
(value: { arrayValue: Array<string>; selected: number }): AlphabetIndexer;
}
/**
* @devices phone, tablet, car.
* Defines the alphabet index bar attribute functions.
* @since 7
*/
declare class AlphabetIndexerAttribute<T> extends CommonMethod<T> {
/**
* Index bar selection callback.
* @devices phone, tablet, car.
* @since 7
*/
onSelected(event: (index: number) => void): T;
/**
* Definitions color.
* @devices phone, tablet, car.
* @since 7
*/
color(value: Color | number | string | Resource): T;
color(value: ResourceColor): T;
/**
* Select the text color.
* @devices phone, tablet, car.
* @since 7
*/
selectedColor(value: Color | number | string | Resource): T;
selectedColor(value: ResourceColor): T;
/**
* Font color of the pop-up prompt text.
* @devices phone, tablet, car.
* @since 7
*/
popupColor(value: Color | number | string | Resource): T;
popupColor(value: ResourceColor): T;
/**
* Select the text background color.
* @devices phone, tablet, car.
* @since 7
*/
selectedBackgroundColor(value: Color | number | string | Resource): T;
selectedBackgroundColor(value: ResourceColor): T;
/**
* Background color of the pop-up window index.
* @devices phone, tablet, car.
* @since 7
*/
popupBackground(value: Color | number | string | Resource): T;
popupBackground(value: ResourceColor): T;
/**
* Whether to use pop-up index hints.
* @devices phone, tablet, car.
* @since 7
*/
usingPopup(value: boolean): T;
/**
* Select the text text style,
* @devices phone, tablet, car.
* @since 7
*/
selectedFont(value: { size?: number, weight?: FontWeight, family?: string, style?: FontStyle}): T;
selectedFont(value: Font): T;
/**
* Select the text background color.
* @devices phone, tablet, car.
* @since 7
*/
popupFont(value: { size?: number, weight?: FontWeight, family?: string, style?: FontStyle}): T;
popupFont(value: Font): T;
/**
* Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side.
* @devices phone, tablet, car.
* @since 7
*/
itemSize(value: string | number): T;
/**
* Definitions fonts.
* @devices phone, tablet, car.
* @since 7
*/
font(value: { size?: number, weight?: FontWeight, family?: string, style?: FontStyle}): T;
font(value: Font): T;
/**
* Alphabet index bar alignment style. The left and right alignment styles are supported, which affects the pop-up position of the pop-up window.
* @devices phone, tablet, car.
* @since 7
*/
alignStyle(value: IndexerAlign): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const AlphabetIndexerInterface: AlphabetIndexer;
export declare class AlphabetIndexerExtend<T> extends AlphabetIndexerAttribute<T> {}

View File

@ -13,185 +13,183 @@
* limitations under the License.
*/
import {CommonMethod, AnimationStatus, Curve, FillMode, PlayMode} from "./common";
import { CommonMethod } from "./common";
import { AnimationStatus, Curve, FillMode, PlayMode } from "./enums";
/**
* Customize spring properties.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export declare class SpringProp {
/**
* Constructor parameters
* @devices object, tablet.
* @since 7
* @systemapi
*/
constructor(mass: number, stiffness: number, damping: number);
}
/**
* Spring animation model. You can build a spring animation based on the start point, end point, initial speed, and spring attributes.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export declare class SpringMotion {
/**
* Constructor parameters
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
constructor(start: number, end: number, velocity: number, prop: SpringProp);
}
/**
* Friction animation model. You can build friction animation by friction force, initial position, and initial velocity.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export declare class FrictionMotion {
/**
* Constructor parameters
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
constructor(friction: number, position: number, velocity: number);
}
/**
* Rolling animation model: You can build rolling animation based on the initial position, initial speed, boundary position, and spring attributes.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export declare class ScrollMotion {
/**
* Constructor parameters
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
constructor(position: number, velocity: number, min: number, max: number, prop: SpringProp);
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class AnimatorExtend<T> extends AnimatorAttribute<T> {
}
/**
* @devices phone, tablet, car.
* Defines Animtor.
* @since 7
* @systemapi
*/
interface Animator extends AnimatorAttribute<Animator> {
/**
* Constructor parameters
* @since 7
* @systemapi
*/
(value: string): Animator;
}
/**
* @devices phone, tablet, car.
* Defines AnimatorAttribute.
* @since 7
* @systemapi
*/
declare class AnimatorAttribute<T> extends CommonMethod<T> {
/**
* Controls the playback status. The default value is the initial state.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
state(value: AnimationStatus): T;
/**
* Animation duration, in milliseconds.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
duration(value: number): T;
/**
* Animation curve, default to linear curve
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
curve(value: Curve): T;
/**
* Delayed animation playback duration, in milliseconds. By default, the animation is not delayed.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
delay(value: number): T;
/**
* Sets the state before and after the animation starts.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
fillMode(value: FillMode): T;
/**
* The default playback is once. If the value is -1, the playback is unlimited.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
iterations(value: number): T;
/**
* Sets the animation playback mode. By default, the animation starts to play again after the playback is complete.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
playMode(value: PlayMode): T;
/**
* Configure the physical animation algorithm.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
motion(value: SpringMotion | FrictionMotion | ScrollMotion): T;
/**
* Status callback, which is triggered when the animation starts to play.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onStart(event: () => void): T;
/**
* Status callback, triggered when the animation pauses.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onPause(event: () => void): T;
/**
* Status callback, triggered when the animation is replayed.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onRepeat(event: () => void): T;
/**
* Status callback, which is triggered when the animation is canceled.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onCancel(event: () => void): T;
/**
* Status callback, which is triggered when the animation playback is complete.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onFinish(event: () => void): T;
/**
* The callback input parameter is the interpolation during animation playback.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onFrame(event: (value: number) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const AnimatorInterface: Animator;
export declare class AnimatorExtend<T> extends AnimatorAttribute<T> {}
export declare const AnimatorInterface: Animator;

View File

@ -1,124 +1,152 @@
/*
* 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.
*/
import {CommonMethod, Color, Resource} from "./common"
/**
* @devices phone, tablet, car.
* @since 7
*/
declare enum BadgePosition {
/**
* The dot is displayed vertically centered on the right.
* @devices phone, tablet, car.
* @since 7
*/
RightTop,
/**
* Dots are displayed in the upper right corner.
* @devices phone, tablet, car.
* @since 7
*/
Right,
/**
* The dot is displayed in the left vertical center.
* @devices phone, tablet, car.
* @since 7
*/
Left
}
/**
* BadgeStyle object
* @devices phone, tablet, car.
* @since 7
*/
interface BadgeStyle {
/**
* Text Color
* @devices phone, tablet, car.
* @since 7
*/
color?: Color | number | string | Resource;
/**
* Text size.
* @devices phone, tablet, car.
* @since 7
*/
fontSize?: number | string;
/**
* Size of a badge.
* @devices phone, tablet, car.
* @since 7
*/
badgeSize: number | string;
/**
* Color of the badge.
* @devices phone, tablet, car.
* @since 7
*/
badgeColor: Color | number | string | Resource;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class BadgeExtend<T> extends BadgeAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface Badge extends BadgeAttribute<Badge> {
/**
* position: Set the display position of the prompt point.
* maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed.
* count: Set the number of reminder messages.
* style: You can set the style of the Badge component, including the text color, size, dot color, and size.
* @devices phone, tablet, car.
* @since 7
*/
(value: {count: number, position?: BadgePosition, maxCount?: number, style: BadgeStyle}): Badge;
/**
* value: Text string of the prompt content.
* position: Set the display position of the prompt point.
* maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed.
* style: You can set the style of the Badge component, including the text color, size, dot color, and size.
* @devices phone, tablet, car.
* @since 7
*/
(value: {value: string, position?: BadgePosition, maxCount?: number, style: BadgeStyle}): Badge;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class BadgeAttribute<T> extends CommonMethod<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const BadgeInterface: Badge
/*
* 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.
*/
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* Defines the badge position property.
* @since 7
*/
export declare enum BadgePosition {
/**
* The dot is displayed vertically centered on the right.
* @since 7
*/
RightTop,
/**
* Dots are displayed in the upper right corner.
* @since 7
*/
Right,
/**
* The dot is displayed in the left vertical center.
* @since 7
*/
Left,
}
/**
* BadgeStyle object
* @since 7
*/
export declare interface BadgeStyle {
/**
* Text Color
* @since 7
*/
color?: ResourceColor;
/**
* Text size.
* @since 7
*/
fontSize?: number | string;
/**
* Size of a badge.
* @since 7
*/
badgeSize?: number | string;
/**
* Color of the badge.
* @since 7
*/
badgeColor?: ResourceColor;
}
/**
* Defines the base param of badge.
* @since 7
*/
export declare interface BadgeParam {
/**
* Set the display position of the prompt point.
* @since 7
*/
position?: BadgePosition;
/**
* Defines the style of the Badge component, including the text color, size, dot color, and size.
* @since 7
*/
style: BadgeStyle;
}
/**
* Defines the badge param with count and maxCount.
* @since 7
*/
export declare interface BadgeParamWithNumber extends BadgeParam {
/**
* Set the number of reminder messages.
* @since 7
*/
count: number;
/**
* Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed.
* @since 7
*/
maxCount?: number;
}
/**
* Defines the badge param with string value.
* @since 7
*/
export declare interface BadgeParamWithString extends BadgeParam {
/**
* Text string of the prompt content.
* @since 7
*/
value: string;
}
/**
* Defines Badge Componrnt.
* @since 7
*/
interface Badge extends BadgeAttribute<Badge> {
/**
* position: Set the display position of the prompt point.
* maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed.
* count: Set the number of reminder messages.
* style: You can set the style of the Badge component, including the text color, size, dot color, and size.
* @since 7
*/
(value: BadgeParamWithNumber): Badge;
/**
* value: Text string of the prompt content.
* position: Set the display position of the prompt point.
* maxCount: Maximum number of messages. If the number of messages exceeds the maximum, only maxCount+ is displayed.
* style: You can set the style of the Badge component, including the text color, size, dot color, and size.
* @since 7
*/
(value: BadgeParamWithString): Badge;
}
/**
* Defines Badge Componrnt attribute.
* @since 7
*/
declare class BadgeAttribute<T> extends CommonMethod<T> {}
export declare class BadgeExtend<T> extends BadgeAttribute<T> {}
export declare const BadgeInterface: Badge;

View File

@ -13,45 +13,32 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common"
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class BlankExtend<T> extends BlankAttribute<T> {
}
/**
* Create Blank
* @devices phone, tablet, car.
* Create Blank.
* @since 7
*/
interface Blank extends BlankAttribute<Blank> {
/**
* The minimum size of the blank fill assembly on the container spindle.
* @devices phone, tablet, car.
* @since 7
*/
(min?: number | string): Blank;
}
/**
* inheritance CommonMethod Set Styles
* @devices phone, tablet, car.
* Inheritance CommonMethod Set Styles
* @since 7
*/
declare class BlankAttribute<T> extends CommonMethod<T> {
/**
* color: set color.
* @devices phone, tablet, car.
* @since 7
*/
color(value: Color | number | string | Resource): T;
color(value: ResourceColor): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const BlankInterface: Blank
export declare class BlankExtend<T> extends BlankAttribute<T> {}
export declare const BlankInterface: Blank;

View File

@ -13,124 +13,111 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common"
import {FontWeight} from "./text"
import { CommonMethod } from "./common";
import { FontWeight } from "./enums";
import { Length, ResourceColor, ResourceStr } from "./units";
/**
* Provides a button component.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ButtonType {
/**
* Capsule button (rounded corners default to half the height).
* @devices phone, tablet, car.
* @since 7
*/
Capsule,
/**
* Round buttons.
* @devices phone, tablet, car.
* @since 7
*/
Circle,
/**
* Arc Button.
* @devices phone, tablet, car.
* @since 7
*/
Arc,
/**
* Common button (no rounded corners by default).
* @devices phone, tablet, car.
* @since 7
*/
Normal
Normal,
}
/**
* @devices phone, tablet, car.
* Defines the button options.
* @since 7
*/
export declare class ButtonExtend<T> extends ButtonAttribute<T> {
export declare interface ButtonOption {
/**
* Describes the button style.
* @since 7
*/
type?: ButtonType;
/**
* Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled.
* @since 7
*/
stateEffect?: boolean;
}
/**
* @devices phone, tablet, car.
* Defines the Button Component.
* @since 7
*/
interface Button extends ButtonAttribute<Button> {
/**
* Button object
* @devices phone, tablet, car.
* @since 7
*/
(): Button;
/**
* Describes the button style.
* stateEffect: Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled.
* @devices phone, tablet, car.
* Create Button with Text child.
* @since 7
*/
(options: { type?: ButtonType, stateEffect?: boolean }): Button;
(options: ButtonOption): Button;
/**
* Button text content.
* type: Describes the button style.
* stateEffect: Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled.
* @devices phone, tablet, car.
* Create Button with inner text label.
* @since 7
*/
(label: string | Resource, options?: { type?: ButtonType, stateEffect?: boolean }): Button;
(label: ResourceStr, options?: ButtonOption): Button;
}
/**
* @devices phone, tablet, car.
* Defines the button attibute functions.
* @since 7
*/
declare class ButtonAttribute<T> extends CommonMethod<T> {
/**
* Describes the button style.
* @devices phone, tablet, car.
* @since 7
*/
type(value: ButtonType): T;
/**
* Indicates whether to enable the switchover effect when the button is pressed. When the status is set to false, the switchover effect is disabled.
* @devices phone, tablet, car.
* @since 7
*/
stateEffect(value: boolean): T;
/**
* Text color.
* @devices phone, tablet, car.
* @since 7
*/
fontColor(value: Color | number | string | Resource): T;
fontColor(value: ResourceColor): T;
/**
* Text size.
* @devices phone, tablet, car.
* @since 7
*/
fontSize(value: number | string | Resource): T;
fontSize(value: Length): T;
/**
* fonse weight
* @devices phone, tablet, car.
* @since 7
*/
fontWeight(value: number | FontWeight | string): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const ButtonInterface: Button
export declare class ButtonExtend<T> extends ButtonAttribute<T> {}
export declare const ButtonInterface: Button;

View File

@ -13,622 +13,626 @@
* limitations under the License.
*/
import {Axis, Color, Resource} from "./common";
import { Axis } from "./enums";
import { ResourceColor } from "./units";
/**
* Provides a monthly view component to display information such as date, shift break, and schedule.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface CalendarDay {
/**
* Indicates the sequence number of the 7 x 7 (7 x 6) grid layout on a calendar page by row.
* The week sequence is one, two, three, four, five, six.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
index: number;
/**
* Lunar moon.
* The week sequence is one, two, three, four, five, six.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
lunarMonth: string;
/**
* Lunar day.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
lunarDay: string;
/**
* Day.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayMark: string;
/**
* Indicates the off-duty flag information. The options are work and off.By default, the off-duty flag information is not required.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayMarkValue: string;
/**
* Gregorian calendar year.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
year: number;
/**
* Gregorian calendar month.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
month: number;
/**
* Gregorian calendar day.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
day: number;
/**
*
* Indicates whether the default value is Lunar calendar.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
isFirstOfLunar: boolean;
/**
* Indicates whether to display has Schedule.
* The week sequence is one, two, three, four, five, six.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
hasSchedule: boolean;
/**
* Display Lunar Date.The week sequence is one, two, three, four, five, six.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
markLunarDay: boolean;
}
/**
* Date object.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface MonthData {
/**
* Gregorian calendar year.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
year: number;
/**
* Gregorian calendar month.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
month: number;
/**
* CalendarDay.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
data: CalendarDay[];
}
/**
* CurrentDayStyle object.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface CurrentDayStyle {
/**
* Text color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayColor?: Color | number | string | Resource;
dayColor?: ResourceColor;
/**
* lunar Text color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
lunarColor?: Color | number | string | Resource;
lunarColor?: ResourceColor;
/**
* lunar Work and rest text color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
markLunarColor?: Color | number | string | Resource;
markLunarColor?: ResourceColor;
/**
* Text fontSize.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayFontSize?: number;
/**
* lunar text fontSize.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
lunarDayFontSize?: number;
/**
* Single date height.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayHeight?: number;
/**
* Single date width.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayWidth?: number;
/**
* Gregorian calendar height.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
gregorianCalendarHeight?: number;
/**
* Data y axis Off set.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dayYAxisOffset?: number;
/**
* Lunar data y axis Off set.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
lunarDayYAxisOffset?: number;
/**
* Under score X Axis Off set.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
underscoreXAxisOffset?: number;
/**
* Under score Y Axis Off set
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
underscoreYAxisOffset?: number;
/**
* Schedule marker X axis Off set
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
scheduleMarkerXAxisOffset?: number;
/**
* schedule Marker Y Axis Off set
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
scheduleMarkerYAxisOffset?: number;
/**
* Number of columns.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
colSpace?: number;
/**
* Daily five row space.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dailyFiveRowSpace?: number;
/**
* Daily six row space.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dailySixRowSpace?: number;
/**
* Sigle lunar height.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
lunarHeight?: number;
/**
* Under score width.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
underscoreWidth?: number;
/**
* Under score length.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
underscoreLength?: number;
/**
* Schedule marker radius.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
scheduleMarkerRadius?: number;
/**
* Boun dary row offset.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
boundaryRowOffset?: number;
/**
* Boundary col offsett.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
boundaryColOffset?: number;
}
/**
* Non current day style.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface NonCurrentDayStyle {
/**
* Non-current month day color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
nonCurrentMonthDayColor?: Color | number | string | Resource;
nonCurrentMonthDayColor?: ResourceColor;
/**
* Lunar style of non-current month.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
nonCurrentMonthLunarColor?: Color | number | string | Resource;
nonCurrentMonthLunarColor?: ResourceColor;
/**
* Non-Current Month Workday Marker Color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
nonCurrentMonthWorkDayMarkColor?: Color | number | string | Resource;
nonCurrentMonthWorkDayMarkColor?: ResourceColor;
/**
* Non-Current Month Off Day Marker Color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
nonCurrentMonthOffDayMarkColor?: Color | number | string | Resource;
nonCurrentMonthOffDayMarkColor?: ResourceColor;
}
/**
* Non current day style.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface TodayStyle {
/**
* Style of focus color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
focusedDayColor?: Color | number | string | Resource;
focusedDayColor?: ResourceColor;
/**
* Focus on Lunar Colors.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
focusedLunarColor?: Color | number | string | Resource;
focusedLunarColor?: ResourceColor;
/**
* Background color of the focus area.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
focusedAreaBackgroundColor?: Color | number | string | Resource;
focusedAreaBackgroundColor?: ResourceColor;
/**
* Focus area radius.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
focusedAreaRadius?: number;
}
/**
* Week Style.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface WeekStyle {
/**
* Style of week color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekColor?: Color | number | string | Resource;
weekColor?: ResourceColor;
/**
* Style of week day color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekendDayColor?: Color | number | string | Resource;
weekendDayColor?: ResourceColor;
/**
* Style of lunar color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekendLunarColor?: Color | number | string | Resource;
weekendLunarColor?: ResourceColor;
/**
* Style of week font size.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekFontSize?: number;
/**
* Style of week height.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekHeight?: number;
/**
* Style of week width.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekWidth?: number;
/**
* Style of week space.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekAndDayRowSpace?: number;
}
/**
* Work state style.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
export interface WorkStateStyle {
/**
* Style of day color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
workDayMarkColor?: Color | number | string | Resource;
workDayMarkColor?: ResourceColor;
/**
* Style of day color.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
offDayMarkColor?: Color | number | string | Resource;
offDayMarkColor?: ResourceColor;
/**
* Style of day size.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
workDayMarkSize?: number;
/**
* Style of day size.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
offDayMarkSize?: number;
/**
* Style of width.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
workStateWidth?: number;
/**
* Style of distance.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
workStateHorizontalMovingDistance?: number;
/**
* Style of distance.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
workStateVerticalMovingDistance?: number;
}
/**
* Calendar controller.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
declare class CalendarController {
/**
* Constructor.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
constructor();
/**
* Back to day.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
backToToday();
/**
* To the specified element.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
goTo(value: { year: number, month: number, day: number });
goTo(value: { year: number; month: number; day: number });
}
/**
* Create calendar.
* @devices phone, tablet, car.
* @since 7
*/
export declare class CalendarExtend<T> extends CalendarAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
interface Calendar extends CalendarAttribute<Calendar> {
/**
* Set value.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
(value: { date: { year: number, month: number, day: number }, currentData: MonthData, preData: MonthData, nextData: MonthData, controller?: CalendarController }): Calendar;
(value: {
date: { year: number; month: number; day: number };
currentData: MonthData;
preData: MonthData;
nextData: MonthData;
controller?: CalendarController;
}): Calendar;
}
/**
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
declare class CalendarAttribute<T> {
/**
* Specifies whether the component displays the lunar calendar information.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
showLunar(value: boolean): T;
/**
* Setting whether to display holiday information
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
showHoliday(value: boolean): T;
/**
* Indicates whether the page can be scrolled.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
needSlide(value: boolean): T;
/**
* Set the start day of the week for the calendar.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
startOfWeek(value: number): T;
/**
* Set weekend. The default value is Sunday and Saturday.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
offDays(value: number): T;
/**
* Sets the sliding direction.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
direction(value: Axis): T;
/**
* Sets the date style in the current month.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
currentDayStyle(value: CurrentDayStyle): T;
/**
* Sets the non-monthly date style.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
nonCurrentDayStyle(value: NonCurrentDayStyle): T;
/**
* Set the date style for today.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
todayStyle(value: TodayStyle): T;
/**
* Sets the date style for the weekend.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
weekStyle(value: WeekStyle): T;
/**
* Sets the style of the working state.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
workStateStyle(value: WorkStateStyle): T;
/**
* Click a date to return the information about the date you clicked.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onSelectChange(event: (event: { year: number, month: number, day: number }) => void): T;
onSelectChange(event: (event: { year: number; month: number; day: number }) => void): T;
/**
* When you swipe to switch months, the information about the previous month and the next month is requested.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onRequestData(event: (event: { year: number, month: number, currentYear: number, currentMonth: number, monthState: number }) => void): T;
onRequestData(
event: (event: {
year: number;
month: number;
currentYear: number;
currentMonth: number;
monthState: number;
}) => void,
): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const CalendarInterface: Calendar
export declare class CalendarExtend<T> extends CalendarAttribute<T> {}
export declare const CalendarInterface: Calendar;

View File

@ -1,79 +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.
*/
import {CommonMethod} from "./common";
/**
* Camera component, which provides the preview and photographing functions.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum DevicePosition {
/**
* Front camera
* @devices phone, tablet, car.
* @since 7
*/
Front,
/**
* Back camera
* @devices phone, tablet, car.
* @since 7
*/
Back
}
/**
* Camera component, which provides the preview and photographing functions.
* @devices phone, tablet, car.
* @since 7
*/
export declare class CameraExtend<T> extends CameraAttribute<T> {
}
/**
* resolution Width, resolution Height
* @devices phone, tablet, car.
* @since 7
*/
interface Camera extends CameraAttribute<Camera> {
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value: { id: string, resolutionWidth: number, resolutionHeight: number }): Camera;
}
/**
* set CameraAttribute
* @devices phone, tablet, car.
* @since 7
*/
declare class CameraAttribute<T> extends CommonMethod<T> {
/**
* Set devicePosition value.
* @devices phone, tablet, car.
* @since 7
*/
devicePosition(value: DevicePosition): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const CameraInterface: Camera;

View File

@ -13,47 +13,43 @@
* limitations under the License.
*/
import {CommonShapeMethod} from "./common";
import { CommonShapeMethod } from "./common";
/**
* @devices phone, tablet, car.
* Defines circle option for Circle component.
* @since 7
*/
export declare class CircleExtend<T> extends CircleAttribute<T> {
export declare interface CircleOption {
/**
* Defines the width property.
* @since 7
*/
width?: string | number;
/**
* Defines the height property.
* @since 7
*/
height?: string | number;
}
/**
* new Circle component.
* @devices phone, tablet, car.
* Defines circle component.
* @since 7
*/
interface Circle extends CircleAttribute<Circle> {
/**
* Set new value..
* @devices phone, tablet, car.
* @since 7
*/
new (value?: { width?: string | number, height?: string | number }): Circle;
/**
* Set the value..
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: string | number, height?: string | number }): Circle;
(value?: CircleOption): Circle;
}
/**
* Circle drawing component.
* @devices phone, tablet, car.
* Circle drawing component attribute functions.
* @since 7
*/
declare class CircleAttribute<T> extends CommonShapeMethod<T> {
}
declare class CircleAttribute<T> extends CommonShapeMethod<T> {}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class CircleExtend<T> extends CircleAttribute<T> {}
export declare const CircleInterface: Circle;

View File

@ -13,18 +13,11 @@
* limitations under the License.
*/
import {CommonMethod, HorizontalAlignDeclaration, HorizontalAlign} from "./common";
import { CommonMethod } from "./common";
import { HorizontalAlign } from "./enums";
/**
* Containers laid out vertically.
* @devices phone, tablet, car.
* @since 7
*/
export declare class ColumnExtend<T> extends ColumnAttribute<T> {
}
/**
* @devices phone, tablet, car.
* Defines the Column Component.
* @since 7
*/
interface Column extends ColumnAttribute<Column> {
@ -32,27 +25,22 @@ interface Column extends ColumnAttribute<Column> {
* Set the value.
* useAlign:Use a custom alignment.
* space: Vertical layout element spacing.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { useAlign?: HorizontalAlignDeclaration, space?: string | number }): Column;
(value?: { space?: string | number }): Column;
}
/**
* @devices phone, tablet, car.
* Defines the Column component attribute functions.
* @since 7
*/
export declare class ColumnAttribute<T> extends CommonMethod<T> {
/**
* Sets the alignment format of the subassembly in the horizontal direction.
* @devices phone, tablet, car.
* @since 7
*/
alignItems(value: HorizontalAlign): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ColumnExtend<T> extends ColumnAttribute<T> {}
export declare const ColumnInterface: Column;

View File

@ -13,43 +13,31 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ColumnSplitExtend<T> extends ColumnSplitAttribute<T> {
}
/**
* @devices phone, tablet, car.
* Defines the ColumnSplit component.
* @since 7
*/
interface ColumnSplit extends ColumnSplitAttribute<ColumnSplit> {
/**
* Layout the subassemblies vertically and insert a horizontal divider line between each subassemblies.
* @devices phone, tablet, car.
* @since 7
*/
(): ColumnSplit;
}
/**
* @devices phone, tablet, car.
* Defines the ColumnSplit component attribute functions.
* @since 7
*/
declare class ColumnSplitAttribute<T> extends CommonMethod<T> {
/**
* Indicates whether the split line can be dragged. The default value is false.
* @devices phone, tablet, car.
* @since 7
*/
resizeable(value: boolean): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const ColumnSplitInterface: ColumnSplit;
export declare class ColumnSplitExtend<T> extends ColumnSplitAttribute<T> {}

File diff suppressed because it is too large Load Diff

View File

@ -13,58 +13,43 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class CounterExtend<T> extends CounterAttribute<T> {
}
import { CommonMethod } from "./common";
/**
* Counter component, which provides corresponding increment or decrement counting operations.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface Counter extends CounterAttribute<Counter> {
/**
* Return Counter.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(): Counter;
}
/**
* @devices phone, tablet, car.
* @since 7
* Defines the Counter attibute functions.
* @since 8
*/
declare class CounterAttribute<T> extends CommonMethod<T> {
/**
* Listens to the value change event.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onStateChange(event: () => void): T;
/**
* Listen to the event that the value increases.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onInc(event: () => void): T;
/**
* Listens to the number decrease event.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onDec(event: () => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const CounterInterface: Counter;
export declare class CounterExtend<T> extends CounterAttribute<T> {}

View File

@ -1,51 +1,83 @@
/*
* 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.
*/
import { DialogAlignment } from "./alert_dialog";
import {CommonMethod, Resource} from "./common";
/**
* Use the CustomDialogController class to display the custom pop-up window.
* @devices phone, tablet, car.
* @since 7
*/
export declare class CustomDialogController {
/**
* The constructor transfers parameter settings.
* @devices phone, tablet, car.
* @since 7
*/
constructor(value: {
builder: any, cancel?: () => void,
autoCancel?: boolean,
alignment?: DialogAlignment,
offset?: { dx: number | string | Resource, dy: number | string | Resource },
customStyle?: boolean
});
/**
* Display the content of the customized pop-up window. If the content has been displayed, it does not take effect.
* @devices phone, tablet, car.
* @since 7
*/
open();
/**
* Closes the custom pop-up window. If the window is closed, the window does not take effect.
* @devices phone, tablet, car.
* @since 7
*/
close();
}
/*
* 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.
*/
import { DialogAlignment } from "./alert_dialog";
import { Offset } from "./units";
/**
* Defines the option of CustomDialogController.
* @since 7
*/
export declare interface CustomDialogControllerOption {
/**
* Custom builder function.
* @since 7
*/
builder: any;
/**
* Defines the cancel function.
* @since 7
*/
cancel?: () => void;
/**
* Defines if use auto cancel when click on the outside of the dialog.
* @since 7
*/
autoCancel?: boolean;
/**
* Defines the dialog alignment of the screen.
* @since 7
*/
alignment?: DialogAlignment;
/**
* Defines the dialog offset.
* @since 7
*/
offset?: Offset;
/**
* Defines if use costom style.
* @since 7
*/
customStyle?: boolean;
}
/**
* Use the CustomDialogController class to display the custom pop-up window.
* @since 7
*/
export declare class CustomDialogController {
/**
* The constructor transfers parameter settings.
* @since 7
*/
constructor(value: CustomDialogControllerOption);
/**
* Display the content of the customized pop-up window. If the content has been displayed, it does not take effect.
* @since 7
*/
open();
/**
* Closes the custom pop-up window. If the window is closed, the window does not take effect.
* @since 7
*/
close();
}

View File

@ -0,0 +1,61 @@
/*
* 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.
*/
import { CommonMethod } from "./common";
/**
* Defines the option of DataPanel.
* @since 7
*/
export declare interface DataPanelOption {
/**
* Current data value. the max length is 9.
* @since 7
*/
values: number[];
/**
* Maximum value of the current data.
* @since 7
*/
max?: number;
}
/**
* Defines the DataPanel component.
* @since 7
*/
interface DataPanel extends DataPanelAttribute<DataPanel> {
/**
* Return a DataPanel.
* @since 7
*/
(options: DataPanelOption): DataPanel;
}
/**
* Defines the DataPanel attribute functions.
* @since 7
*/
declare class DataPanelAttribute<T> extends CommonMethod<T> {
/**
* Disable the special effect of the data ratio chart.
* @since 7
*/
closeEffect(value: boolean): T;
}
export declare class DataPanelExtend<T> extends DataPanelAttribute<T> {}
export declare const DataPanelInterface: DataPanel;

View File

@ -1,58 +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.
*/
import {CommonMethod} from "./common";
/**
* The data panel component is used to display multiple data proportions in a circular proportion chart.
* @devices phone, tablet, car.
* @since 7
*/
export declare class DataPanelExtend<T> extends DataPanelAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface DataPanel extends DataPanelAttribute<DataPanel> {
/**
* Return a DataPanel.
* values: Current data value. A maximum of nine data records are supported.
* max: Maximum value of the current data.
* @devices phone, tablet, car.
* @since 7
*/
(options: {values: number[], max?: number}): DataPanel;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class DataPanelAttribute<T> extends CommonMethod<T> {
/**
* Disable the special effect of the data ratio chart.
* @devices phone, tablet, car.
* @since 7
*/
closeEffect(value: boolean): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare const DataPanelInterface: DataPanel;

View File

@ -13,125 +13,124 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Date and time slide selector component.
* @devices phone, tablet, car.
* @since 7
*/
export declare class DatePickerExtend<T> extends DatePickerAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
* Defines the type of DatePicker.
* @since 8
*/
export declare enum DatePickerType {
/**
* Application hour and second
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Time,
/**
* Application data
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Date
Date,
}
export interface DatePickerResult {
export declare interface DatePickerResult {
/**
* Application year
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
year?: number;
/**
* Application month
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
month?: number;
/**
* Application day
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
day?: number;
/**
* Application hour
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
hour?: number;
/**
* Application minute
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
minute?: number;
/**
* Application second
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
second?: number;
}
/**
* @devices phone, tablet, car.
* @since 7
* Defines the option of DatePicker.
* @since 8
*/
interface DatePicker extends DatePickerAttribute<DatePicker> {
export declare interface DatePickerOption {
/**
* start: Specifies the start date of the date selector.
* end: Specifies the end date for the date selector.
* selected: Specifies the date selector check date or time selector check time.
* type: Selector type, including date selector and time selector. By default, the date selector is used.
* @devices phone, tablet, car.
* @since 7
* Specifies the start date of the date selector.
*/
(options?: {start?: Date, end?: Date, selected?: Date, type?: DatePickerType}): DatePicker;
start?: Date;
/**
* Specifies the end date for the date selector.
*/
end?: Date;
/**
* Specifies the date selector check date or time selector check time.
*/
selected?: Date;
/**
* Selector type, including date selector and time selector. By default, the date selector is used.
*/
type?: DatePickerType;
}
/**
* @devices phone, tablet, car.
* @since 7
* Defines the DatePicker Component.
* @since 8
*/
interface DatePicker extends DatePickerAttribute<DatePicker> {
/**
* Defines the DatePicker constructor.
* @since 8
*/
(options?: DatePickerOption): DatePicker;
}
/**
* Defines the DatePicker attribute functions.
* @since 8
*/
declare class DatePickerAttribute<T> extends CommonMethod<T> {
/**
* Date selector: true: displays the lunar calendar. false: The lunar calendar is not displayed.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
lunar(value: boolean): T;
/**
* Time Selector: indicates whether to display the 24-hour clock.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
useMilitaryTime(value: boolean): T;
/**
* This event is triggered when a DatePicker date or time is selected.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onChange(callback: (value: DatePickerResult) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class DatePickerExtend<T> extends DatePickerAttribute<T> {}
export declare const DatePickerInterface: DatePicker;

View File

@ -13,66 +13,52 @@
* limitations under the License.
*/
import {CommonMethod, Color, LineCapStyle, Resource} from "./common";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class DividerExtend<T> extends DividerAttribute<T> {
}
import { CommonMethod } from "./common";
import { LineCapStyle } from "./enums";
import { ResourceColor } from "./units";
/**
* Provides a divider component to separate different content blocks/content elements.
* @devices phone, tablet, car.
* @since 7
*/
interface Divider extends DividerAttribute<Divider> {
/**
* Return Divider.
* @devices phone, tablet, car.
* @since 7
*/
(): Divider;
}
/**
* @devices phone, tablet, car.
* Defines the Divider attribute functions.
* @since 7
*/
declare class DividerAttribute<T> extends CommonMethod<T> {
/**
* Indicates whether to use a horizontal splitter or a vertical splitter.
* The options are as follows: false: horizontal splitter; true: vertical splitter.
* @devices phone, tablet, car.
* @since 7
*/
vertical(value: boolean): T;
/**
* Sets the color of the divider line.
* @devices phone, tablet, car.
* @since 7
*/
color(value: Color | number | string | Resource): T;
color(value: ResourceColor): T;
/**
* Sets the width of the dividing line.
* @devices phone, tablet, car.
* @since 7
*/
strokeWidth(value: number | string): T;
/**
* Sets the end style of the split line. The default value is Butt.
* @devices phone, tablet, car.
* @since 7
*/
lineCap(value: LineCapStyle): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class DividerExtend<T> extends DividerAttribute<T> {}
export declare const DividerInterface: Divider;

View File

@ -13,45 +13,24 @@
* limitations under the License.
*/
import {CommonShapeMethod} from "./common";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class EllipseExtend<T> extends EllipseAttribute<T> {
}
import { CommonShapeMethod } from "./common";
/**
* Ellipse drawing.
* @devices phone, tablet, car.
* @since 7
*/
interface Ellipse extends EllipseAttribute<Ellipse> {
/**
* Set a new value.
* @devices phone, tablet, car.
* @since 7
*/
new (value?: { width?: string | number, height?: string | number }): Ellipse;
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: string | number, height?: string | number }): Ellipse;
(value?: { width?: string | number; height?: string | number }): Ellipse;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class EllipseAttribute<T> extends CommonShapeMethod<T> {
}
declare class EllipseAttribute<T> extends CommonShapeMethod<T> {}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class EllipseExtend<T> extends EllipseAttribute<T> {}
export declare const EllipseInterface: Ellipse;

1297
api/@internal/component/ets/enums.d.ts vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,47 +13,62 @@
* limitations under the License.
*/
import {CommonMethod, FlexDirection, FlexWrap, FlexAlign, ItemAlign} from "./common";
import { CommonMethod } from "./common";
import { FlexAlign, FlexDirection, FlexWrap, ItemAlign } from "./enums";
/**
* @devices phone, tablet, car.
* Defines the option of Flex.
* @since 7
*/
export declare class FlexExtend<T> extends FlexAttribute<T> {
export declare interface FlexOption {
/**
* Sets the horizontal layout of elements.
* @since 7
*/
direction?: FlexDirection;
/**
* Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement.
* @since 7
*/
wrap?: FlexWrap;
/**
* The alignment format of the subassembly on the Flex container spindle.
* @since 7
*/
justifyContent?: FlexAlign;
/**
* Alignment Format for Subassembly on Flex Container Cross Axis.
* @since 7
*/
alignItems?: ItemAlign;
/**
* The alignment of multiple lines of content when there is extra space in the cross axis.
* @since 7
*/
alignContent?: FlexAlign;
}
/**
* Provides a monthly view component to display information such as date, shift break, and schedule.
* @devices phone, tablet, car.
* @since 7
*/
interface Flex extends FlexAttribute<Flex> {
/**
* Set the value.
* direction: Sets the horizontal layout of elements.
* wrap: Whether the Flex container is a single row/column arrangement or a multi-row/column arrangement.
* justifyContent: The alignment format of the subassembly on the Flex container spindle.
* alignItems: Alignment Format for Subassembly on Flex Container Cross Axis
* alignContent:The alignment of multiple lines of content when there is extra space in the cross axis.
* @devices phone, tablet, car.
* Defines the constructor of Flex.
* @since 7
*/
(value?: {
direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: FlexAlign,
alignItems?: ItemAlign, alignContent?: FlexAlign
}): Flex;
(value?: FlexOption): Flex;
}
/**
* Common Setting
* @devices phone, tablet, car.
* Defines the Flex attribute functions.
* @since 7
*/
declare class FlexAttribute<T> extends CommonMethod<T> {
}
declare class FlexAttribute<T> extends CommonMethod<T> {}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare class FlexExtend<T> extends FlexAttribute<T> {}
export declare const FlexInterface: Flex;

View File

@ -15,17 +15,18 @@
/**
* looping
* @devices phone, tablet, car.
* @since 7
*/
interface ForEach {
/**
* Set the value, array, and key.
* @devices phone, tablet, car.
* @since 7
*/
(arr: Array<any>, itemGenerator: (item: any, index?: number) => void,
keyGenerator?: (item: any, index?: number) => string): ForEach;
(
arr: Array<any>,
itemGenerator: (item: any, index?: number) => void,
keyGenerator?: (item: any, index?: number) => string,
): ForEach;
}
/**

View File

@ -13,127 +13,126 @@
* limitations under the License.
*/
import {CommonMethod, Visibility} from "./common";
import { CommonMethod } from "./common";
import { Visibility } from "./enums";
/**
* @devices phone, tablet, car.
* Defines the FormDimension enum.
* @since 7
* @systemapi
*/
export declare enum FormDimension {
/**
* 1 x 2 cards
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
Dimension_1_2,
/**
* 2 x 2 cards
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
Dimension_2_2,
/**
* 2 x 4 cards
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
Dimension_2_4,
/**
* 4 x 4 cards
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
Dimension_4_4
Dimension_4_4,
}
/**
* The card component is provided to display cards.
* @devices phone, tablet, car.
* @since 7
*/
export declare class FormComponentExtend<T> extends FormComponentAttribute<T> {
}
/**
* @devices phone, tablet, car.
* Defines the FormComponent.
* @since 7
* @systemapi
*/
interface FormComponent extends FormComponentAttribute<FormComponent> {
/**
* Set a new value.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
(value: {id: number, name: string, bundle: string, ability: string, module: string, dimension?: FormDimension}): FormComponent;
(value: {
id: number;
name: string;
bundle: string;
ability: string;
module: string;
dimension?: FormDimension;
}): FormComponent;
}
/**
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
declare class FormComponentAttribute<T> extends CommonMethod<T> {
/**
* Sets the display area size of the card.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
size(value: {width: number, height: number}): T;
size(value: { width: number; height: number }): T;
/**
* Card module name.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
moduleName(value: string): T;
/**
* Set the card size.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
dimension(value: FormDimension): T;
/**
* Indicates whether to allow card update.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
allowUpdate(value: boolean): T;
/**
* Whether the card is visible.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
visibility(value: Visibility): T;
/**
* This function is triggered after card information is obtained. For details about the form information, see the definition of the original capability subsystem.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onAcquired(callback: (info: {id: number}) => void): T;
onAcquired(callback: (info: { id: number }) => void): T;
/**
* Card loading error.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onError(callback: (info: {errcode: number, msg: string}) => void): T;
onError(callback: (info: { errcode: number; msg: string }) => void): T;
/**
* Card to be redirected.
* @devices phone, tablet, car.
* @since 7
* @systemapi
*/
onRouter(callback: (info: any) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class FormComponentExtend<T> extends FormComponentAttribute<T> {}
export declare const FormComponentInterface: FormComponent;

View File

@ -1,100 +1,81 @@
/*
* 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.
*/
import {CommonMethod, Color} from "./common";
/**
* Data gauge chart component, used to display data as a ring chart.
* @devices phone, tablet, car.
* @since 7
*/
export declare class GaugeExtend<T> extends GaugeAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface Gauge extends GaugeAttribute<Gauge> {
/**
* value:Current data value.
* min: Current Segment Minimum Value
* max: Current Segment Maximum Value
* @devices phone, tablet, car.
* @since 7
*/
(options: {value: number, min?: number, max?: number}): Gauge;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class GaugeAttribute<T> extends CommonMethod<T> {
/**
* Sets the value for the current profile.
* @devices phone, tablet, car.
* @since 7
*/
value(value: number): T;
/**
* Set the start angle. Clock 0 is 0 degrees and clockwise is positive.
* @devices phone, tablet, car.
* @since 7
*/
startAngle(angle: number): T;
/**
* Sets the end angle position. Clock 0 is 0 degrees and clockwise is positive.
* @devices phone, tablet, car.
* @since 7
*/
endAngle(angle: number): T;
/**
* Set the color of the chart. You can set the solid color and segmented gradient color.
* @devices phone, tablet, car.
* @since 7
*/
colors(colors: Array<any>): T;
/**
* Sets the thickness of the ring chart.
* @devices phone, tablet, car.
* @since 7
*/
strokeWidth(length: number): T;
/**
* Mark points describe the content of the text.
* @devices phone, tablet, car.
* @since 7
*/
labelTextConfig(markedLabelText: string): T;
/**
* Color of the marker point description text.
* @devices phone, tablet, car.
* @since 7
*/
labelColorConfig(markedLabelColor: Color): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare const GaugeInterface: Gauge;
/*
* 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.
*/
import { CommonMethod } from "./common";
import { Color } from "./enums";
/**
* Defines the Guage component.
* @since 8
*/
interface Gauge extends GaugeAttribute<Gauge> {
/**
* value:Current data value.
* min: Current Segment Minimum Value
* max: Current Segment Maximum Value
* @since 8
*/
(options: { value: number; min?: number; max?: number }): Gauge;
}
/**
* @since 8
*/
declare class GaugeAttribute<T> extends CommonMethod<T> {
/**
* Sets the value for the current profile.
* @since 8
*/
value(value: number): T;
/**
* Set the start angle. Clock 0 is 0 degrees and clockwise is positive.
* @since 8
*/
startAngle(angle: number): T;
/**
* Sets the end angle position. Clock 0 is 0 degrees and clockwise is positive.
* @since 8
*/
endAngle(angle: number): T;
/**
* Set the color of the chart. You can set the solid color and segmented gradient color.
* @since 8
*/
colors(colors: Array<any>): T;
/**
* Sets the thickness of the ring chart.
* @since 8
*/
strokeWidth(length: number): T;
/**
* Mark points describe the content of the text.
* @since 8
*/
labelTextConfig(markedLabelText: string): T;
/**
* Color of the marker point description text.
* @since 8
*/
labelColorConfig(markedLabelColor: Color): T;
}
export declare class GaugeExtend<T> extends GaugeAttribute<T> {}
export declare const GaugeInterface: Gauge;

View File

@ -13,39 +13,25 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Creating a Geometry View
* @devices phone, tablet, car.
* @since 7
*/
export declare class GeometryViewExtend<T> extends GeometryViewAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
* Defines the GeometryView Component.
* @since 8
*/
interface GeometryView extends GeometryViewAttribute<GeometryView> {
/**
* Callback function.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(callback: (geometry?: any) => void): GeometryView;
}
/**
* Inherit Public
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
declare class GeometryViewAttribute<T> extends CommonMethod<T> {
}
declare class GeometryViewAttribute<T> extends CommonMethod<T> {}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare class GeometryViewExtend<T> extends GeometryViewAttribute<T> {}
export declare const GeometryViewInterface: GeometryView;

View File

@ -15,255 +15,214 @@
/**
* Creating an Object
* @devices phone, tablet, car.
* @since 7
*/
export declare enum GestureDirection {
/**
* Sliding in all directions.
* @devices phone, tablet, car.
* @since 7
*/
All,
/**
* Sliding horizontally.
* @devices phone, tablet, car.
* @since 7
*/
Horizontal,
/**
* Sliding Vertical
* @devices phone, tablet, car.
* @since 7
*/
Vertical
Vertical,
}
/**
* Creating an Object
* @devices phone, tablet, car.
* @since 7
*/
export declare enum PanDirection {
/**
* Default.
* @devices phone, tablet, car.
* @since 7
*/
None,
/**
* Default.
* @since 7
*/
None,
/**
* Sliding horizontally.
* @devices phone, tablet, car.
* @since 7
*/
Horizontal,
/**
* Sliding horizontally.
* @since 7
*/
Horizontal,
/**
* Sliding left.
* @devices phone, tablet, car.
* @since 7
*/
Left,
/**
* Sliding left.
* @since 7
*/
Left,
/**
* Sliding right.
* @devices phone, tablet, car.
* @since 7
*/
Right,
/**
* Sliding right.
* @since 7
*/
Right,
/**
* Sliding Vertical
* @devices phone, tablet, car.
* @since 7
*/
Vertical,
/**
* Sliding Vertical
* @since 7
*/
Vertical,
/**
* Sliding up.
* @devices phone, tablet, car.
* @since 7
*/
Up,
/**
* Sliding up.
* @since 7
*/
Up,
/**
* Sliding Down.
* @devices phone, tablet, car.
* @since 7
*/
Down,
/**
* Sliding Down.
* @since 7
*/
Down,
/**
* Sliding in all directions.
* @devices phone, tablet, car.
* @since 7
*/
All
/**
* Sliding in all directions.
* @since 7
*/
All,
}
/**
* Creating an Object
* @devices phone, tablet, car.
* @since 7
*/
export declare enum GestureMode {
/**
* Sequential gesture recognition is performed in sequence according to the gesture registration sequence.
* @devices phone, tablet, car.
* @since 7
*/
Sequence,
/**
* Simultaneous recognition. Registration gestures participate in recognition. Everything can be triggered.
* @devices phone, tablet, car.
* @since 7
*/
Parallel,
/**
* Mutually exclusive recognition. Only one gesture is successfully recognized.
* @devices phone, tablet, car.
* @since 7
*/
Exclusive
Exclusive,
}
/**
* Creating an Object
* @devices phone, tablet, car.
* @since 7
*/
export declare enum GestureMask {
/**
* High-priority response to the current gesture.When the current gesture fails to be recognized, other gesture responses are triggered.For gestures with the same priority, responses are performed based on the recognition sequence.
* @devices phone, tablet, car.
* @since 7
*/
Normal,
/**
* Ignore internal gestures and recognize the current gesture first.
* @devices phone, tablet, car.
* @since 7
*/
IgnoreInternal
IgnoreInternal,
}
/**
* Creating an Object
* @devices phone, tablet, car.
* @since 7
*/
export declare type GestureType =
/**
* Set a type value.
* @devices phone, tablet, car.
* @since 7
*/
TapGesture
| LongPressGesture
| PanGesture
| PinchGesture
| RotationGesture
| GestureGroup
TapGesture | LongPressGesture | PanGesture | PinchGesture | RotationGesture | GestureGroup;
export interface GestureEvent {
/**
* long press gesture event used in the longpress scenario.
* @since 7
*/
export interface LongPressGestureEvent extends GestureEvent {
/**
* Indicates whether an event is triggered repeatedly. This parameter is used in the longpress scenario.
* @devices phone, tablet, car.
* Indicates whether an event is triggered repeatedly.
* @since 7
*/
repeat: boolean;
}
/**
* pan gesture event used in the pan gesture triggering scenario.
*/
export interface PanGestureEvent extends GestureEvent {
/**
* Gesture event offset X, which is used in the pan gesture triggering scenario.
* @devices phone, tablet, car.
* Gesture event offset X.
* @since 7
*/
offsetX: number;
/**
* Gesture event offset Y, which is used in the pan gesture triggering scenario.
* @devices phone, tablet, car.
* Gesture event offset Y.
* @since 7
*/
offsetY: number;
}
/**
* pinch gesture event used for triggering the pinch gesture.
* @since 7
*/
export interface PinchGestureEvent extends GestureEvent {
/**
* Scaling ratio, which is used for triggering the pinch gesture.
* @devices phone, tablet, car.
* Scaling ratio.
* @since 7
*/
scale: number;
/**
* Rotation angle, which is used to trigger the rotation gesture..
* @devices phone, tablet, car.
* @since 7
*/
angle: number;
/**
* Event timestamp.
* @devices phone, tablet, car.
* @since 7
*/
timestamp: number;
/**
* Indicates whether an event is triggered repeatedly. This parameter is used in the longpress scenario.
* @devices phone, tablet, car.
* @since 7
*/
globalX: number;
/**
* Indicates whether an event is triggered repeatedly. This parameter is used in the longpress scenario.
* @devices phone, tablet, car.
* @since 7
*/
globalY: number;
/**
* Horizontal distance from the upper left corner of the touched component. The upper left corner of the component is the origin.
* @devices phone, tablet, car.
* @since 7
*/
localX: number;
/**
* Longitudinal distance from the upper left corner of the touched component. The upper left corner of the component is the origin.
* @devices phone, tablet, car.
* @since 7
*/
localY: number;
/**
* X-axis coordinate of the kneading center point, in pixels.
* @devices phone, tablet, car.
* @since 7
*/
pinchCenterX: number;
/**
* Y-axis coordinate of the kneading center point, in pixels.
* @devices phone, tablet, car.
* @since 7
*/
pinchCenterY: number;
}
/**
* rotation gesture event used for triggering the pinch gesture.
* @since 7
*/
export interface RotationGestureEvent extends GestureEvent {
/**
* Rotation angle.
* @since 7
*/
angle: number;
}
/**
* base event for gesture.
* @since 7
*/
export interface GestureEvent {
/**
* Event timestamp.
* @since 7
*/
timestamp: number;
}
/**
* Creating an interface
* @devices phone, tablet, car.
* @since 7
*/
interface TapGesture {
@ -271,14 +230,12 @@ interface TapGesture {
* Set the value.
* count:Number of consecutive clicks recognized. If the value is less than 1, the default value is used.
* fingers:The hand index that triggers the click. If the value is less than 1, the default value is used.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { count?: number, fingers?: number }): TapGesture;
(value?: { count?: number; fingers?: number }): TapGesture;
/**
* Tap gesture recognition success callback.
* @devices phone, tablet, car.
* @since 7
*/
onAction(event: (event?: GestureEvent) => void): TapGesture;
@ -286,7 +243,6 @@ interface TapGesture {
/**
* Creating an interface
* @devices phone, tablet, car.
* @since 7
*/
interface LongPressGesture {
@ -295,242 +251,183 @@ interface LongPressGesture {
* fingers: Indicates the hand index that triggers the long press.
* repeat: Indicates whether to trigger event callback continuously.
* duration: Minimum press and hold time, in milliseconds.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { fingers?: number, repeat?: boolean, duration?: number }): LongPressGesture;
(value?: { fingers?: number; repeat?: boolean; duration?: number }): LongPressGesture;
/**
* LongPress gesture recognition success callback.
* @devices phone, tablet, car.
* @since 7
*/
onAction(event: (event?: GestureEvent) => void): LongPressGesture;
onAction(event: (event?: LongPressGestureEvent) => void): LongPressGesture;
/**
* The LongPress gesture is successfully recognized. When the finger is lifted, the callback is triggered.
* @devices phone, tablet, car.
* @since 7
*/
onActionEnd(event: (event?: GestureEvent) => void): LongPressGesture;
onActionEnd(event: (event?: LongPressGestureEvent) => void): LongPressGesture;
/**
* The LongPress gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
* @devices phone, tablet, car.
* @since 7
*/
onActionCancel(event: () => void): LongPressGesture;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class PanGestureOption {
/**
* Constructor parameters.
* @devices phone, tablet, car.
* @since 7
*/
constructor(value?: { fingers?: number, direction?: PanDirection, distance?: number });
constructor(value?: { fingers?: number; direction?: PanDirection; distance?: number });
/**
* Sets the direction attribute.
* @devices phone, tablet, car.
* @since 7
*/
setDirection(value: PanDirection);
/**
* Sets the setDistance attribute.
* @devices phone, tablet, car.
* @since 7
*/
setDistance(value: number);
/**
* Sets the setFingers attribute.
* @devices phone, tablet, car.
* @since 7
*/
setFingers(value: number);
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface PanGesture {
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { fingers?: number, direction?: PanDirection, distance?: number } | PanGestureOption): PanGesture;
(value?: { fingers?: number; direction?: PanDirection; distance?: number } | PanGestureOption): PanGesture;
/**
* Pan gesture recognition success callback.
* @devices phone, tablet, car.
* @since 7
*/
onActionStart(event: (event?: GestureEvent) => void): PanGesture;
onActionStart(event: (event?: PanGestureEvent) => void): PanGesture;
/**
* Callback when the Pan gesture is moving.
* @devices phone, tablet, car.
* @since 7
*/
onActionUpdate(event: (event?: GestureEvent) => void): PanGesture;
onActionUpdate(event: (event?: PanGestureEvent) => void): PanGesture;
/**
* The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered.
* @devices phone, tablet, car.
* @since 7
*/
onActionEnd(event: (event?: GestureEvent) => void): PanGesture;
onActionEnd(event: (event?: PanGestureEvent) => void): PanGesture;
/**
* The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
* @devices phone, tablet, car.
* @since 7
*/
onActionCancel(event: () => void): PanGesture;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface PinchGesture {
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { fingers?: number, distance?: number }): PinchGesture;
(value?: { fingers?: number; distance?: number }): PinchGesture;
/**
* Pan gesture recognition success callback.
* @devices phone, tablet, car.
* @since 7
*/
onActionStart(event: (event?: GestureEvent) => void): PinchGesture;
onActionStart(event: (event?: PinchGestureEvent) => void): PinchGesture;
/**
* Callback when the Pan gesture is moving.
* @devices phone, tablet, car.
* @since 7
*/
onActionUpdate(event: (event?: GestureEvent) => void): PinchGesture;
onActionUpdate(event: (event?: PinchGestureEvent) => void): PinchGesture;
/**
* The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered.
* @devices phone, tablet, car.
* @since 7
*/
onActionEnd(event: (event?: GestureEvent) => void): PinchGesture;
onActionEnd(event: (event?: PinchGestureEvent) => void): PinchGesture;
/**
* The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
* @devices phone, tablet, car.
* @since 7
*/
onActionCancel(event: () => void): PinchGesture;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface RotationGesture {
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { fingers?: number, angle?: number }): RotationGesture;
(value?: { fingers?: number; angle?: number }): RotationGesture;
/**
* Pan gesture recognition success callback.
* @devices phone, tablet, car.
* @since 7
*/
onActionStart(event: (event?: GestureEvent) => void): RotationGesture;
onActionStart(event: (event?: RotationGestureEvent) => void): RotationGesture;
/**
* Callback when the Pan gesture is moving.
* @devices phone, tablet, car.
* @since 7
*/
onActionUpdate(event: (event?: GestureEvent) => void): RotationGesture;
onActionUpdate(event: (event?: RotationGestureEvent) => void): RotationGesture;
/**
* The Pan gesture is successfully recognized. When the finger is lifted, the callback is triggered.
* @devices phone, tablet, car.
* @since 7
*/
onActionEnd(event: (event?: GestureEvent) => void): RotationGesture;
onActionEnd(event: (event?: RotationGestureEvent) => void): RotationGesture;
/**
* The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
* @devices phone, tablet, car.
* @since 7
*/
onActionCancel(event: () => void): RotationGesture;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface GestureGroup {
/**
* Return to Obtain GestureGroup.
* @devices phone, tablet, car.
* @since 7
*/
(mode: GestureMode, ...gesture: GestureType[]): GestureGroup;
/**
* The Pan gesture is successfully recognized and a callback is triggered when the touch cancel event is received.
* @devices phone, tablet, car.
* @since 7
*/
onCancel(event: () => void): GestureGroup;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const TapGestureInterface: TapGesture;
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const LongPressGestureInterface: LongPressGesture;
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PanGestureInterface: PanGesture;
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PinchGestureInterface: PinchGesture;
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const RotationGestureInterface: RotationGesture;
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const GestureGroupInterface: GestureGroup;

View File

@ -13,101 +13,80 @@
* limitations under the License.
*/
import {CommonMethod, BarState, Color, Resource} from "./common";
import {Scroller} from "./scroll";
import { CommonMethod } from "./common";
import { BarState, Color } from "./enums";
import { Scroller } from "./scroll";
import { Length } from "./units";
/**
* Mesh container for static fixed-size layout scenarios.
* @devices phone, tablet, car.
* @since 7
*/
export declare class GridExtend<T> extends GridAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface Grid extends GridAttribute<Grid> {
/**
* Grid is returned when the parameter is transferred.
* @devices phone, tablet, car.
* @since 7
*/
(scroller?: Scroller): Grid;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class GridAttribute<T> extends CommonMethod<T> {
/**
* This parameter specifies the number of columns in the current grid layout.
* @devices phone, tablet, car.
* @since 7
*/
columnsTemplate(value: string): T;
/**
* Lets you set the number of rows in the current grid layout,
* @devices phone, tablet, car.
* @since 7
*/
rowsTemplate(value: string): T;
/**
* Allows you to set the spacing between columns.
* @devices phone, tablet, car.
* @since 7
*/
columnsGap(value: number | string | Resource): T;
columnsGap(value: Length): T;
/**
* Lets you set the spacing between rows.
* @devices phone, tablet, car.
* @since 7
*/
rowsGap(value: number | string | Resource): T;
rowsGap(value: Length): T;
/**
* This parameter specifies the width of the scroll bar.
* @devices phone, tablet, car.
* @since 7
*/
scrollBarWidth(value: number | string): T;
/**
* Sets the color of the scroll bar.
* @devices phone, tablet, car.
* @since 7
*/
scrollBarColor(value: Color | number | string): T;
/**
* Lets you set the spacing between rows.
* @devices phone, tablet, car.
* @since 7
*/
scrollBar(value: BarState): T;
/**
* Sets the status of the scroll bar.
* @devices phone, tablet, car.
* @since 7
*/
onScrollIndex(event: (first: number) => void): T;
/**
* cached Count
* @devices phone, tablet, car.
* @since 7
*/
cachedCount(value: number): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare class GridExtend<T> extends GridAttribute<T> {}
export declare const GridInterface: Grid;

View File

@ -1,85 +1,66 @@
/*
* 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.
*/
import {CommonMethod} from "./common";
/**
* Mesh container for static fixed-size layout scenarios.
* @devices phone, tablet, car.
* @since 7
*/
export declare class GridItemExtend<T> extends GridItemAttribute<T> {
}
/**
* Mesh container for static fixed-size layout scenarios.
* @devices phone, tablet, car.
* @since 7
*/
interface GridItem extends GridItemAttribute<GridItem> {
/**
* Return to get GridItem.
* @devices phone, tablet, car.
* @since 7
*/
(): GridItem;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class GridItemAttribute<T> extends CommonMethod<T> {
/**
* This parameter specifies the start line number of the current element.
* @devices phone, tablet, car.
* @since 7
*/
rowStart(value: number): T;
/**
* Specifies the end line number of the current element.
* @devices phone, tablet, car.
* @since 7
*/
rowEnd(value: number): T;
/**
* This parameter specifies the start column number of the current element.
* @devices phone, tablet, car.
* @since 7
*/
columnStart(value: number): T;
/**
* This parameter specifies the end column number of the current element.
* @devices phone, tablet, car.
* @since 7
*/
columnEnd(value: number): T;
/**
* This parameter specifies whether to recreate the node when the component build is triggered.
* @devices phone, tablet, car.
* @since 7
*/
forceRebuild(value: boolean): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare const GridItemInterface: GridItem;
/*
* 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.
*/
import { CommonMethod } from "./common";
/**
* Mesh container for static fixed-size layout scenarios.
* @since 7
*/
interface GridItem extends GridItemAttribute<GridItem> {
/**
* Return to get GridItem.
* @since 7
*/
(): GridItem;
}
/**
* @since 7
*/
declare class GridItemAttribute<T> extends CommonMethod<T> {
/**
* This parameter specifies the start line number of the current element.
* @since 7
*/
rowStart(value: number): T;
/**
* Specifies the end line number of the current element.
* @since 7
*/
rowEnd(value: number): T;
/**
* This parameter specifies the start column number of the current element.
* @since 7
*/
columnStart(value: number): T;
/**
* This parameter specifies the end column number of the current element.
* @since 7
*/
columnEnd(value: number): T;
/**
* This parameter specifies whether to recreate the node when the component build is triggered.
* @since 7
*/
forceRebuild(value: boolean): T;
}
export declare class GridItemExtend<T> extends GridItemAttribute<T> {}
export declare const GridItemInterface: GridItem;

View File

@ -13,91 +13,91 @@
* limitations under the License.
*/
import {ColumnAttribute} from "./column";
import { ColumnAttribute } from "./column";
/**
* @devices phone, tablet, car.
* Defines the size type.
* @since 7
*/
export declare enum SizeType {
/**
* Select a value based on the device type.
* @devices phone, tablet, car.
* @since 7
*/
Auto,
/**
* Select a value based on the device type.
* @devices phone, tablet, car.
* @since 7
*/
XS,
/**
* Small width type device.
* @devices phone, tablet, car.
* @since 7
*/
SM,
/**
* Medium width type device.
* @devices phone, tablet, car.
* @since 7
*/
MD,
/**
* Large width type device.
* @devices phone, tablet, car.
* @since 7
*/
LG
LG,
}
/**
* Vertical layout grid layout container, used only in grid layout scenarios.
* @devices phone, tablet, car.
* Defines the option of GridContainer.
* @since 7
*/
export declare class GridContainerExtend<T> extends GridContainerAttribute<T> {
export declare interface GridContainerOption {
/**
* Sets the total number of columns in the current layout.
* @since 7
*/
columns?: number | "auto";
/**
* Select the device width type.
* @since 7
*/
sizeType?: SizeType;
/**
* Grid layout column spacing.
* @since 7
*/
gutter?: number | string;
/**
* Spacing on both sides of the grid layout.
* @since 7
*/
margin?: number | string;
}
/**
* @devices phone, tablet, car.
* Defines the GridContainer component.
* @since 7
*/
interface GridContainer extends GridContainerAttribute<GridContainer> {
/**
* columns: Sets the total number of columns in the current layout.
* sizeType: Select the device width type.
* gutter: Grid layout column spacing.
* margin: Spacing on both sides of the grid layout.
* @devices phone, tablet, car.
* Defines the constructor of GridContainer.
* @since 7
*/
(
value?: {
columns?: number | 'auto',
sizeType?: SizeType,
gutter?: number | string,
margin?: number | string
}
): GridContainer;
(value?: GridContainerOption): GridContainer;
}
/**
* inheritance Column
* @devices phone, tablet, car.
* Defines the grid container attribute from inheritance Column
* @since 7
*/
declare class GridContainerAttribute<T> extends ColumnAttribute<T> {
}
declare class GridContainerAttribute<T> extends ColumnAttribute<T> {}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare const GridContainerInterface: GridContainer;
export declare class GridContainerExtend<T> extends GridContainerAttribute<T> {}
export declare const GridContainerInterface: GridContainer;

View File

@ -13,18 +13,10 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common";
import { CommonMethod } from "./common";
import { Resource, ResourceColor } from "./units";
/**
* Hyperlink component, which gives the scope of subcomponents.
* @devices phone, tablet, car.
* @since 7
*/
export declare class HyperlinkExtend<T> extends HyperlinkAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface Hyperlink extends HyperlinkAttribute<Hyperlink> {
@ -32,7 +24,6 @@ interface Hyperlink extends HyperlinkAttribute<Hyperlink> {
* Return to get Hyperlink.
* adress: Web page redirected by the hyperlink component.
* content: Hyperlinks in the hyperlink component display text.
* @devices phone, tablet, car.
* @since 7
*/
(address: string | Resource, content?: string | Resource): Hyperlink;
@ -40,20 +31,15 @@ interface Hyperlink extends HyperlinkAttribute<Hyperlink> {
/**
* inheritance CommonMethod
* @devices phone, tablet, car.
* @since 7
*/
declare class HyperlinkAttribute<T> extends CommonMethod<T> {
/**
* Set Color
* @devices phone, tablet, car.
* @since 7
*/
color(value: Color | number | string | Resource): T;
color(value: ResourceColor): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare class HyperlinkExtend<T> extends HyperlinkAttribute<T> {}
export declare const HyperlinkInterface: Hyperlink;

View File

@ -13,145 +13,125 @@
* limitations under the License.
*/
import {CommonMethod, Color, ImageRepeat, ImageFit, Resource, PixelMap} from "./common";
import { CommonMethod, PixelMap } from "./common";
import { ImageFit, ImageRepeat } from "./enums";
import { Resource, ResourceColor } from "./units";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ImageRenderMode {
/**
* Render according to the original image, including colors.
* @devices phone, tablet, car.
* @since 7
*/
Original,
/**
* Render the image as a template image, ignoring the color information of the image.
* @devices phone, tablet, car.
* @since 7
*/
Template
Template,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ImageInterpolation {
/**
* Do not use interpolated image data.
* @devices phone, tablet, car.
* @since 7
*/
None,
/**
* Low usage of interpolated image data.
* @devices phone, tablet, car.
* @since 7
*/
Low,
/**
* Interpolated image data is used moderately.
* @devices phone, tablet, car.
* @since 7
*/
Medium,
/**
* High usage of interpolated image data may affect the speed of image rendering.
* @devices phone, tablet, car.
* @since 7
*/
High
High,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ImageExtend<T> extends ImageAttribute<T> {
}
export declare class ImageExtend<T> extends ImageAttribute<T> {}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface Image extends ImageAttribute<Image> {
/**
* Set src to obtain images.
* @devices phone, tablet, car.
* @since 7
*/
(src: string | PixelMap | Resource): Image;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ImageAttribute<T> extends CommonMethod<T> {
/**
* Placeholder displayed on load
* @devices phone, tablet, car.
* @since 7
*/
alt(value: string | Resource): T;
/**match Text Direction
* @devices phone, tablet, car.
* @since 7
*/
matchTextDirection(value: boolean): T;
/**
* Indicates whether the image follows the text direction.
* @devices phone, tablet, car.
* @since 7
*/
fitOriginalSize(value: boolean): T;
/**
* fill Color
* @devices phone, tablet, car.
* @since 7
*/
fillColor(value: Color | number | string | Resource): T;
fillColor(value: ResourceColor): T;
/**
* Sets the zoom type of an image.
* @devices phone, tablet, car.
* @since 7
*/
objectFit(value: ImageFit): T;
/**
* Set the repeat style of the picture
* @devices phone, tablet, car.
* @since 7
*/
objectRepeat(value: ImageRepeat): T;
/**
* Set the auto style of the picture
* @devices phone, tablet, car.
* @since 7
*/
autoResize(value: boolean): T;
/**
* Sets the image rendering mode.
* @devices phone, tablet, car.
* @since 7
*/
renderMode(value: ImageRenderMode): T;
/**
* Sets the interpolation effect of an image. The interpolation effect is only magnified for the image.
* @devices phone, tablet, car.
* @since 7
*/
interpolation(value: ImageInterpolation): T;
@ -159,30 +139,34 @@ declare class ImageAttribute<T> extends CommonMethod<T> {
/**
* Specifies the picture decoding size.
* The original picture is decoded into a picture of a specified size. The unit of the number type is px.
* @devices phone, tablet, car.
* @since 7
*/
sourceSize(value: { width: number, height: number }): T;
sourceSize(value: { width: number; height: number }): T;
/**
* This callback is triggered when an image is successfully loaded.
* The size of the image source that is successfully loaded is returned, in pixels.
* @devices phone, tablet, car.
* @since 7
*/
onComplete(callback: (event?: { width: number, height: number, componentWidth: number, componentHeight: number, loadingStatus: number }) => void): T;
onComplete(
callback: (event?: {
width: number;
height: number;
componentWidth: number;
componentHeight: number;
loadingStatus: number;
}) => void,
): T;
/**
* This callback is triggered when an exception occurs during image loading.
* @devices phone, tablet, car.
* @since 7
*/
onError(callback: (event?: { componentWidth: number, componentHeight: number }) => void): T;
onError(callback: (event?: { componentWidth: number; componentHeight: number }) => void): T;
/**
* When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete.
* If the svg image is a wireless loop image, this callback is not triggered.
* @devices phone, tablet, car.
* @since 7
*/
onFinish(event: () => void): T;

View File

@ -13,25 +13,15 @@
* limitations under the License.
*/
import {CommonMethod, AnimationStatus} from "./common";
import { CommonMethod } from "./common";
import { AnimationStatus } from "./enums";
/**
* The frame animation component is provided to play pictures frame by frame.
* You can configure the list of pictures to be played and configure the duration for each picture.
* @devices phone, tablet, car.
* @since 7
*/
export declare class ImageAnimatorExtend<T> extends ImageAnimatorAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface ImageAnimator extends ImageAnimatorAttribute<ImageAnimator> {
/**
* ImageAimator is returned.
* @devices phone, tablet, car.
* @since 7
*/
(): ImageAnimator;
@ -39,107 +29,96 @@ interface ImageAnimator extends ImageAnimatorAttribute<ImageAnimator> {
/**
* inheritance CommonMethod
* @devices phone, tablet, car.
* @since 7
*/
declare class ImageAnimatorAttribute<T> extends CommonMethod<T> {
/**
* list images
* @devices phone, tablet, car.
* @since 7
*/
images(value: Array<{
src: string, width?: number | string, height?: number | string, top?: number | string, left?:
number | string, duration?: number
}>): T;
images(
value: Array<{
src: string;
width?: number | string;
height?: number | string;
top?: number | string;
left?: number | string;
duration?: number;
}>,
): T;
/**
* The default value is the initial state, which is used to control the playback status.
* @devices phone, tablet, car.
* @since 7
*/
state(value: AnimationStatus): T;
/**
* The unit is millisecond.
* @devices phone, tablet, car.
* @since 7
*/
duration(value: number): T;
/**
* Set the playback sequence.
* @devices phone, tablet, car.
* @since 7
*/
reverse(value: boolean): T;
/**
* Sets whether the image size is fixed to the component size.
* @devices phone, tablet, car.
* @since 7
*/
fixedSize(value: boolean): T;
/**
* Indicates whether to enable pre-decoding.
* @devices phone, tablet, car.
* @since 7
*/
preDecode(value: number): T;
/**
* Sets the state before and after the animation starts
* @devices phone, tablet, car.
* @since 7
*/
fillMode(value: FillMode): T;
/**
* Played once by default
* @devices phone, tablet, car.
* @since 7
*/
iterations(value: number): T;
/**
* Status callback, which is triggered when the animation starts to play.
* @devices phone, tablet, car.
* @since 7
*/
onStart(event: () => void): T;
/**
* Status callback, which is triggered when the animation pauses.
* @devices phone, tablet, car.
* @since 7
*/
onPause(event: () => void): T;
/**
* Status callback, triggered when the animation is replayed
* @devices phone, tablet, car.
* @since 7
*/
onRepeat(event: () => void): T;
/**
* Status callback, which is triggered when the animation is canceled.
* @devices phone, tablet, car.
* @since 7
*/
onCancel(event: () => void): T;
/**
* Status callback, which is triggered when the animation playback is complete.
* @devices phone, tablet, car.
* @since 7
*/
onFinish(event: () => void): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare class ImageAnimatorExtend<T> extends ImageAnimatorAttribute<T> {}
export declare const ImageAnimatorInterface: ImageAnimator;

View File

@ -13,76 +13,74 @@
* limitations under the License.
*/
export * from './ability_component';
export * from './action_sheet';
export * from './alert_dialog';
export * from './alphabet_indexer';
export * from './animator';
export * from './badge';
export * from './blank';
export * from './button';
export * from './calendar';
export * from './camera';
export * from './circle';
export * from './column';
export * from './column_split';
export * from './common';
export * from './counter';
export * from './custom_dialog_controller';
export * from './datePicker';
export * from './divider';
export * from './ellipse';
export * from './flex';
export * from './forEach';
export * from './form_component';
export * from './gauge';
export * from './geometryView';
export * from './gesture';
export * from './grid';
export * from './gridItem';
export * from './grid_container';
export * from './image';
export * from './image_animator';
export * from './lazyForEach';
export * from './line';
export * from './list';
export * from './listItem';
export * from './loadingProgress';
export * from './marquee';
export * from './navigator';
export * from './navigatorView';
export * from './pageTransition';
export * from './panel';
export * from './path';
export * from './piece';
export * from './qrcode';
export * from './rating';
export * from './rect';
export * from './row';
export * from './row_split';
export * from './scroll';
export * from './search';
export * from './shape';
export * from './slider';
export * from './span';
export * from './stack';
export * from './stateManagement';
export * from './swiper';
export * from './tab_content';
export * from './tabs';
export * from './text';
export * from './textarea';
export * from './textinput';
export * from './textPicker';
export * from './toggle';
export * from './video';
export * from './progress';
export * from './polygon';
export * from './polyline';
export * from './radio';
export * from './datapanel';
export * from './hyperlink';
export * from './menu';
export * from './option';
export * from './refresh';
export * from './web';
export * from "./ability_component";
export * from "./alert_dialog";
export * from "./alphabet_indexer";
export * from "./animator";
export * from "./badge";
export * from "./blank";
export * from "./button";
export * from "./calendar";
export * from "./circle";
export * from "./column";
export * from "./column_split";
export * from "./common";
export * from "./counter";
export * from "./custom_dialog_controller";
export * from "./data_panel";
export * from "./date_picker";
export * from "./divider";
export * from "./ellipse";
export * from "./enums";
export * from "./flex";
export * from "./forEach";
export * from "./form_component";
export * from "./gauge";
export * from "./geometry_view";
export * from "./gesture";
export * from "./grid";
export * from "./gridItem";
export * from "./grid_container";
export * from "./hyperlink";
export * from "./image";
export * from "./image_animator";
export * from "./lazyForEach";
export * from "./line";
export * from "./list";
export * from "./listItem";
export * from "./loading_progress";
export * from "./marquee";
export * from "./navigation";
export * from "./navigator";
export * from "./pageTransition";
export * from "./panel";
export * from "./path";
export * from "./piece";
export * from "./polygon";
export * from "./polyline";
export * from "./progress";
export * from "./qrcode";
export * from "./radio";
export * from "./rating";
export * from "./rect";
export * from "./refresh";
export * from "./row";
export * from "./row_split";
export * from "./scroll";
export * from "./search";
export * from "./shape";
export * from "./slider";
export * from "./span";
export * from "./stack";
export * from "./stateManagement";
export * from "./swiper";
export * from "./tabs";
export * from "./tab_content";
export * from "./text";
export * from "./text_area";
export * from "./text_input";
export * from "./text_picker";
export * from "./toggle";
export * from "./units";
export * from "./video";
export * from "./web";

View File

@ -15,14 +15,12 @@
/**
* Get inspector node infos.
* @devices phone, tablet, car.
* @since 7
*/
declare function getInspectorNodes(): object;
/**
* Get inspector node info by node id.
* @devices phone, tablet, car.
* @since 7
*/
declare function getInspectorNodeById(id: number): object;
declare function getInspectorNodeById(id: number): object;

View File

@ -15,77 +15,65 @@
/**
* Data Change Listener.
* @devices phone, tablet, car.
* @since 7
*/
export declare interface DataChangeListener {
/**
* Data ready.
* @devices phone, tablet, car.
* @since 7
*/
onDataReloaded(): void;
/**
* Data added.
* @devices phone, tablet, car.
* @since 7
*/
onDataAdded(index: number): void;
/**
* Data moved.
* @devices phone, tablet, car.
* @since 7
*/
onDataMoved(from: number, to: number): void;
/**
* Data deleted.
* @devices phone, tablet, car.
* @since 7
*/
onDataDeleted(index:number): void;
onDataDeleted(index: number): void;
/**
* Data changed.
* @devices phone, tablet, car.
* @since 7
*/
onDataChanged(index:number): void;
onDataChanged(index: number): void;
}
/**
* Data changed.
* @devices phone, tablet, car.
* @since 7
*/
export declare interface IDataSource {
/**
* Total count.
* @devices phone, tablet, car.
* @since 7
*/
totalCount(): number;
/**
* get data.
* @devices phone, tablet, car.
* @since 7
*/
getData(index: number): any;
/**
* register Data Change Listener
* @devices phone, tablet, car.
* @since 7
*/
registerDataChangeListener(listener: DataChangeListener): void;
/**
* unregister Data Change Listener
* @devices phone, tablet, car.
* @since 7
*/
unregisterDataChangeListener(listener: DataChangeListener): void;
@ -93,21 +81,21 @@ export declare interface IDataSource {
/**
* Lazy loading.
* @devices phone, tablet, car.
* @since 7
*/
interface LazyForEach {
/**
* Enter the value to obtain the LazyForEach.
* @devices phone, tablet, car.
* @since 7
*/
(dataSource: IDataSource, itemGenerator: (item: any, index?: number) => void,
keyGenerator?: (item: any, index?: number) => string): LazyForEach;
(
dataSource: IDataSource,
itemGenerator: (item: any, index?: number) => void,
keyGenerator?: (item: any, index?: number) => string,
): LazyForEach;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const LazyForEachInterface: LazyForEach;

View File

@ -1,74 +1,57 @@
/*
* 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.
*/
import {CommonShapeMethod} from "./common";
/**
* Line drawing component.
* @devices phone, tablet, car.
* @since 7
*/
export declare class LineExtend<T> extends LineAttribute<T> {
}
/**
* Line drawing component.
* @devices phone, tablet, car.
* @since 7
*/
interface Line extends LineAttribute<Line> {
/**
* Returns the line.
* height: Height of the rectangle where the line resides.
* @devices phone, tablet, car.
* @since 7
*/
(): Line;
/**
* The return value of the parameter is Line.
* width: Width of the rectangle where the line resides..
* height: Height of the rectangle where the line resides.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: string | number, height?: string | number }) :Line;
}
/**
* inheritance CommonShapeMethod.
* @devices phone, tablet, car.
* @since 7
*/
declare class LineAttribute<T> extends CommonShapeMethod<T> {
/**
* Coordinate of the start point of the line (relative coordinate).
* @devices phone, tablet, car.
* @since 7
*/
startPoint(value: Array<any>): T;
/**
* Line end coordinates (relative coordinates).
* @devices phone, tablet, car.
* @since 7
*/
endPoint(value: Array<any>): T;
}
/**
* @devices phone, tablet, car
* @since 7
*/
export declare const LineInterface: Line;
/*
* 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.
*/
import { CommonShapeMethod } from "./common";
/**
* Line drawing component.
* @since 7
*/
interface Line extends LineAttribute<Line> {
/**
* Returns the line.
* height: Height of the rectangle where the line resides.
* @since 7
*/
(): Line;
/**
* The return value of the parameter is Line.
* width: Width of the rectangle where the line resides..
* height: Height of the rectangle where the line resides.
* @since 7
*/
(value?: { width?: string | number; height?: string | number }): Line;
}
/**
* inheritance CommonShapeMethod.
* @since 7
*/
declare class LineAttribute<T> extends CommonShapeMethod<T> {
/**
* Coordinate of the start point of the line (relative coordinate).
* @since 7
*/
startPoint(value: Array<any>): T;
/**
* Line end coordinates (relative coordinates).
* @since 7
*/
endPoint(value: Array<any>): T;
}
export declare class LineExtend<T> extends LineAttribute<T> {}
export declare const LineInterface: Line;

View File

@ -13,167 +13,149 @@
* limitations under the License.
*/
import {CommonMethod, Axis, Color, Resource, BarState, EdgeEffect} from "./common";
import {Scroller} from "./scroll";
import { CommonMethod } from "./common";
import { Axis, BarState, EdgeEffect } from "./enums";
import { Scroller } from "./scroll";
import { Length, ResourceColor } from "./units";
/**
* Declare scroll status
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ScrollState {
/**
* Not activated.
* @devices phone, tablet, car.
* @since 7
*/
Idle,
/**
* Scrolling status.
* @devices phone, tablet, car.
* @since 7
*/
Scroll,
/**
* Drag status.
* @devices phone, tablet, car.
* @since 7
*/
Fling
Fling,
}
/**
* ListExtend extension declaration.
* @devices phone, tablet, car.
* @since 7
*/
export declare class ListExtend<T> extends ListAttribute<T> {
}
export declare class ListExtend<T> extends ListAttribute<T> {}
/**
* The list interface is extended.
* @devices phone, tablet, car.
* @since 7
*/
interface List extends ListAttribute<List> {
/**
* Called when interface data is called.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { initialIndex?: number, space?: number | string, scroller?: Scroller }): List;
(value?: { initialIndex?: number; space?: number | string; scroller?: Scroller }): List;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ListAttribute<T> extends CommonMethod<T> {
/**
* Called when the arrangement direction of the list component is set.
* @devices phone, tablet, car.
* @since 7
*/
listDirection(value: Axis): T;
/**
* Called when the display mode of the side slider is set.
* @devices phone, tablet, car.
* @since 7
*/
scrollBar(value: BarState): T;
/**
* Called when the sliding effect is set.
* @devices phone, tablet, car.
* @since 7
*/
edgeEffect(value: EdgeEffect): T;
/**
* Called when the ListItem split line style is set.
* @devices phone, tablet, car.
* @since 7
*/
divider(value: {
strokeWidth: number | string | Resource, color?: Color | number | string | Resource,
startMargin?: number | string | Resource, endMargin?: number | string | Resource
} | null): T;
divider(
value: {
strokeWidth: Length;
color?: ResourceColor;
startMargin?: Length;
endMargin?: Length;
} | null,
): T;
/**
* Called when judging whether it is in editable mode.
* @devices phone, tablet, car.
* @since 7
*/
editMode(value: boolean): T;
/**
* Called when the minimum number of list item caches is set for long list deferred loading.
* @devices phone, tablet, car.
* @since 7
*/
cachedCount(value: number): T;
/**
* Called when setting whether to enable chain linkage dynamic effect.
* @devices phone, tablet, car.
*/
chainAnimation(value: boolean): T;
/**
* Called when the offset and status callback of the slide are set.
* @devices phone, tablet, car.
* @since 7
*/
onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): T;
/**
* Called when the start and end positions of the display change.
* @devices phone, tablet, car.
* @since 7
*/
onScrollIndex(event: (start: number, end: number) => void): T;
/**
* Called when the list begins to arrive.
* @devices phone, tablet, car.
* @since 7
*/
onReachStart(event: () => void): T;
/**
* Called when the list reaches the end.
* @devices phone, tablet, car.
* @since 7
*/
onReachEnd(event: () => void): T;
/**
* Called when the slider stops.
* @devices phone, tablet, car.
* @since 7
*/
onScrollStop(event: () => void): T;
/**
* Called when a list item is deleted.
* @devices phone, tablet, car.
* @since 7
*/
onItemDelete(event: (index: number) => boolean): T;
/**
* Called when a list item is moved.
* @devices phone, tablet, car.
* @since 7
*/
onItemMove(event: (from: number, to: number) => boolean): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const ListInterface: List;

View File

@ -13,31 +13,27 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Declare item ceiling attribute.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum Sticky {
/**
* No sticky.
* @devices phone, tablet, car.
* @since 7
*/
None,
/**
* Normal mode
* @devices phone, tablet, car.
* @since 7
*/
Normal,
/**
* Set opacity.
* @devices phone, tablet, car.
* @since 7
*/
Opacity,
@ -51,69 +47,58 @@ export declare enum Sticky {
export declare enum EditMode {
/**
* Unrestricted operations.
* @devices phone, tablet, car.
* @since 7
*/
None,
/**
* Deleteable.
* @devices phone, tablet, car.
* @since 7
*/
Deletable,
/**
* Movable.
* @devices phone, tablet, car.
* @since 7
*/
Movable,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ListItemExtend<T> extends ListItemAttribute<T> {
}
export declare class ListItemExtend<T> extends ListItemAttribute<T> {}
/**
* Values in the list
* @devices phone, tablet, car.
* @since 7
*/
interface ListItem extends ListItemAttribute<ListItem> {
/**
* Called when an interface is used.
* @devices phone, tablet, car.
* @since 7
*/
(value?: string): ListItem;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ListItemAttribute<T> extends CommonMethod<T> {
/**
* Called when setting whether item is ceiling effect.
* @devices phone, tablet, car.
* @since 7
*/
sticky(value: Sticky): T;
/**
* Called when judging whether it is editable.
* @devices phone, tablet, car.
* @since 7
*/
editable(value: boolean | EditMode): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const ListItemInterface: ListItem;

View File

@ -13,74 +13,64 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common";
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* Load style of progress bar.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
export declare enum LoadingProgressStyle{
export declare enum LoadingProgressStyle {
/**
* Default style.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Default,
/**
* Announcement style.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Circular,
/**
* The style of the track.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Orbital,
}
/**
* Loading Progress Extensions on Declarative Classes
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
export declare class LoadingProgressExtend<T> extends LoadingProgressAttribute<T> {
}
export declare class LoadingProgressExtend<T> extends LoadingProgressAttribute<T> {}
/**
* Provides an interface for extending the loading progress.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface LoadingProgress extends LoadingProgressAttribute<LoadingProgress> {
/**
* Called when the progress bar progress is viewed.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(): LoadingProgress;
}
/**
* Declare the progress bar being loaded
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
declare class LoadingProgressAttribute<T> extends CommonMethod<T> {
/**
* Load the color of the progress bar.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
color(value: Color | Resource): T;
color(value: ResourceColor): T;
}
/**
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
export declare const LoadingProgressInterface: LoadingProgress;

View File

@ -1,107 +1,87 @@
/*
* 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.
*/
import {CommonMethod, Color, Resource} from "./common";
import {FontWeight} from "./text";
/**
* @devices phone, tablet
* @since 5
*/
export declare class MarqueeExtend<T> extends MarqueeAttribute<T> {
}
/**
* Provides the interface for the marquee attributes.
* @devices phone, tablet
* @since 5
*/
interface Marquee extends MarqueeAttribute<Marquee> {
/**
* Create marquee.
* @devices phone, tablet
* @since 5
*/
(value: {start: boolean, step?: number, loop?: number, fromStart?: boolean, src: string}): Marquee;
}
/**
* Declares marquee properties.
* @devices phone, tablet
* @since 5
*/
declare class MarqueeAttribute<T> extends CommonMethod<T> {
/**
* Set marquee font Color.
* @devices phone, tablet
* @since 5
*/
fontColor(value: Color | number | string | Resource): T;
/**
* Set marquee font size.
* @devices phone, tablet
* @since 5
*/
fontSize(value: number | string | Resource): T;
/**
* Set marquee allow scale.
* @devices phone, tablet
* @since 5
*/
allowScale(value: boolean): T;
/**
* Set marquee font weight.
* @devices phone, tablet
* @since 5
*/
fontWeight(value: number | FontWeight | string): T;
/**
* Set marquee font family.
* @devices phone, tablet
* @since 5
*/
fontFamily(value: string | Resource): T;
/**
* Called when scrolling starts.
* @devices phone, tablet
* @since 5
*/
onStart(event: () => void): T;
/**
* Called when scrolling to the bottom.
* @devices phone, tablet
* @since 5
*/
onBounce(event: () => void): T;
/**
* Called when scrolling is complete.
* @devices phone, tablet
* @since 5
*/
onFinish(event: () => void): T;
}
/**
* @devices phone, tablet
* @since 5
*/
export declare const MarqueeInterface: Marquee;
/*
* 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.
*/
import { CommonMethod } from "./common";
import { FontWeight } from "./enums";
import { Length, Resource, ResourceColor } from "./units";
/**
* Provides the interface for the marquee attributes.
* @since 8
*/
interface Marquee extends MarqueeAttribute<Marquee> {
/**
* Create marquee.
* @since 8
*/
(value: { start: boolean; step?: number; loop?: number; fromStart?: boolean; src: string }): Marquee;
}
/**
* Declares marquee properties.
* @since 8
*/
declare class MarqueeAttribute<T> extends CommonMethod<T> {
/**
* Set marquee font Color.
* @since 8
*/
fontColor(value: ResourceColor): T;
/**
* Set marquee font size.
* @since 8
*/
fontSize(value: Length): T;
/**
* Set marquee allow scale.
* @since 8
*/
allowScale(value: boolean): T;
/**
* Set marquee font weight.
* @since 8
*/
fontWeight(value: number | FontWeight | string): T;
/**
* Set marquee font family.
* @since 8
*/
fontFamily(value: string | Resource): T;
/**
* Called when scrolling starts.
* @since 8
*/
onStart(event: () => void): T;
/**
* Called when scrolling to the bottom.
* @since 8
*/
onBounce(event: () => void): T;
/**
* Called when scrolling is complete.
* @since 8
*/
onFinish(event: () => void): T;
}
export declare class MarqueeExtend<T> extends MarqueeAttribute<T> {}
export declare const MarqueeInterface: Marquee;

View File

@ -1,87 +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.
*/
import { CommonMethod, Resource } from "./common";
/**
* Method of displaying menu.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum MenuType {
/**
* Shows when clicked.
* @devices phone, tablet, car.
* @since 7
*/
Click,
/**
* Long-time display.
* @devices phone, tablet, car.
* @since 7
*/
LongPress
}
/**
* Make a statement about the menu display.
* @devices phone, tablet, car.
* @since 7
*/
export declare class MenuExtend<T> extends MenuAttribute<T> {
}
/**
* Provides an interface for displaying menus.
* @devices phone, tablet, car.
* @since 7
*/
interface Menu extends MenuAttribute<Menu> {
/**
* Called when an option is displayed for a menu.
* @devices phone, tablet, car.
* @since 7
*/
(options?: { type?: MenuType, title?: string | Resource }): Menu;
}
/**
* Method for declaring menu options.
* @devices phone, tablet, car.
* @since 7
*/
declare class MenuAttribute<T> extends CommonMethod<T> {
/**
* Called when the menu is displayed..
* @devices phone, tablet, car.
* @since 7
*/
show(value: boolean): T;
/**
* Called when the display position is set.
* @devices phone, tablet, car.
* @since 7
*/
showPosition(options: {x: number, y: number}): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const MenuInterface: Menu;

View File

@ -13,40 +13,25 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
/**
* Show routing content.
* @devices phone, tablet, car.
* @since 7
*/
export declare class NavigationViewExtend<T> extends NavigationViewAttribute<T> {
}
import { CommonMethod } from "./common";
/**
* Provide navigator view interface
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface NavigationView extends NavigationViewAttribute<NavigationView> {
interface Navigation extends NavigationAttribute<Navigation> {
/**
* Called when the navigator view interface is used.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(): NavigationView;
(): Navigation;
}
/**
* Declare Navigation view properties.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
declare class NavigationViewAttribute<T> extends CommonMethod<T> {
}
declare class NavigationAttribute<T> extends CommonMethod<T> {}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const NavigationViewInterface: NavigationView;
export declare class NavigationExtend<T> extends NavigationAttribute<T> {}
export declare const NavigationInterface: Navigation;

View File

@ -13,62 +13,45 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Route jump.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum NavigationType {
/**
* Jump to the next page.
* @devices phone, tablet, car.
* @since 7
*/
Push,
/**
* Return to the previous page.
* @devices phone, tablet, car.
* @since 7
*/
Back,
/**
* Replace page.
* @devices phone, tablet, car.
* @since 7
*/
Replace
}
/**
* Declare navigator extensions.
* @devices phone, tablet, car.
* @since 7
*/
export declare class NavigatorExtend<T> extends NavigatorAttribute<T> {
Replace,
}
/**
* Create route
* @devices phone, tablet, car.
* @since 7
*/
interface Navigator extends NavigatorAttribute<Navigator> {
/**
* Called when the route jumps.
* @devices phone, tablet, car.
* @since 7
*/
(value?: {
target: string,
type?: NavigationType }): Navigator;
(value?: { target: string; type?: NavigationType }): Navigator;
/**
* Called when using the navigator.
* @devices phone, tablet, car.
* @since 7
*/
(): Navigator;
@ -76,41 +59,33 @@ interface Navigator extends NavigatorAttribute<Navigator> {
/**
* Declare navigator properties.
* @devices phone, tablet, car.
* @since 7
*/
declare class NavigatorAttribute<T> extends CommonMethod<T> {
/**
* Called when determining whether the routing component is active.
* @devices phone, tablet, car.
* @since 7
*/
active(value: boolean): T;
/**
* Called when determining whether the routing component is active.
* @devices phone, tablet, car.
* @since 7
*/
type(value: NavigationType): T;
/**
* Called when the path to the specified jump target page is set.
* @devices phone, tablet, car.
* @since 7
*/
target(value: string): T;
/**
* Called when data is passed to the target page at the same time during jump.
* @devices phone, tablet, car.
* @since 7
*/
params(value: object): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class NavigatorExtend<T> extends NavigatorAttribute<T> {}
export declare const NavigatorInterface: Navigator;

View File

@ -1,52 +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.
*/
import { CommonMethod, Resource } from "./common";
/**
* Display items.
* @devices phone, tablet, car.
* @since 7
*/
export declare class OptionExtend<T> extends OptionAttribute<T> {
}
/**
* Provides the interface for displaying the content.
* @devices phone, tablet, car.
* @since 7
*/
interface Option extends OptionAttribute<Option> {
/**
* Called when the content needs to be displayed.
* @devices phone, tablet, car.
* @since 7
*/
(content?: string | Resource): Option;
}
/**
* Declare option properties.
* @devices phone, tablet, car.
* @since 7
*/
declare class OptionAttribute<T> extends CommonMethod<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const OptionInterface: Option;

View File

@ -13,105 +13,90 @@
* limitations under the License.
*/
import {Curve} from "./common";
import { Curve } from "./enums";
/**
* Declare the jump method.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum RouteType {
/**
* The page is not redirected.
* @devices phone, tablet, car.
* @since 7
*/
None,
/**
* Go to the next page.
* @devices phone, tablet, car.
* @since 7
*/
Push,
/**
* Redirect to a specified page.
* @devices phone, tablet, car.
* @since 7
*/
Pop
Pop,
}
/**
* Declare the sliding effect of transition.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum SlideEffect {
/**
* Swipe left.
* @devices phone, tablet, car.
* @since 7
*/
Left,
/**
* Swipe right.
* @devices phone, tablet, car.
* @since 7
*/
Right,
/**
* Swipe top.
* @devices phone, tablet, car.
* @since 7
*/
Top,
/**
* Swipe bottom.
* @devices phone, tablet, car.
* @since 7
*/
Bottom
Bottom,
}
/**
* Provides interfaces for common transitions.
* @devices phone, tablet, car.
* @since 7
*/
export declare class CommonTransition<T> {
/**
* Called when a transition method is required.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* Called when the slide in effect of the transition is set.
* @devices phone, tablet, car.
* @since 7
*/
slide(value: SlideEffect): T;
/**
* Called when the translation effect of page transition is set.
* @devices phone, tablet, car.
* @since 7
*/
translate(value: { x?: number | string, y?: number | string, z?: number | string }): T;
translate(value: { x?: number | string; y?: number | string; z?: number | string }): T;
/**
* Called when setting the zoom effect of page transition.
* @devices phone, tablet, car.
* @since 7
*/
scale(value: { x?: number, y?: number, z?: number, centerX?: number | string, centerY?: number | string }): T;
scale(value: { x?: number; y?: number; z?: number; centerX?: number | string; centerY?: number | string }): T;
/**
* Called when the transparency value of the starting point of entry or the ending point of exit is set.
* @devices phone, tablet, car.
* @since 7
*/
opacity(value: number): T;
@ -119,20 +104,17 @@ export declare class CommonTransition<T> {
/**
* Provides an interface for page rotation mode.
* @devices phone, tablet, car.
* @since 7
*/
interface PageTransitionEnter extends CommonTransition<PageTransitionEnter> {
/**
* Called when page Jump animation is used.
* @devices phone, tablet, car.
* @since 7
*/
(value: { type?: RouteType, duration?: number, curve?: Curve | string, delay?: number }): PageTransitionEnter;
(value: { type?: RouteType; duration?: number; curve?: Curve | string; delay?: number }): PageTransitionEnter;
/**
* Called when the incoming parameter is the normalized progress of the current incoming animation.
* @devices phone, tablet, car.
* @since 7
*/
onEnter(event: (type?: RouteType, progress?: number) => void): PageTransitionEnter;
@ -140,39 +122,21 @@ interface PageTransitionEnter extends CommonTransition<PageTransitionEnter> {
/**
* Provide an interface to exit the transition.
* @devices phone, tablet, car.
* @since 7
*/
interface PageTransitionExit extends CommonTransition<PageTransitionExit> {
/**
* Called when the transition is delayed.
* @devices phone, tablet, car.
* @since 7
*/
(value: {
type?: RouteType,
duration?: number,
curve?: Curve | string,
delay?: number }): PageTransitionExit;
(value: { type?: RouteType; duration?: number; curve?: Curve | string; delay?: number }): PageTransitionExit;
/**
* Called when the input parameter is the normalized progress of the current exit animation.
* @devices phone, tablet, car.
* @since 7
*/
onExit(event: (
type?: RouteType,
progress?: number) => void): PageTransitionExit;
onExit(event: (type?: RouteType, progress?: number) => void): PageTransitionExit;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PageTransitionEnterInterface: PageTransitionEnter;
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PageTransitionExitInterface: PageTransitionExit;
export declare const PageTransitionExitInterface: PageTransitionExit;

View File

@ -13,45 +13,39 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Sets the initial state of the slidable panel.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum PanelMode {
/**
* Minimum state.
* @devices phone, tablet, car.
* @since 7
*/
Mini,
/**
* SHalf-screen-like status
* @devices phone, tablet, car.
* @since 7
*/
Half,
/**
* Class Full Screen Status.
* @devices phone, tablet, car.
* @since 7
*/
Full
Full,
}
/**
* Sets the type of sliding panel.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum PanelType {
/**
* The switch between the minibar and full-screen display is provided.
* @devices phone, tablet, car.
* @since 7
*/
Minibar,
@ -59,7 +53,6 @@ export declare enum PanelType {
/**
* Permanent content display class.
* The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small.
* @devices phone, tablet, car.
* @since 7
*/
Foldable,
@ -67,118 +60,95 @@ export declare enum PanelType {
/**
* Temporary content display area.
* The switchover effect is provided in three sizes: large (full-screen), medium (half-screen), and small.
* @devices phone, tablet, car.
* @since 7
*/
Temporary
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class PanelExtend<T> extends PanelAttribute<T> {
Temporary,
}
/**
* Provides a sliding panel interface.
* @devices phone, tablet, car.
* @since 7
*/
interface Panel extends PanelAttribute<Panel> {
/**
* Called when the panel slidable panel pops up.
* @devices phone, tablet, car.
* @since 7
*/
(show: boolean): Panel;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class PanelAttribute<T> extends CommonMethod<T> {
/**
* Called when the initial state of the slidable panel is set.
* @devices phone, tablet, car.
* @since 7
*/
mode(value: PanelMode): T;
/**
* Called when the slidable panel type is set.
* @devices phone, tablet, car.
* @since 7
*/
type(value: PanelType): T;
/**
* Called when determining whether dragbar exists.
* @devices phone, tablet, car.
* @since 7
*/
dragBar(value: boolean): T;
/**
* Called when the height in the full state is specified.
* @devices phone, tablet, car.
* @since 7
*/
fullHeight(value: number | string): T;
/**
* Called when the height in the half state is specified.
* @devices phone, tablet, car.
* @since 7
*/
halfHeight(value: number | string): T;
/**
* Called when the height in the mini state is specified.
* @devices phone, tablet, car.
* @since 7
*/
miniHeight(value: number | string): T;
/**
* Called when the panel slidable panel pops up.
* @devices phone, tablet, car.
* @since 7
*/
show(value: boolean): T;
/**
* Called when the state of the slidable panel changes.
* @devices phone, tablet, car.
* @since 7
*/
onChange(event: (
onChange(
event: (
/**
* Width of content area.
* @since 7
*/
width: number,
/**
* Width of content area.
* @devices phone, tablet, car.
* @since 7
*/
width: number,
/**
* Height of content area.
* @since 7
*/
height: number,
/**
* Height of content area.
* @devices phone, tablet, car.
* @since 7
*/
height: number,
/**
* Initial state.
* @devices phone, tablet, car.
* @since 7
*/
mode: PanelMode) => void): T;
/**
* Initial state.
* @since 7
*/
mode: PanelMode,
) => void,
): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class PanelExtend<T> extends PanelAttribute<T> {}
export declare const PanelInterface: Panel;

View File

@ -13,52 +13,30 @@
* limitations under the License.
*/
import {CommonShapeMethod} from "./common";
/**
* Path drawing.
* @devices phone, tablet, car.
* @since 7
*/
export declare class PathExtend<T> extends PathAttribute<T> {
}
import { CommonShapeMethod } from "./common";
/**
* Provides the path drawing interface.
* @devices phone, tablet, car.
* @since 7
*/
interface Path extends PathAttribute<Path> {
/**
* Called when drawing with a new path.
* @devices phone, tablet, car.
* @since 7
*/
new (value?: { width?: number | string, height?: number | string, commands?: string }): Path;
/**
* Called when drawing path.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: number | string, height?: number | string, commands?: string }): Path;
(value?: { width?: number | string; height?: number | string; commands?: string }): Path;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class PathAttribute<T> extends CommonShapeMethod<T> {
/**
* Called when the command string drawn by the path is set.
* @devices phone, tablet, car.
* @since 7
*/
commands(value: string): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class PathExtend<T> extends PathAttribute<T> {}
export declare const PathInterface: Path;

View File

@ -1,75 +1,59 @@
/*
* 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.
*/
* 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.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
*Sets the relative position of icons and text.
* @devices phone, tablet, car.
* @since 7
* Sets the relative position of icons and text.
* @since 8
*/
export declare enum IconPosition {
/**
* The icon is at the beginning of the text.
* @devices phone, tablet, car.
* @since 7
*/
* The icon is at the beginning of the text.
* @devices phone, tablet, car.
* @since 8
*/
Start,
/**
* The icon is at the end of the text.
* @devices phone, tablet, car.
* @since 7
*/
End
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class PieceExtend<T> extends PieceAttribute<T> {
* The icon is at the end of the text.
* @devices phone, tablet, car.
* @since 8
*/
End,
}
/**
* Provides text and icons for setting block entries.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface Piece extends PieceAttribute<Piece> {
/**
* Called when setting the position of a block entry.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(options?: {content: string,icon?: string}): Piece;
(options?: { content: string; icon?: string }): Piece;
}
declare class PieceAttribute<T> extends CommonMethod<T> {
/**
* Called when the relative position of the icon and the text is set.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
iconPosition(value: IconPosition): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PieceInterface: Piece;
export declare class PieceExtend<T> extends PieceAttribute<T> {}
export declare const PieceInterface: Piece;

View File

@ -1,60 +1,48 @@
/*
* 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.
*/
import {CommonShapeMethod} from "./common";
/**
* Polygon drawing.
* @devices phone, tablet, car.
* @since 7
*/
export declare class PolygonExtend<T> extends PolygonAttribute<T> {
}
/**
* Provides the polygon drawing interface.
* @devices phone, tablet, car.
* @since 7
*/
interface Polygon extends PolygonAttribute<Polygon> {
/**
* Called when the draw polygon interface is used.
* @devices phone, tablet, car.
* @since 7
*/
(): Polygon;
/**
* Called when drawing a polygon.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: string | number, height?: string | number }): Polygon;
}
declare class PolygonAttribute<T> extends CommonShapeMethod<T> {
/**
* Called when the vertex coordinate list of a polygon is set.
* @devices phone, tablet, car.
* @since 7
*/
points(value: Array<any>): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PolygonInterface: Polygon;
/*
* 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.
*/
import { CommonShapeMethod } from "./common";
/**
* Provides the polygon drawing interface.
* @since 7
*/
interface Polygon extends PolygonAttribute<Polygon> {
/**
* Called when the draw polygon interface is used.
* @devices phone, tablet, car.
* @since 7
*/
(): Polygon;
/**
* Called when drawing a polygon.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: string | number; height?: string | number }): Polygon;
}
declare class PolygonAttribute<T> extends CommonShapeMethod<T> {
/**
* Called when the vertex coordinate list of a polygon is set.
* @devices phone, tablet, car.
* @since 7
*/
points(value: Array<any>): T;
}
export declare class PolygonExtend<T> extends PolygonAttribute<T> {}
export declare const PolygonInterface: Polygon;

View File

@ -1,64 +1,48 @@
/*
* 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.
*/
import {CommonShapeMethod} from "./common";
/**
* Discounted drawing.
* @devices phone, tablet, car.
* @since 7
*/
export declare class PolylineExtend<T> extends PolylineAttribute<T> {
}
/**
* Provides an interface for drawing polylines.
* @devices phone, tablet, car.
* @since 7
*/
interface Polyline extends PolylineAttribute<Polyline> {
/**
* Called when using the draw polyline interface.
* @devices phone, tablet, car.
* @since 7
*/
(): Polyline;
/**
* Called when using the draw fold.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { width?: string | number, height?: string | number }): Polyline;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class PolylineAttribute<T> extends CommonShapeMethod<T> {
/**
* Called when the polyline is set to pass through the coordinate point list.
* @devices phone, tablet, car.
* @since 7
*/
points(value: Array<any>): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const PolylineInterface: Polyline;
/*
* 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.
*/
import { CommonShapeMethod } from "./common";
/**
* Provides an interface for drawing polylines.
* @since 7
*/
interface Polyline extends PolylineAttribute<Polyline> {
/**
* Called when using the draw polyline interface.
* @since 7
*/
(): Polyline;
/**
* Called when using the draw fold.
* @since 7
*/
(value?: { width?: string | number; height?: string | number }): Polyline;
}
/**
* @since 7
*/
declare class PolylineAttribute<T> extends CommonShapeMethod<T> {
/**
* Called when the polyline is set to pass through the coordinate point list.
* @since 7
*/
points(value: Array<any>): T;
}
export declare class PolylineExtend<T> extends PolylineAttribute<T> {}
export declare const PolylineInterface: Polyline;

View File

@ -1,113 +1,82 @@
/*
* 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.
*/
* 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.
*/
import {CommonMethod, Color, Resource} from "./common";
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* Type of progress bar
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ProgressStyle {
/**
* Linear progress bar style.
* @devices phone, tablet, car.
* @since 7
*/
Linear,
/**
* Linear progress bar style.
* @devices phone, tablet, car.
* @since 7
*/
Linear,
/**
* Capsule progress bar style.
* @devices phone, tablet, car.
* @since 7
*/
Capsule,
/**
* Circular progress bar.
* @devices phone, tablet, car.
* @since 7
*/
Eclipse,
/**
* Ring progress bar.
* @devices phone, tablet, car.
* @since 7
*/
Circular,
}
/**
* Make a statement on the progress bar.
* @devices phone, tablet, car.
* @since 7
*/
export declare class ProgressExtend<T> extends ProgressAttribute<T> {
/**
* Circular progress bar.
* @devices phone, tablet, car.
* @since 7
*/
Eclipse,
}
/**
* Provides the progress bar interface.
* @devices phone, tablet, car.
* @since 7
*/
interface Progress extends ProgressAttribute<Progress> {
/**
* Called when the progress bar is set.
* @devices phone, tablet, car.
* @since 7
*/
(object: {value: number,total?: number,style?: ProgressStyle }): Progress;
(object: { value: number; total?: number; style?: ProgressStyle }): Progress;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ProgressAttribute<T> extends CommonMethod<T> {
/**
* Called when the current progress value is set.
* @devices phone, tablet, car.
* @since 7
*/
value(value: number): T;
/**
* Called when the progress bar foreground is set.
* @devices phone, tablet, car.
* @since 7
*/
color(value: Color | number | string | Resource): T;
color(value: ResourceColor): T;
/**
* Called when the style of the circular progress bar is set.
* @devices phone, tablet, car.
* @since 7
* @deprecated since 7
*/
circularStyle(value: { strokeWidth?: number, scaleCount?: number, scaleWidth?: number }): T;
circularStyle(value: { strokeWidth?: number; scaleCount?: number; scaleWidth?: number }): T;
/**
/**
* Called when the style of the cricular progress bar is set.
* @devices phone, tablet, car.
* @since 7
*/
cricularStyle(value: { strokeWidth?: number, scaleCount?: number, scaleWidth?: number }): T;
cricularStyle(value: { strokeWidth?: number; scaleCount?: number; scaleWidth?: number }): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const ProgressInterface: Progress;
export declare class ProgressExtend<T> extends ProgressAttribute<T> {}
export declare const ProgressInterface: Progress;

View File

@ -13,53 +13,37 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common";
/**
* QR code information
* @devices phone, tablet, car.
* @since 7
*/
export declare class QRCodeExtend<T> extends QRCodeAttribute<T> {
}
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* Provides an interface for generating QR codes.
* @devices phone, tablet, car.
* @since 7
*/
interface QRCode extends QRCodeAttribute<QRCode> {
/**
* Called when a QR code is set.
* @devices phone, tablet, car.
* @since 7
*/
(
value: string): QRCode;
(value: string): QRCode;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class QRCodeAttribute<T> extends CommonMethod<T> {
/**
* Called when the QR code color is set.
* @devices phone, tablet, car.
* @since 7
*/
color(value: Color | number | string | Resource): T;
color(value: ResourceColor): T;
/**
* Called when setting the QR code background color.
* @devices phone, tablet, car.
* @since 7
*/
backgroundColor(value: Color | number | string | Resource): T;
backgroundColor(value: ResourceColor): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class QRCodeExtend<T> extends QRCodeAttribute<T> {}
export declare const QRCodeInterface: QRCode;

View File

@ -1,65 +1,48 @@
/*
* 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.
*/
import {CommonMethod} from "./common";
/**
* radio
* @devices phone, tablet, car.
* @since 7
* 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 RadioExtend<T> extends RadioAttribute<T> {
}
import { CommonMethod } from "./common";
/**
* Provides an interface for creating a radio box.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface Radio extends RadioAttribute<Radio> {
/**
* Called when a radio box is created.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(options: {
value: string}): Radio;
(options: { value: string }): Radio;
}
/**
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
declare class RadioAttribute<T> extends CommonMethod<T> {
/**
* Called when the radio box is selected.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
checked(value: boolean): T;
/**
* Called when the radio box selection status changes.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onChange(callback: (isChecked: boolean) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class RadioExtend<T> extends RadioAttribute<T> {}
export declare const RadioInterface: Radio;

View File

@ -1,81 +1,60 @@
/*
* 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.
*/
import {CommonMethod} from "./common";
/**
* Scoring bar
* @devices phone, tablet, car.
* @since 7
*/
export declare class RatingExtend<T> extends RatingAttribute<T> {
}
/**
* Provides the interface for scoring bars.
* @devices phone, tablet, car.
* @since 7
*/
interface Rating extends RatingAttribute<Rating> {
/**
* Called when a score bar is created.
* @devices phone, tablet, car.
* @since 7
*/
(options?: { rating: number, indicator?: boolean }): Rating;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class RatingAttribute<T> extends CommonMethod<T> {
/**
* Called when the total number of stars is set.
* @devices phone, tablet, car.
* @since 7
*/
stars(value: number): T;
/**
* Called when the step size of the operation rating.
* @devices phone, tablet, car.
* @since 7
*/
stepSize(value: number): T;
/**
* Called when a picture is set.
* @devices phone, tablet, car.
* @since 7
*/
starStyle(value: {
backgroundUri: string,
foregroundUri: string,
secondaryUri?: string}): T;
/**
* Called when the star rating of the operation scoring bar changes.
* @devices phone, tablet, car.
* @since 7
*/
onChange(callback:(value: number) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const RatingInterface: Rating;
/*
* 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.
*/
import { CommonMethod } from "./common";
/**
* Provides the interface for scoring bars.
* @since 7
*/
interface Rating extends RatingAttribute<Rating> {
/**
* Called when a score bar is created.
* @since 7
*/
(options?: { rating: number; indicator?: boolean }): Rating;
}
/**
* @since 7
*/
declare class RatingAttribute<T> extends CommonMethod<T> {
/**
* Called when the total number of stars is set.
* @since 7
*/
stars(value: number): T;
/**
* Called when the step size of the operation rating.
* @since 7
*/
stepSize(value: number): T;
/**
* Called when a picture is set.
* @since 7
*/
starStyle(value: { backgroundUri: string; foregroundUri: string; secondaryUri?: string }): T;
/**
* Called when the star rating of the operation scoring bar changes.
* @since 7
*/
onChange(callback: (value: number) => void): T;
}
export declare class RatingExtend<T> extends RatingAttribute<T> {}
export declare const RatingInterface: Rating;

View File

@ -13,73 +13,51 @@
* limitations under the License.
*/
import {CommonShapeMethod} from "./common";
/**
* Rectangle drawing.
* @devices phone, tablet, car.
* @since 7
*/
export declare class RectExtend<T> extends RectAttribute<T> {
}
import { CommonShapeMethod } from "./common";
/**
* Provides an interface for drawing rectangles.
* @devices phone, tablet, car.
* @since 7
*/
interface Rect extends RectAttribute<Rect> {
/**
* Called when a new rectangle is created.
* @devices phone, tablet, car.
* @since 7
*/
new (
value?: { width?: number | string, height?: number | string, radius?: number | string | Array<any> } |
{
width?: number | string, height?: number | string, radiusWidth?: number | string,
radiusHeight?: number | string
}): Rect;
/**
* Called when a rectangle is created.
* @devices phone, tablet, car.
* @since 7
*/
(value?: {width?: number | string,height?: number | string,radius?: number | string | Array<any> } |
{
width?: number | string,height?: number | string,radiusWidth?: number | string,radiusHeight?: number | string}): Rect;
(
value?:
| { width?: number | string; height?: number | string; radius?: number | string | Array<any> }
| {
width?: number | string;
height?: number | string;
radiusWidth?: number | string;
radiusHeight?: number | string;
},
): Rect;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class RectAttribute<T> extends CommonShapeMethod<T> {
/**
* Called when the fillet width is set.
* @devices phone, tablet, car.
* @since 7
*/
radiusWidth(value: number | string): T;
/**
* Called when the fillet height is set.
* @devices phone, tablet, car.
* @since 7
*/
radiusHeight(value: number | string): T;
/**
* Called when the fillet size is set.
* @devices phone, tablet, car.
* @since 7
*/
radius(value: number | string | Array<any>): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class RectExtend<T> extends RectAttribute<T> {}
export declare const RectInterface: Rect;

View File

@ -1,105 +1,84 @@
/*
* 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.
*/
import {CommonMethod} from "./common";
/**
* The refresh status of the drop-down refresh.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum RefreshStatus {
/**
* The refresh status of the drop-down refresh.
* @devices phone, tablet, car.
* @since 7
*/
Inactive,
/**
* Drop down, but the drop-down distance is less than the refresh distance.
* @devices phone, tablet, car.
* @since 7
*/
Drag,
/**
* The pull-down exceeds the refresh distance.
* @devices phone, tablet, car.
* @since 7
*/
OverDrag,
/**
* After the pull-down, it rebounds to the refresh distance and enters the refresh state.
* @devices phone, tablet, car.
* @since 7
*/
Refresh,
/**
* After refresh, return to the initial state.
* @devices phone, tablet, car.
* @since 7
*/
Done,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class RefreshExtend<T> extends RefreshAttribute<T> {
}
/**
* Provides a pull-down refresh interface.
* @devices phone, tablet, car.
* @since 7
*/
interface Refresh extends RefreshAttribute<Refresh> {
/**
* Called when the drop-down refresh is set.
* @devices phone, tablet, car.
* @since 7
*/
(value: {refreshing: boolean,offset?: number | string,friction?: number | string }): Refresh;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class RefreshAttribute<T> extends CommonMethod<T> {
/**
* Called when the refresh state changes.
* @devices phone, tablet, car.
* @since 7
*/
onStateChange(callback: (state: RefreshStatus) => void): T;
/**
* Called when the refresh state is entered.
* @devices phone, tablet, car.
* @since 7
*/
onRefreshing(callback: () => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const RefreshInterface: Refresh;
/*
* 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.
*/
import { CommonMethod } from "./common";
/**
* The refresh status of the drop-down refresh.
* @since 8
*/
export declare enum RefreshStatus {
/**
* The refresh status of the drop-down refresh.
* @since 8
*/
Inactive,
/**
* Drop down, but the drop-down distance is less than the refresh distance.
* @since 8
*/
Drag,
/**
* The pull-down exceeds the refresh distance.
* @since 8
*/
OverDrag,
/**
* After the pull-down, it rebounds to the refresh distance and enters the refresh state.
* @since 8
*/
Refresh,
/**
* After refresh, return to the initial state.
* @since 8
*/
Done,
}
/**
* Provides a pull-down refresh interface.
* @since 8
*/
interface Refresh extends RefreshAttribute<Refresh> {
/**
* Called when the drop-down refresh is set.
* @since 8
*/
(value: { refreshing: boolean; offset?: number | string; friction?: number | string }): Refresh;
}
/**
* @since 8
*/
declare class RefreshAttribute<T> extends CommonMethod<T> {
/**
* Called when the refresh state changes.
* @since 8
*/
onStateChange(callback: (state: RefreshStatus) => void): T;
/**
* Called when the refresh state is entered.
* @since 8
*/
onRefreshing(callback: () => void): T;
}
export declare class RefreshExtend<T> extends RefreshAttribute<T> {}
export declare const RefreshInterface: Refresh;

View File

@ -13,44 +13,31 @@
* limitations under the License.
*/
import {CommonMethod, VerticalAlign, VerticalAlignDeclaration} from "./common";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class RowExtend<T> extends RowAttribute<T> {
}
import { CommonMethod } from "./common";
import { VerticalAlign } from "./enums";
/**
* The components are laid out horizontally
* @devices phone, tablet, car.
* @since 7
*/
interface Row extends RowAttribute<Row> {
/**
* Called when the layout is set in the horizontal direction.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { space?: string | number, useAlign?: VerticalAlignDeclaration }): Row;
(value?: { space?: string | number }): Row;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class RowAttribute<T> extends CommonMethod<T> {
/**
* Called when the vertical alignment is set.
* @devices phone, tablet, car.
* @since 7
*/
alignItems(value: VerticalAlign): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class RowExtend<T> extends RowAttribute<T> {}
export declare const RowInterface: Row;

View File

@ -13,45 +13,30 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
/**
* Component horizontal layout.
* @devices phone, tablet, car.
* @since 7
*/
export declare class RowSplitExtend<T> extends RowSplitAttribute<T> {
}
import { CommonMethod } from "./common";
/**
* Provides interfaces for layout in the vertical direction.
* @devices phone, tablet, car.
* @since 7
*/
interface RowSplit extends RowSplitAttribute<RowSplit> {
/**
* Called when the layout along the vertical direction is set.
* @devices phone, tablet, car.
* @since 7
*/
(): RowSplit;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class RowSplitAttribute<T> extends CommonMethod<T> {
/**
* Called when judging whether the split line can be dragged.
* @devices phone, tablet, car.
* @since 7
*/
resizeable(value: boolean): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class RowSplitExtend<T> extends RowSplitAttribute<T> {}
export declare const RowSplitInterface: RowSplit;

View File

@ -13,177 +13,148 @@
* limitations under the License.
*/
import {CommonMethod, Edge, Axis, Curve, BarState, EdgeEffect, Color} from "./common";
import { CommonMethod } from "./common";
import { Axis, BarState, Color, Curve, Edge, EdgeEffect } from "./enums";
/**
* Content scroll direction.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ScrollDirection {
/**
* Vertical scrolling is supported.
* @devices phone, tablet, car.
* @since 7
*/
Vertical,
/**
* Horizontal scrolling is supported.
* @devices phone, tablet, car.
* @since 7
*/
Horizontal,
/**
* Free scrolling is supported.
* @devices phone, tablet, car.
* @since 7
*/
Free,
/**
* Non-scrollable.
* @devices phone, tablet, car.
* @since 7
*/
None
None,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class Scroller {
/**
* constructor.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* Called when the setting slides to the specified position.
* @devices phone, tablet, car.
* @since 7
*/
scrollTo(value: {
xOffset: number | string,yOffset: number | string,animation?: {duration: number,curve: Curve } });
xOffset: number | string;
yOffset: number | string;
animation?: { duration: number; curve: Curve };
});
/**
* Called when scrolling to the edge of the container.
* @devices phone, tablet, car.
* @since 7
*/
scrollEdge(value: Edge);
/**
* Called when page turning mode is set.
* @devices phone, tablet, car.
* @since 7
*/
scrollPage(value: {next: boolean,direction?: Axis });
scrollPage(value: { next: boolean; direction?: Axis });
/**
* Called when viewing the scroll offset.
* @devices phone, tablet, car.
* @since 7
*/
currentOffset();
/**
* Called when sliding to the specified index.
* @devices phone, tablet, car.
* @since 7
*/
scrollToIndex(value: number);
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ScrollExtend<T> extends ScrollAttribute<T> {
}
/**
* Provides interfaces for scrollable containers.
* @devices phone, tablet, car.
* @since 7
*/
interface Scroll extends ScrollAttribute<Scroll> {
/**
* Called when a scrollable container is set.
* @devices phone, tablet, car.
* @since 7
*/
(scroller?: Scroller): Scroll;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ScrollAttribute<T> extends CommonMethod<T> {
/**
* Called when the scroll method is slid.
* @devices phone, tablet, car.
* @since 7
*/
scrollable(value: ScrollDirection): T;
/**
* Called when the setting slides to the specified position.
* @devices phone, tablet, car.
* @since 7
*/
onScroll(event: (xOffset: number,yOffset: number) => void): T;
onScroll(event: (xOffset: number, yOffset: number) => void): T;
/**
* Called when scrolling to the edge of the container.
* @devices phone, tablet, car.
* @since 7
*/
onScrollEdge(event: (side: Edge) => void): T;
/**
* Called when scrolling has stopped.
* @devices phone, tablet, car.
* @since 7
*/
onScrollEnd(event: () => void): T;
/**
* Called when the status of the scroll bar is set.
* @devices phone, tablet, car.
* @since 7
*/
scrollBar(barState: BarState): T;
/**
* Called when the color of the scroll bar is set.
* @devices phone, tablet, car.
* @since 7
*/
scrollBarColor(color: Color | number | string): T;
/**
* Called when the width of the scroll bar is set.
* @devices phone, tablet, car.
* @since 7
*/
scrollBarWidth(value: number | string): T;
/**
* Called when the sliding effect is set.
* @devices phone, tablet, car.
* @since 7
*/
edgeEffect(edgeEffect: EdgeEffect): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ScrollExtend<T> extends ScrollAttribute<T> {}
export declare const ScrollInterface: Scroll;

View File

@ -1,34 +1,39 @@
/*
* 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.
*/
import {CommonMethod, Color, Resource} from "./common";
import {TextAlign, FontWeight, FontStyle} from "./text";
export declare class SearchExtend<T> extends SearchAttribute<T> {
}
interface Search extends SearchAttribute<Search> {
(options?: {value?: string, placeholder?: string, icon?: string}): Search;
}
declare class SearchAttribute<T> extends CommonMethod<T> {
searchButton(value: string): T;
placeholderColor(value: Color | number | string | Resource): T;
placeholderFont(value: {size: number, weight: FontWeight, family: string, style: FontStyle}): T;
onSubmit(callback:(value: string) => void): T;
onChange(callback:(value: string) => void): T;
}
export declare const SearchInterface: Search
/*
* 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.
*/
import { CommonMethod } from "./common";
import { FontStyle, FontWeight } from "./enums";
import { ResourceColor } from "./units";
/**
* @since 8
*/
interface Search extends SearchAttribute<Search> {
(options?: { value?: string; placeholder?: string; icon?: string }): Search;
}
/**
* @since 8
*/
declare class SearchAttribute<T> extends CommonMethod<T> {
searchButton(value: string): T;
placeholderColor(value: ResourceColor): T;
placeholderFont(value: { size: number; weight: FontWeight; family: string; style: FontStyle }): T;
onSubmit(callback: (value: string) => void): T;
onChange(callback: (value: string) => void): T;
}
export declare class SearchExtend<T> extends SearchAttribute<T> {}
export declare const SearchInterface: Search;

View File

@ -13,121 +13,98 @@
* limitations under the License.
*/
import {CommonMethod, Color, LineCapStyle, LineJoinStyle, Resource, PixelMap} from "./common";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ShapeExtend<T> extends ShapeAttribute<T> {
}
import { CommonMethod, PixelMap } from "./common";
import { LineCapStyle, LineJoinStyle } from "./enums";
import { Resource, ResourceColor } from "./units";
/**
* Provides interfaces for drawing components.
* @devices phone, tablet, car.
* @since 7
*/
interface Shape extends ShapeAttribute<Shape> {
/**
* Called when a component is drawn.
* @devices phone, tablet, car.
* @since 7
*/
(value?: PixelMap): Shape;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class ShapeAttribute<T> extends CommonMethod<T> {
/**
* Viewport of shape
* @devices phone, tablet, car.
* @since 7
*/
viewPort(value: { x?: number | string, y?: number | string, width?: number | string, height?: number | string }): T;
viewPort(value: { x?: number | string; y?: number | string; width?: number | string; height?: number | string }): T;
/**
* Called when the border color is set.
* @devices phone, tablet, car.
* @since 7
*/
stroke(value: Color | number | string | Resource): T;
stroke(value: ResourceColor): T;
/**
* Called when the fill color is set.
* @devices phone, tablet, car.
* @since 7
*/
fill(value: Color | number | string | Resource): T;
fill(value: ResourceColor): T;
/**
* Called when the offset of the starting point of border drawing is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeDashOffset(value: number | string): T;
/**
* Called when the gap of the border is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeDashArray(value: Array<any>): T;
/**
* Called when the path endpoint drawing style is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeLineCap(value: LineCapStyle): T;
/**
* Called when the border corner drawing style is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeLineJoin(value: LineJoinStyle): T;
/**
* Called when the limit value for drawing acute angles as oblique angles is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeMiterLimit(value: number | string): T;
/**
* Called when the opacity of the border is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeOpacity(value: number | string | Resource): T;
/**
* Called when the transparency of the border is set.
* @devices phone, tablet, car.
* @since 7
*/
fillOpacity(value: number | string | Resource): T;
/**
* Called when the width of the border is set.
* @devices phone, tablet, car.
* @since 7
*/
strokeWidth(value: number | string): T;
/**
* Called when setting whether anti aliasing is on.
* @devices phone, tablet, car.
* @since 7
*/
antiAlias(value: boolean): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ShapeExtend<T> extends ShapeAttribute<T> {}
export declare const ShapeInterface: Shape;

View File

@ -1,155 +1,167 @@
/*
* 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.
*/
import {CommonMethod, Color, Resource} from "./common";
/**
* Declare sliderstyle
* @devices phone, tablet, car.
* @since 7
*/
export declare enum SliderStyle {
/**
* The slider is on the slide rail.
* @devices phone, tablet, car.
* @since 7
*/
OutSet = 0,
/**
* The slider is in the slide rail.
* @devices phone, tablet, car.
* @since 7
*/
InSet,
}
/**
* Declare SliderChangeMode
* @devices phone, tablet, car.
* @since 7
*/
export declare enum SliderChangeMode {
/**
* Start dragging the slider.
* @devices phone, tablet, car.
* @since 7
*/
Begin = 0,
/**
* Drag the slider.
* @devices phone, tablet, car.
* @since 7
*/
Moving,
/**
* End dragging the slider.
* @devices phone, tablet, car.
* @since 7
*/
End,
}
/**
* Declare SliderChangeMode.
* @devices phone, tablet, car.
* @since 7
*/
export declare class SliderExtend<T> extends SliderAttribute<T> {
}
/**
* Provides an interface for the slide bar component.
* @devices phone, tablet, car.
* @since 7
*/
interface Slider extends SliderAttribute<Slider> {
/**
* Called when the slider bar component is used.
* @devices phone, tablet, car.
* @since 7
*/
(options?: {value?: number,min?: number,max?: number,step?: number,style?: SliderStyle}): Slider;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class SliderAttribute<T> extends CommonMethod<T> {
/**
* Called when the slider color of the slider bar is set.
* @devices phone, tablet, car.
* @since 7
*/
blockColor(value: Color | number | string | Resource): T;
/**
* Called when the track color of the slider is set.
* @devices phone, tablet, car.
* @since 7
*/
trackColor(value: Color | number | string | Resource): T;
/**
* Called when the slider of the slider bar is set to slide over the area color.
* @devices phone, tablet, car.
* @since 7
*/
selectedColor(value: Color | number | string | Resource): T;
/**
* Called when the minimum label is set.
* @devices phone, tablet, car.
* @since 7
*/
minLabel(value: string): T;
/**
* Called when the maximum label is set.
* @devices phone, tablet, car.
* @since 7
*/
maxLabel(value: string): T;
/**
* Called when setting whether to display step size.
* @devices phone, tablet, car
* @since 7
*/
showSteps(value: boolean): T;
/**
* Called when the percentage of bubble prompt is set when sliding.
* @devices phone, tablet, car
* @since 7
*/
showTips(value: boolean): T;
/**
* Called when the selection value changes.
* @devices phone, tablet, car
* @since 7
*/
onChange(callback:(value: number, mode: SliderChangeMode) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const SliderInterface: Slider;
/*
* 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.
*/
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* Declare sliderstyle
* @since 7
*/
export declare enum SliderStyle {
/**
* The slider is on the slide rail.
* @since 7
*/
OutSet = 0,
/**
* The slider is in the slide rail.
* @since 7
*/
InSet,
}
/**
* Declare SliderChangeMode
* @since 7
*/
export declare enum SliderChangeMode {
/**
* Start dragging the slider.
* @since 7
*/
Begin = 0,
/**
* Drag the slider.
* @since 7
*/
Moving,
/**
* End dragging the slider.
* @since 7
*/
End,
}
/**
* Defines the option of Slider.
* @since 7
*/
export declare interface SliderOption {
/**
* Current value of Slider.
* @since 7
*/
value?: number;
/**
* Sets the min value of Slider.
* @since 7
*/
min?: number;
/**
* Sets the max value of Slider.
* @since 7
*/
max?: number;
/**
* Sets the step of each slide value.
* @since 7
*/
step?: number;
/**
* Sets the slider style.
* @since 7
*/
style?: SliderStyle;
}
/**
* Provides an interface for the slide bar component.
* @since 7
*/
interface Slider extends SliderAttribute<Slider> {
/**
* Called when the slider bar component is used.
* @since 7
*/
(options?: SliderOption): Slider;
}
/**
* Defines the attribute functions of Slider.
* @since 7
*/
declare class SliderAttribute<T> extends CommonMethod<T> {
/**
* Called when the slider color of the slider bar is set.
* @since 7
*/
blockColor(value: ResourceColor): T;
/**
* Called when the track color of the slider is set.
* @since 7
*/
trackColor(value: ResourceColor): T;
/**
* Called when the slider of the slider bar is set to slide over the area color.
* @since 7
*/
selectedColor(value: ResourceColor): T;
/**
* Called when the minimum label is set.
* @since 7
*/
minLabel(value: string): T;
/**
* Called when the maximum label is set.
* @since 7
*/
maxLabel(value: string): T;
/**
* Called when setting whether to display step size.
* @devices phone, tablet, car
* @since 7
*/
showSteps(value: boolean): T;
/**
* Called when the percentage of bubble prompt is set when sliding.
* @devices phone, tablet, car
* @since 7
*/
showTips(value: boolean): T;
/**
* Called when the selection value changes.
* @devices phone, tablet, car
* @since 7
*/
onChange(callback: (value: number, mode: SliderChangeMode) => void): T;
}
export declare class SliderExtend<T> extends SliderAttribute<T> {}
export declare const SliderInterface: Slider;

View File

@ -13,94 +13,73 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common";
import {FontStyle, FontWeight, TextDecorationType, TextCase} from "./text";
/**
* Declaration extension.
* @devices phone, tablet, car.
* @since 7
*/
export declare class SpanExtend<T> extends SpanAttribute<T> {
}
import { CommonMethod } from "./common";
import { FontStyle, FontWeight, TextDecorationType, TextCase } from "./enums";
import { Resource, ResourceColor } from "./units";
/**
* Provide text decoration.
* @devices phone, tablet, car.
* @since 7
*/
interface Span extends SpanAttribute<Span> {
/**
* Called when text is entered in span.
* @devices phone, tablet, car.
* @since 7
*/
(value: string | Resource): Span;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class SpanAttribute<T> extends CommonMethod<T> {
/**
* Called when the font color is set.
* @devices phone, tablet, car.
* @since 7
*/
fontColor(value: Color | number | string | Resource): T;
fontColor(value: ResourceColor): T;
/**
* Called when the font size is set.
* @devices phone, tablet, car.
* @since 7
*/
fontSize(value: number | string | Resource): T;
/**
* Called when the font style of a font is set.
* @devices phone, tablet, car.
* @since 7
*/
fontStyle(value: FontStyle): T;
/**
* Called when the font weight is set.
* @devices phone, tablet, car.
* @since 7
*/
fontWeight(value: number | FontWeight | string): T;
/**
* Called when the font list of text is set.
* @devices phone, tablet, car.
* @since 7
*/
fontFamily(value: string | Resource): T;
/**
* Called when the text decoration of the text is set.
* @devices phone, tablet, car.
* @since 7
*/
decoration(value: { type: TextDecorationType, color?: Color | number | string | Resource}): T;
decoration(value: { type: TextDecorationType; color?: ResourceColor }): T;
/**
* Called when the distance between text fonts is set.
* @devices phone, tablet, car.
* @since 7
*/
letterSpacing(value: number | string): T;
/**
* Called when the type of letter in the text font is set.
* @devices phone, tablet, car.
*/
textCase(value: TextCase): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class SpanExtend<T> extends SpanAttribute<T> {}
export declare const SpanInterface: Span;

View File

@ -13,45 +13,31 @@
* limitations under the License.
*/
import {CommonMethod, Alignment} from "./common";
/**
* Declaration extension.
* @devices phone, tablet, car.
* @since 7
*/
export declare class StackExtend<T> extends StackAttribute<T> {
}
import { CommonMethod } from "./common";
import { Alignment } from "./enums";
/**
* Provides ports for stacking containers.
* @devices phone, tablet, car.
* @since 7
*/
interface Stack extends StackAttribute<Stack> {
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { alignContent?: Alignment }): Stack;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class StackAttribute<T> extends CommonMethod<T> {
/**
* Called when the occupancy of items in the container is set.
* @devices phone, tablet, car.
* @since 7
*/
alignContent(value: Alignment): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class StackExtend<T> extends StackAttribute<T> {}
export declare const StackInterface: Stack;

View File

@ -15,561 +15,490 @@
/**
* Provides an interface for attribute subscribers.
* @devices phone, tablet, car.
* @since 7
*/
interface IPropertySubscriber {
/**
* Called when the ID of the property subscriber is queried.
* @devices phone, tablet, car.
* @since 7
*/
id(): number;
/**
* Provides a single attribute change user interface.
* @devices phone, tablet, car.
* @since 7
*/
aboutToBeDeleted(owningView?: IPropertySubscriber): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface ISinglePropertyChangeSubscriber<T> extends IPropertySubscriber {
/**
* Provides a single attribute change user interface.
* @devices phone, tablet, car.
* @since 7
*/
hasChanged(newValue: T): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare abstract class SubscribedAbstractProperty<T> {
/**
* Setting Subscribers.
* @devices phone, tablet, car.
* @since 7
*/
protected subscribers_: Set<number>;
/**
* Private user ID.
* @devices phone, tablet, car.
* @since 7
*/
private id_;
/**
* Private user information.
* @devices phone, tablet, car.
* @since 7
*/
private info_?;
/**
* @devices phone, tablet, car.
* @since 7
*/
constructor(
/**
* Subscriber Information.
* @devices phone, tablet, car.
* @since 7
*/
subscribeMe?: IPropertySubscriber, info?: string);
/**
* Subscriber Information.
* @since 7
*/
subscribeMe?: IPropertySubscriber,
info?: string,
);
/**
* Called when the subscriber ID is entered.
* @devices phone, tablet, car.
* @since 7
*/
id(): number;
/**
* Called when a subscriber information description is entered.
* @devices phone, tablet, car.
* @since 7
*/
info(): string;
/**
* Called when data is obtained.
* @devices phone, tablet, car.
* @since 7
*/
abstract get(): T;
/**
* Called when data is created.
* @devices phone, tablet, car.
* @since 7
*/
abstract set(newValue: T): void;
/**
* Called when a two-way synchronization is created.
* @devices phone, tablet, car.
* @since 7
*/
createTwoWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyTwoWay<T>;
/**
* Called when a one-way synchronization is created.
* @devices phone, tablet, car.
* @since 7
*/
createOneWaySync(subscribeMe?: IPropertySubscriber, info?: string): SyncedPropertyOneWay<T>;
/**
* Called when the subscriber is unlinked.
* @devices phone, tablet, car.
* @since 7
*/
unlinkSuscriber(subscriberId: number): void;
/**
* Called when the notification has changed.
* @devices phone, tablet, car.
* @since 7
*/
protected notifyHasChanged(newValue: T): void;
/**
* Called when the notification property is read.
* @devices phone, tablet, car.
* @since 7
*/
protected notifyPropertyRead(): void;
/**
* Called when the number of users is queried.
* @devices phone, tablet, car.
* @since 7
*/
numberOfSubscrbers(): number;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class SyncedPropertyTwoWay<T> extends SubscribedAbstractProperty<T> implements ISinglePropertyChangeSubscriber<T> {
declare class SyncedPropertyTwoWay<T>
extends SubscribedAbstractProperty<T>
implements ISinglePropertyChangeSubscriber<T>
{
/**
* Sources of synchronization attributes bidirectionally.
* @devices phone, tablet, car.
* @since 7
*/
private source_;
/**
* constructor parameters.
* @devices phone, tablet, car.
* @since 7
*/
constructor(source: SubscribedAbstractProperty<T>, subscribeMe?: IPropertySubscriber, info?: string);
/**
* Called when processing information about to be deleted.
* @devices phone, tablet, car.
* @since 7
*/
aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void;
/**
* Information Changed.
* @devices phone, tablet, car.
* @since 7
*/
hasChanged(newValue: T): void;
/**
* Called when data is obtained.
* @devices phone, tablet, car.
* @since 7
*/
get(): T;
/**
* Called when data is created.
* @devices phone, tablet, car.
* @since 7
*/
set(newValue: T): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class SyncedPropertyOneWay<T> extends SubscribedAbstractProperty<T> implements ISinglePropertyChangeSubscriber<T> {
declare class SyncedPropertyOneWay<T>
extends SubscribedAbstractProperty<T>
implements ISinglePropertyChangeSubscriber<T>
{
/**
* Pack value for single-item binding.
* @devices phone, tablet, car.
* @since 7
*/
private wrappedValue_;
/**
* Sources of synchronization attributes bidirectionally.
* @devices phone, tablet, car.
* @since 7
*/
private source_;
/**
* Constructor parameters.
* @devices phone, tablet, car.
* @since 7
*/
constructor(source: SubscribedAbstractProperty<T>, subscribeMe?: IPropertySubscriber, info?: string);
/**
* Called when processing information about to be deleted.
* @devices phone, tablet, car.
* @since 7
*/
aboutToBeDeleted(unsubscribeMe?: IPropertySubscriber): void;
/**
* Information Changed.
* @devices phone, tablet, car.
* @since 7
*/
hasChanged(newValue: T): void;
/**
* Called when data is obtained.
* @devices phone, tablet, car.
* @since 7
*/
get(): T;
/**
* Called when data is created.
* @devices phone, tablet, car.
* @since 7
*/
set(newValue: T): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class AppStorage {
/**
* Called when a link is set.
* @devices phone, tablet, car.
* @since 7
*/
static Link<T>(propName: string): any;
/**
* Called when a hyperlink is set.
* @devices phone, tablet, car.
* @since 7
*/
static SetAndLink<T>(propName: string, defaultValue: T): SubscribedAbstractProperty<T>;
/**
* Called when a property is set.
* @devices phone, tablet, car.
* @since 7
*/
static Prop<S>(propName: string): any;
/**
* Called when dynamic properties are set.
* @devices phone, tablet, car.
* @since 7
*/
static SetAndProp<S>(propName: string, defaultValue: S): SubscribedAbstractProperty<S>;
/**
* Called when owning or not.
* @devices phone, tablet, car.
* @since 7
*/
static Has(propName: string): boolean;
/**
* Called when data is obtained.
* @devices phone, tablet, car.
* @since 7
*/
static Get<T>(propName: string): T | undefined;
/**
* Called when setting.
* @devices phone, tablet, car.
* @since 7
*/
static Set<T>(propName: string, newValue: T): boolean;
/**
* Called when setting or creating.
* @devices phone, tablet, car.
* @since 7
*/
static SetOrCreate<T>(propName: string, newValue: T): void;
/**
* Called when a deletion is made.
* @devices phone, tablet, car.
* @since 7
*/
static Delete(propName: string): boolean;
/**
* Called when a dictionary is sorted.
* @devices phone, tablet, car.
* @since 7
*/
static Keys(): IterableIterator<string>;
/**
* Called when a cleanup occurs.
* @devices phone, tablet, car.
* @since 7
*/
static staticClear(): boolean;
/**
* Called when the data can be changed.
* @devices phone, tablet, car.
* @since 7
*/
static IsMutable(propName: string): boolean;
/**
* Called when you check how much data is stored.
* @devices phone, tablet, car.
* @since 7
*/
static Size(): number;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class Environment {
/**
* Constructor.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* Called when a property value is checked.
* @devices phone, tablet, car.
* @since 7
*/
static EnvProp<S>(key: string, value: S): boolean;
/**
* Called when multiple property values are checked.
* @devices phone, tablet, car.
* @since 7
*/
static EnvProps(props: {
key: string;
defaultValue: any;
}[]): void;
static EnvProps(
props: {
key: string;
defaultValue: any;
}[],
): void;
/**
* Set the key value.
* @devices phone, tablet, car.
* @since 7
*/
static Keys(): Array<string>;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare enum ColorMode {
/**
* Bright color.
* @devices phone, tablet, car.
* @since 7
*/
LIGHT = 0,
/**
* Dark.
* @devices phone, tablet, car.
* @since 7
*/
DARK,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare enum LayoutDirection {
/**
* Elements are laid out from left to right.
* @devices phone, tablet, car.
* @since 7
*/
LTR = 0,
/**
* Elements are laid out from right to left.
* @devices phone, tablet, car.
* @since 7
*/
RTL,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class PersistentStorage {
/**
* Constructor parameters.
* @devices phone, tablet, car.
* @since 7
*/
constructor(appStorage: AppStorage, storage: Storage);
/**
* Called when a persistence property is stored.
* @devices phone, tablet, car.
* @since 7
*/
static PersistProp<T>(key: string, defaultValue: T): void;
/**
* Called when a property is deleted.
* @devices phone, tablet, car.
* @since 7
*/
static DeleteProp(key: string): void;
/**
* Called when multiple persistence properties are stored.
* @devices phone, tablet, car.
* @since 7
*/
static PersistProps(properties: {
static PersistProps(
properties: {
key: string;
defaultValue: any;
}[]): void;
}[],
): void;
/**
* Set the key value.
* @devices phone, tablet, car.
* @since 7
*/
static Keys(): Array<string>;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class Storage {
/**
* Constructor parameters.
* @devices phone, tablet, car.
* @since 7
*/
constructor(
needCrossThread?: boolean, file?: string);
constructor(needCrossThread?: boolean, file?: string);
/**
* Called when data is obtained.
* @devices phone, tablet, car.
* @since 7
*/
get(key: string): string | undefined;
/**
* Called when setting.
* @devices phone, tablet, car.
* @since 7
*/
set(key: string, val: any): void;
/**
* Called when data is cleared.
* @devices phone, tablet, car.
* @since 7
*/
clear(): void;
/**
* Called when data is deleted.
* @devices phone, tablet, car.
* @since 7
*/
delete(key: string): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare abstract class SubscribaleAbstract {
/**
* Returns the ownership attribute set by the.
* @devices phone, tablet, car.
* @since 7
*/
private owningProperties_: Set<number>;
/**
* Constructor.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* Called when the notification property has changed.
* @devices phone, tablet, car.
* @since 7
*/
protected notifyPropertyHasChanged(propName: string, newValue: any): void;
/**
* Called when adding an already owned property.
* @devices phone, tablet, car.
* @since 7
*/
public addOwningProperty(subscriber: IPropertySubscriber): void;
/**
* Called when an already owned property is deleted.
* @devices phone, tablet, car.
* @since 7
*/
public removeOwningProperty(property: IPropertySubscriber): void;
/**
* Called when an already owned property is deleted by ID
* @devices phone, tablet, car.
* @since 7
*/
public removeOwningPropertyById(subscriberId: number): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const appStorage: AppStorage;

View File

@ -13,31 +13,27 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Provides methods for switching components.
* @devices phone, tablet, car.
* @since 7
*/
export declare class SwiperController {
/**
* constructor.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* Called when the next child component is displayed.
* @devices phone, tablet, car.
* @since 7
*/
showNext();
/**
* Called when the previous subcomponent is displayed.
* @devices phone, tablet, car.
* @since 7
*/
showPrevious();
@ -45,125 +41,98 @@ export declare class SwiperController {
/**
* Declare the size of the swiper on the spindle.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum SwiperDisplayMode {
/**
* Carousel map extension.
* @devices phone, tablet, car.
* @since 7
*/
Stretch,
/**
* The rotation chart is self linear.
* @devices phone, tablet, car.
* @since 7
*/
AutoLinear
}
/**
* Declaration extension.
* @devices phone, tablet, car.
* @since 7
*/
export declare class SwiperExtend<T> extends SwiperAttribute<T> {
AutoLinear,
}
/**
* Provides an interface for sliding containers.
* @devices phone, tablet, car.
* @since 7
*/
interface Swiper extends SwiperAttribute<Swiper> {
/**
* Called when a sliding container is set.
* @devices phone, tablet, car.
* @since 7
*/
(controller?: SwiperController): Swiper;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class SwiperAttribute<T> extends CommonMethod<T> {
/**
* Called when the index value of the displayed subcomponent is set in the container.
* @devices phone, tablet, car.
* @since 7
*/
index(value: number): T;
/**
* Called when setting whether the subcomponent plays automatically.
* @devices phone, tablet, car.
* @since 7
*/
autoPlay(value: boolean): T;
/**
* Called when the time interval for automatic playback is set.
* @devices phone, tablet, car.
* @since 7
*/
interval(value: number): T;
/**
* Called when you set whether the navigation point indicator is enabled.
* @devices phone, tablet, car.
* @since 7
*/
indicator(value: boolean): T;
/**
* Called when setting whether to turn on cyclic sliding.
* @devices phone, tablet, car.
* @since 7
*/
loop(value: boolean): T;
/**
* Called when the animation duration of the switch is set.
* @devices phone, tablet, car.
* @since 7
*/
duration(value: number): T;
/**
* Called when setting whether to slide vertically.
* @devices phone, tablet, car.
* @since 7
*/
vertical(value: boolean): T;
/**
* Called when the size of the rotation chart is set.
* @devices phone, tablet, car.
* @since 7
*/
itemSpace(value: number | string): T;
/**
* Called when setting the size of the swiper container on the spindle.
* @devices phone, tablet, car.
* @since 7
*/
displayMode(value: SwiperDisplayMode): T;
/**
* Called when the index value changes.
* @devices phone, tablet, car.
* @since 7
*/
onChange(event: (index: number) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class SwiperExtend<T> extends SwiperAttribute<T> {}
export declare const SwiperInterface: Swiper;

View File

@ -13,45 +13,32 @@
* limitations under the License.
*/
import {CommonMethod, Resource} from "./common";
/**
* Declaration extension.
* @devices tv, phone, tablet
* @since 7
*/
export declare class TabContentExtend<T> extends TabContentAttribute<T> {
}
import { CommonMethod } from "./common";
import { Resource } from "./units";
/**
* Provides an interface for switching the content view on a tab page.
* @devices phone, tablet, car.
* @since 7
*/
interface TabContent extends TabContentAttribute<TabContent> {
/**
* Called when the content view of the switch tab is set.
* @devices phone, tablet, car.
* @since 7
*/
(): TabContent;
}
/**
* @devices phone, tablet, car.
* Defines the attribute functions of TabContent.
* @since 7
*/
declare class TabContentAttribute<T> extends CommonMethod<T> {
/**
* Called when tabbar is entered.
* @devices phone, tablet, car.
* @since 7
*/
tabBar(value: string | Resource | { icon?: string | Resource, text?: string | Resource }): T;
tabBar(value: string | Resource | { icon?: string | Resource; text?: string | Resource }): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TabContentExtend<T> extends TabContentAttribute<T> {}
export declare const TabContentInterface: TabContent;

View File

@ -13,148 +13,119 @@
* limitations under the License.
*/
import {CommonMethod} from "./common";
import { CommonMethod } from "./common";
/**
* Declare the graphic format of the bar chart.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum BarMode {
/**
* The actual layout width of the TabBar is used. If the width exceeds the total width, you can slide the tabbar.
* @devices phone, tablet, car.
* @since 7
*/
Scrollable,
/**
* The width of all TabBars is evenly allocated.
* @devices phone, tablet, car.
* @since 7
*/
Fixed
Fixed,
}
/**
* Declare the location of the bar chart.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum BarPosition {
/**
* When the vertical attribute method is set to true, the tab is on the left of the container. When the vertical property method is set to false, the tab is at the top of the container.
* @devices phone, tablet, car.
* @since 7
*/
Start,
/**
* When the vertical attribute method is set to true, the tab is located on the right of the container. When the vertical property method is set to false, the tab is at the bottom of the container.
* @devices phone, tablet, car.
* @since 7
*/
End
End,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TabsController {
/**
* constructor.
* @devices phone, tablet, car.
* @since 7
*/
constructor();
/**
* Called when the tab is switched.
* @devices phone, tablet, car.
* @since 7
*/
changeIndex(value: number): void;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TabsExtend<T> extends TabsAttribute<T> {
}
/**
* Provides an interface for switching views.
* @devices phone, tablet, car.
* @since 7
*/
interface Tabs extends TabsAttribute<Tabs> {
/**
* Called when the view is switched.
* @devices phone, tablet, car.
* @since 7
*/
(value?: { barPosition?: BarPosition, index?: number, controller?: TabsController }): Tabs;
(value?: { barPosition?: BarPosition; index?: number; controller?: TabsController }): Tabs;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class TabsAttribute<T> extends CommonMethod<T> {
/**
* Called when determining whether the tab is vertical.
* @devices phone, tablet, car.
* @since 7
*/
vertical(value: boolean): T;
/**
* Called when judging whether page switching can be performed by sliding left and right.
* @devices phone, tablet, car.
* @since 7
*/
scrollable(value: boolean): T;
/**
* Called when the graphic format of the bar chart is selected.
* @devices phone, tablet, car.
* @since 7
*/
barMode(value: BarMode): T;
/**
* Called when the width of the bar graph is set.
* @devices phone, tablet, car.
* @since 7
*/
barWidth(value: number): T;
/**
* Called when the height of the bar graph is set.
* @devices phone, tablet, car.
* @since 7
*/
barHeight(value: number): T;
/**
* Called when the animation duration of the bar graph is set.
* @devices phone, tablet, car.
* @since 7
*/
animationDuration(value: number): T;
/**
* Called when the tab is switched.
* @devices phone, tablet, car.
* @since 7
*/
onChange(event: (index: number) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TabsExtend<T> extends TabsAttribute<T> {}
export declare const TabsInterface: Tabs;

View File

@ -13,332 +13,123 @@
* limitations under the License.
*/
import {CommonMethod, Color, Resource} from "./common";
import { CommonMethod } from "./common";
import { FontStyle, FontWeight, TextAlign, TextCase, TextDecorationType, TextOverflow } from "./enums";
import { Resource, ResourceColor } from "./units";
/**
* Text style
* @devices phone, tablet, car.
* @since 7
*/
export declare enum FontStyle {
/**
* Default style.
* @devices phone, tablet, car.
* @since 7
*/
Normal,
/**
* Italic style.
* @devices phone, tablet, car.
* @since 7
*/
Italic
}
/**
* The font weight of the text
* @devices phone, tablet, car.
* @since 7
*/
export declare enum FontWeight {
/**
* Defines a lighter value than [Inherited Value]..
* @devices phone, tablet, car.
* @since 7
*/
Lighter,
/**
* Normal font. Equivalent to a digital value of 400.
* @devices phone, tablet, car.
* @since 7
*/
Normal,
/**
* Defines a more general value than [Inherited Value].
* @devices phone, tablet, car.
* @since 7
*/
Regular,
/**
* Defines a value that is more centered than [Inherited Value].
* @devices phone, tablet, car.
* @since 7
*/
Medium,
/**
* Bold. Equivalent to a numeric value of 700.
* @devices phone, tablet, car.
* @since 7
*/
Bold,
/**
* Defines a value that is heavier than [Inherited Value].
* @devices phone, tablet, car.
* @since 7
*/
Bolder
}
/**
* Alignment of text.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum TextAlign {
/**
* Center the text.
* @devices phone, tablet, car.
* @since 7
*/
Center,
/**
* The text is aligned in the same direction as the writing
* @devices phone, tablet, car.
* @since 7
*/
Start,
/**
* The text is aligned in the opposite direction of writing
* @devices phone, tablet, car.
* @since 7
*/
End
}
/**
* Declare how text overflows.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum TextOverflow {
/**
* When the text is too long, it will be cropped and displayed.
* @devices phone, tablet, car.
* @since 7
*/
Clip,
/**
* If the text is too long, the text that cannot be displayed shall be replaced by ellipsis.
* @devices phone, tablet, car.
* @since 7
*/
Ellipsis,
/**
* Text is not cropped when it is too long.
* @devices phone, tablet, car.
* @since 7
*/
None
}
/**
* Type of text modifier.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum TextDecorationType {
/**
* Do not use text decorative lines.
* @devices phone, tablet, car.
* @since 7
*/
None,
/**
* Underline the words.
* @devices phone, tablet, car.
* @since 7
*/
Underline,
/**
* Text is in all uppercase.
* @devices phone, tablet, car.
* @since 7
*/
Overline,
/**
* A modifier line that passes through the text.
* @devices phone, tablet, car.
* @since 7
*/
LineThrough
}
/**
* Letter type in text
* @devices phone, tablet, car.
* @since 7
*/
export declare enum TextCase {
/**
* The default is normal.
* @devices phone, tablet, car.
* @since 7
*/
Normal,
/**
* The text is all lowercase.
* @devices phone, tablet, car.
* @since 7
*/
LowerCase,
/**
* Text is in all uppercase.
* @devices phone, tablet, car.
* @since 7
*/
UpperCase
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TextExtend<T> extends TextAttribute<T> {
}
export declare class TextExtend<T> extends TextAttribute<T> {}
/**
* Provides an interface for writing texts.
* @devices phone, tablet, car.
* @since 7
*/
interface Text extends TextAttribute<Text> {
/**
* Called when writing text.
* @devices phone, tablet, car.
* @since 7
*/
(content?: string | Resource): Text;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class TextAttribute<T> extends CommonMethod<T> {
/**
* Called when the font color is set.
* @devices phone, tablet, car.
* @since 7
*/
fontColor(value: Color | number | string | Resource): T;
fontColor(value: ResourceColor): T;
/**
* Called when the font size is set.
* @devices phone, tablet, car.
* @since 7
*/
fontSize(value: number | string | Resource): T;
/**
* Called when the minimum font size of the font is set.
* @devices phone, tablet, car.
* @since 7
*/
minFontSize(value: number | string | Resource): T;
/**
* Called when the maximum font size of the font is set.
* @devices phone, tablet, car.
* @since 7
*/
maxFontSize(value: number | string | Resource): T;
/**
* Called when the font style of a font is set.
* @devices phone, tablet, car.
* @since 7
*/
fontStyle(value: FontStyle): T;
/**
* Called when the font weight is set.
* @devices phone, tablet, car.
* @since 7
*/
fontWeight(value: number | FontWeight | string): T;
/**
* Called when the horizontal center mode of the font is set.
* @devices phone, tablet, car.
* @since 7
*/
textAlign(value: TextAlign): T;
/**
* Called when the vertical center mode of the font is set.
* @devices phone, tablet, car.
* @since 7
*/
lineHeight(value: number | string | Resource): T;
/**
* Called when the overflow mode of the font is set.
* @devices phone, tablet, car.
* @since 7
*/
textOverflow(value: { overflow: TextOverflow }): T;
/**
* Called when the font list of text is set.
* @devices phone, tablet, car.
* @since 7
*/
fontFamily(value: string | Resource): T;
/**
* Called when the maximum number of lines of text is set.
* @devices phone, tablet, car.
* @since 7
*/
maxLines(value: number): T;
/**
* Called when the text decoration of the text is set.
* @devices phone, tablet, car.
* @since 7
*/
decoration(value: { type: TextDecorationType, color?: Color | number | string | Resource }): T;
decoration(value: { type: TextDecorationType; color?: ResourceColor }): T;
/**
* Called when the distance between text fonts is set.
* @devices phone, tablet, car.
* @since 7
*/
letterSpacing(value: number | string): T;
/**
* Called when the type of letter in the text font is set.
* @devices phone, tablet, car.
* @since 7
*/
textCase(value: TextCase): T;
/**
* Called when the baseline offset is set.
* @devices phone, tablet, car.
* @since 7
*/
baselineOffset(value: number | string): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const TextInterface: Text;

View File

@ -0,0 +1,89 @@
/*
* 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.
*/
import { ResourceStr } from ".";
import { CommonMethod } from "./common";
import { TextAlign } from "./enums";
import { Font, ResourceColor } from "./units";
/**
* Defines the option of TextArea.
* @since 8
*/
export declare interface TextAreaOption {
/**
* The place holder text string.
* @since 8
*/
placeholder?: ResourceStr;
/**
* Sets the current value of TextArea.
* @since 8
*/
text?: ResourceStr;
}
/**
* Provides an interface for the multi-line text input component.
* @since 8
*/
interface TextArea extends TextAreaAttribute<TextArea> {
/**
* Called when writing multiple lines of text.
* @since 8
*/
(value?: TextAreaOption): TextArea;
}
/**
* Defines the attribute functions of TextArea.
* @since 8
*/
declare class TextAreaAttribute<T> extends CommonMethod<T> {
/**
* Called when the color of the placeholder is set.
* @since 8
*/
placeholderColor(value: ResourceColor): T;
/**
* Called when the font property of the placeholder is set.
* @since 8
*/
placeholderFont(value: Font): T;
/**
* Called when the alignment of the contents of a multiline text box is set.
* @since 8
*/
textAlign(value: TextAlign): T;
/**
* Called when the insertion cursor color is set.
* @since 6
*/
caretColor(value: ResourceColor): T;
/**
* Called when the input changes.
* @devices phone, tablet, car.
* @since 8
*/
onChange(callback: (value: string) => void): T;
}
export declare class TextAreaExtend<T> extends TextAreaAttribute<T> {}
export declare const TextAreaInterface: TextArea;

View File

@ -0,0 +1,178 @@
/*
* 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.
*/
import { Font } from ".";
import { CommonMethod } from "./common";
import { FontWeight, FontStyle } from "./enums";
import { Resource, ResourceColor, ResourceStr } from "./units";
/**
* Declare the type of input box
* @since 8
*/
export declare enum InputType {
/**
* Basic input mode.
* @since 8
*/
Normal,
/**
* Password entry mode.
* @since 8
*/
Number,
/**
* E-mail address input mode.
* @since 8
*/
Email,
/**
* Pure digital input mode.
* @since 8
*/
Password,
}
/**
* Declare the type of soft keyboard.
* @since 8
*/
export declare enum EnterKeyType {
/**
* Go.
* @since 8
*/
Go,
/**
* Search.
* @since 8
*/
Search,
/**
* Send.
* @since 8
*/
Send,
/**
* Next.
* @since 8
*/
Next,
/**
* Done.
* @since 8
*/
Done,
}
/**
* Defines the option of TextInput.
* @since 8
*/
export declare interface TextInputOption {
/**
* The place holder text string.
* @since 8
*/
placeholder?: ResourceStr;
/**
* Sets the current value of TextArea.
* @since 8
*/
text?: ResourceStr;
}
/**
* Provides a single-line text input component interface.
* @since 8
*/
interface TextInput extends TextInputAttribute<TextInput> {
/**
* Called when writing a single line of text.
* @since 8
*/
(value?: TextInputOption): TextInput;
}
/**
* @since 8
*/
declare class TextInputAttribute<T> extends CommonMethod<T> {
/**
* Called when the input type is set.
* @since 8
*/
type(value: InputType): T;
/**
* Called when the color of the placeholder is set.
* @since 8
*/
placeholderColor(value: ResourceColor): T;
/**
* Called when the font property of the placeholder is set.
* @since 8
*/
placeholderFont(value?: Font): T;
/**
* Called when the type of soft keyboard input button is set.
* @since 8
*/
enterKeyType(value: EnterKeyType): T;
/**
* Called when the color of the insertion cursor is set.
* @since 8
*/
caretColor(value: ResourceColor): T;
/**
* Called when judging whether the text editing has changed.
* @since 8
*/
onEditChanged(callback: (isEditing: boolean) => void): T;
/**
* Called when submitted.
* @since 8
*/
onSubmit(callback: (enterKey: EnterKeyType) => void): T;
/**
* Called when the input of the input box changes.
* @since 8
*/
onChange(callback: (value: string) => void): T;
/**
* Called when the input of maximum text length is set.
* @devices tv, phone, tablet, wearable, liteWearable, smartVision.
* @since 5
*/
maxLength(value: number): T;
}
export declare class TextInputExtend<T> extends TextInputAttribute<T> {}
export declare const TextInputInterface: TextInput;

View File

@ -13,93 +13,79 @@
* limitations under the License.
*/
import {CommonMethod, Resource} from "./common";
import { CommonMethod } from "./common";
import { Resource } from "./units";
/**
* Declare the type of selector
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
export declare enum PickerStyle {
/**
* Inside the line.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
INLINE = 0,
/**
* Block-level elements.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
BLOCK,
/**
* fade.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
FADE,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TextPickerExtend<T> extends TextPickerAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface TextPicker extends TextPickerAttribute<TextPicker> {
/**
* Add the property of the selector value range.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(options?: {range: string[] | Resource, value?: string, selected?: number, loop?: boolean , style?: PickerStyle}): TextPicker;
(options?: {
range: string[] | Resource;
value?: string;
selected?: number;
loop?: boolean;
style?: PickerStyle;
}): TextPicker;
}
/**
* Style the text selector.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
declare class TextPickerAttribute<T> extends CommonMethod<T> {
/**
* Called when the default height of the selected element is set.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
defaultPickerItemHeight(value: number): T;
/**
* Called when the pop-up value is returned.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onAccept(callback: (value: string, index: number) => void): T;
/**
* Called when the Cancel button in the pop-up window is clicked.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onCancel(callback: () => void): T;
/**
* Called when the OK button in the pop-up window is clicked.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
onChange(callback: (value: string, index: number) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TextPickerExtend<T> extends TextPickerAttribute<T> {}
export declare const TextPickerInterface: TextPicker;

View File

@ -1,85 +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.
*/
import {CommonMethod, Color, Resource} from "./common";
import {TextAlign, FontWeight, FontStyle} from "./text";
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TextAreaExtend<T> extends TextAreaAttribute<T> {
}
/**
* Provides an interface for the multi-line text input component.
* @devices phone, tablet, car.
* @since 7
*/
interface TextArea extends TextAreaAttribute<TextArea> {
/**
* Called when writing multiple lines of text.
* @devices phone, tablet, car.
* @since 7
*/
(options?: {placeholder: string | Resource, text: string | Resource}): TextArea;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class TextAreaAttribute<T> extends CommonMethod<T> {
/**
* Called when the color of the placeholder is set.
* @devices phone, tablet, car.
* @since 7
*/
placeholderColor(value: Color | number | string | Resource): T;
/**
* Called when the font property of the placeholder is set.
* @devices phone, tablet, car.
* @since 7
*/
placeholderFont(value?:{ size?: number | string | Resource, weight?: number | FontWeight | string, family?: string | Resource, style?: FontStyle }): T;
/**
* Called when the alignment of the contents of a multiline text box is set.
* @devices phone, tablet, car.
* @since 7
*/
textAlign(value: TextAlign): T;
/**
* Called when the insertion cursor color is set.
* @devices phone, tablet, car.
* @since 6
*/
caretColor(value: Color | number | string | Resource): T;
/**
* Called when the input changes.
* @devices phone, tablet, car.
* @since 7
*/
onChange(callback: (value: string) => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const TextAreaInterface: TextArea;

View File

@ -1,193 +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.
*/
import {CommonMethod, Color, Resource} from "./common";
import {FontWeight, FontStyle} from "./text";
/**
* Declare the type of input box
* @devices phone, tablet, car.
* @since 7
*/
export declare enum InputType {
/**
* Basic input mode.
* @devices phone, tablet, car.
* @since 7
*/
Normal,
/**
* Password entry mode.
* @devices phone, tablet, car.
* @since 7
*/
Number,
/**
* E-mail address input mode.
* @devices phone, tablet, car.
* @since 7
*/
Email,
/**
* Pure digital input mode.
* @devices phone, tablet, car.
* @since 7
*/
Password,
}
/**
* Declare the type of soft keyboard.
* @devices phone, tablet, car.
* @since 7
*/
export declare enum EnterKeyType {
/**
* Go.
* @devices phone, tablet, car.
* @since 7
*/
Go,
/**
* Search.
* @devices phone, tablet, car.
* @since 7
*/
Search,
/**
* Send.
* @devices phone, tablet, car.
* @since 7
*/
Send,
/**
* Next.
* @devices phone, tablet, car.
* @since 7
*/
Next,
/**
* Done.
* @devices phone, tablet, car.
* @since 7
*/
Done,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class TextInputExtend<T> extends TextInputAttribute<T> {
}
/**
* Provides a single-line text input component interface.
* @devices phone, tablet, car.
* @since 7
*/
interface TextInput extends TextInputAttribute<TextInput> {
/**
* Called when writing a single line of text.
* @devices phone, tablet, car.
* @since 7
*/
(options?: {
placeholder: string | Resource,
text: string | Resource,
}): TextInput;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class TextInputAttribute<T> extends CommonMethod<T> {
/**
* Called when the input type is set.
* @devices phone, tablet, car.
* @since 7
*/
type(value: InputType): T;
/**
* Called when the color of the placeholder is set.
* @devices phone, tablet, car.
* @since 7
*/
placeholderColor(value: Color | number | string | Resource): T;
/**
* Called when the font property of the placeholder is set.
* @devices phone, tablet, car.
* @since 7
*/
placeholderFont(value?: { size?: number | string | Resource, weight?: number | FontWeight | string, family?: string | Resource, style?: FontStyle }): T;
/**
* Called when the type of soft keyboard input button is set.
* @devices phone, tablet, car.
* @since 7
*/
enterKeyType(value: EnterKeyType): T;
/**
* Called when the color of the insertion cursor is set.
* @devices phone, tablet, car.
* @since 7
*/
caretColor(value: Color | number | string | Resource): T;
/**
* Called when judging whether the text editing has changed.
* @devices phone, tablet, car.
* @since 7
*/
onEditChanged(callback: (isEditing: boolean) => void): T;
/**
* Called when submitted.
* @devices phone, tablet, car.
* @since 7
*/
onSubmit(callback: (enterKey: EnterKeyType) => void): T;
/**
* Called when the input of the input box changes.
* @devices phone, tablet, car.
* @since 7
*/
onChange(callback: (value: string) => void): T;
/**
* Called when the input of maximum text length is set.
* @devices tv, phone, tablet, wearable, liteWearable, smartVision.
* @since 5
*/
maxLength(value: number): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare const TextInputInterface: TextInput;

View File

@ -13,85 +13,66 @@
* limitations under the License.
*/
import {CommonMethod, Color} from "./common";
import { CommonMethod } from "./common";
import { ResourceColor } from "./units";
/**
* Declare the type of status button
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
export declare enum ToggleType {
/**
* Checkbox
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Checkbox,
/**
* Switch
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Switch,
/**
* Button
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
Button
Button,
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ToggleExtend<T> extends ToggleAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
interface Toggle extends ToggleAttribute<Toggle> {
/**
* Set parameters to obtain the toggle.
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
(options?: {type: ToggleType, isOn?: boolean}): Toggle;
(options?: { type: ToggleType; isOn?: boolean }): Toggle;
}
/**
* @devices phone, tablet, car.
* @since 7
* @since 8
*/
declare class ToggleAttribute<T> extends CommonMethod<T> {
/**
* Called when the selected state of the component changes.
* @since 7
* @devices phone, tablet, car.
* @since 8
*/
onChange(callback: (isOn: boolean) => void): T;
/**
* Called when the color of the selected button is set.
* @since 7
* @devices phone, tablet, car.
* @since 8
*/
selectedColor(value: Color): T;
selectedColor(value: ResourceColor): T;
/**
* Called when the color of the selected button is set.
* @since 7
* @devices phone, tablet, car.
* @since 8
*/
swithPointStyle(color: Color): T;
swithPointColor(color: ResourceColor): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class ToggleExtend<T> extends ToggleAttribute<T> {}
export declare const ToggleInterface: Toggle;

132
api/@internal/component/ets/units.d.ts vendored Normal file
View File

@ -0,0 +1,132 @@
/*
* 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.
*/
import { Color, FontStyle, FontWeight } from "./enums";
/**
* Defines the data type of the interface restriction.
* @since 7
*/
export declare interface Resource {
/**
* Set id.
* @since 7
*/
readonly id: number;
/**
* Set type.
* @since 7
*/
readonly type: number;
/**
* Set params.
* @since 7
*/
readonly params?: any[];
}
/**
* Defines the length property with string, number and resource unit.
* @since 7
*/
export declare type Length = string | number | Resource;
/**
* Defines the string which can use resource.
* @since 7
*/
export declare type ResourceStr = string | Resource;
/**
* Defines the padding property.
* @since 7
*/
export declare type Padding = {
/**
* top property.
*/
top?: Length;
/**
* right property.
*/
right?: Length;
/**
* bottom property.
*/
bottom?: Length;
/**
* left property.
*/
left?: Length;
};
/**
* Defines the margin property.
* @sicne 7
*/
export declare type Margin = Padding;
/**
* Defines the offset property.
* @since 7
*/
export declare type Offset = {
/**
* dx property.
*/
dx: Length;
/**
* dy property.
*/
dy: Length;
};
/**
* Defines the color which can use resource.
* @since 7
*/
export declare type ResourceColor = Color | number | string | Resource;
/**
* Defines the font used for text.
* @since 7
*/
export declare interface Font {
/**
* font size.
*/
size?: Length;
/**
* font weight.
*/
weight?: FontWeight | number | string;
/**
* font family.
*/
family?: string | Resource;
/**
* font style.
*/
style?: FontStyle;
}

View File

@ -13,194 +13,161 @@
* limitations under the License.
*/
import {CommonMethod, ImageFit, Resource} from "./common";
import { CommonMethod } from "./common";
import { ImageFit } from "./enums";
import { Resource } from "./units";
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class VideoController {
/**
* constructor.
* @since 7
* @devices phone, tablet, car.
*/
constructor();
/**
* Provides events to play.
* @since 7
* @devices phone, tablet, car.
*/
start();
/**
* Provides a pause event for playback.
* @since 7
* @devices phone, tablet, car.
*/
pause();
/**
* Provides an event to stop playback.
* @since 6
* @devices phone, tablet, car.
*/
stop();
/**
* Provide the progress method of video playback.
* @since 7
* @devices phone, tablet, car.
*/
setCurrentTime(value: number);
/**
* Provides a full screen playback method.
* @since 7
* @devices phone, tablet, car.
*/
requestFullscreen(value: boolean);
/**
* Provides a method to exit full screen playback.
* @since 7
* @devices phone, tablet, car.
*/
exitFullscreen();
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class VideoExtend<T> extends VideoAttribute<T> {
}
/**
* @devices phone, tablet, car.
* @since 7
*/
interface Video extends VideoAttribute<Video> {
/**
* Set the value.
* @devices phone, tablet, car.
* @since 7
*/
(value: {
src?: string | Resource,
currentProgressRate?: number | string,
previewUri?: string,
controller?: VideoController
src?: string | Resource;
currentProgressRate?: number | string;
previewUri?: string;
controller?: VideoController;
}): Video;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
declare class VideoAttribute<T> extends CommonMethod<T> {
/**
* Called when judging whether the video is muted.
* @since 7
* @devices phone, tablet, car.
*/
muted(value: boolean): T;
/**
* Called when judging whether the video is played automatically.
* @since 7
* @devices phone, tablet, car.
*/
autoPlay(value: boolean): T;
/**
* Called when judging whether the control bar is displayed.
* @since 7
* @devices phone, tablet, car.
*/
controls(value: boolean): T;
/**
* Called when judging whether the video is played circularly.
* @since 6
* @devices phone, tablet, car.
*/
loop(value: boolean): T;
/**
* Called when determining the zoom type of the video source.
* @since 7
* @devices phone, tablet, car.
*/
objectFit(value: ImageFit): T;
/**
* Called when the video is played.
* @since 7
* @devices phone, tablet, car.
*/
onStart(event: () => void): T;
/**
* Called when the video is paused.
* @since 7
* @devices phone, tablet, car.
*/
onPause(event: () => void): T;
/**
* Called when the video playback ends.
* @since 7
* @devices phone, tablet, car.
*/
onFinish(event: () => void): T;
/**
* Called when the video enters and exits the full screen.
* @since 7
* @devices phone, tablet, car.
*/
onFullscreenChange(callback: (event?: { fullscreen: boolean }) => void): T;
/**
* Called when the video preparation is complete.
* @since 7
* @devices phone, tablet, car.
*/
onPrepared(callback: (event?: { duration: number }) => void): T;
/**
* Called when the time information is reported when the progress bar process is operated.
* @since 7
* @devices phone, tablet, car.
*/
onSeeking(callback: (event?: { time: number }) => void): T;
/**
* Called when the playback time information is reported after the operation progress bar is completed.
* @since 7
* @devices phone, tablet, car.
*/
onSeeked(callback: (event?: { time: number }) => void): T;
/**
* Called when the playback progress changes.
* @since 7
* @devices phone, tablet, car.
*/
onUpdate(callback: (event?: { time: number }) => void): T;
/**
* Called when playback fails.
* @since 7
* @devices phone, tablet, car.
*/
onError(event: () => void): T;
}
/**
* @devices phone, tablet, car.
* @since 7
*/
export declare class VideoExtend<T> extends VideoAttribute<T> {}
export declare const VideoInterface: Video;

View File

@ -1,34 +1,97 @@
/*
* 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.
*/
import {CommonMethod} from "./common";
export declare class WebController {
constructor();
reload();
}
interface Web extends CommonMethod<Web> {
(value:{
src: string,
controller: WebController,
}): Web;
onPageStart(callback: (url: string) => void): Web;
onPageFinish(callback: (url: string) => void): Web;
onError(callback: (errorMsg: string) => void): Web;
onMessage(callback: (msg: string) => void): Web;
}
export declare const WebInterface: Web;
/*
* 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.
*/
import { CommonMethod } from "./common";
/**
* Defines the WebController.
* @since 8
*/
export declare class WebController {
/**
* Defines the constructor of WebController.
* @since 8
*/
constructor();
/**
* Reload current web page.
* @since 8
*/
reload();
}
/**
* Defines the option of Web component.
* @since 8
*/
export declare interface WebOption {
/**
* The web url.
* @since 8
*/
src: string;
/**
* The web Controller.
* @since 8
*/
controller: WebController;
}
/**
* Defines the Web component.
* @since 8
*/
interface Web extends WebAttribute<Web> {
/**
* Defines the constructor of Web.
* @since 8
*/
(value: WebOption): Web;
}
/**
* Defines the Web component attribute functions.
* @since 8
*/
declare class WebAttribute<T> extends CommonMethod<T> {
/**
* The Callback of onPageStart.
* @since 8
*/
onPageStart(callback: (url: string) => void): T;
/**
* The Callback of onPageFinish.
* @since 8
*/
onPageFinish(callback: (url: string) => void): T;
/**
* The Callback of onError.
* @since 8
*/
onError(callback: (errorMsg: string) => void): T;
/**
* The Callback of onMessage.
* @since 8
*/
onMessage(callback: (msg: string) => void): T;
}
export declare class WebExtend<T> extends WebAttribute<T> {}
export declare const WebInterface: Web;