sidebar dts code commit

Signed-off-by: yaoyuchi <yaoyuchi@huawei.com>
This commit is contained in:
yaoyuchi 2022-01-28 09:24:25 +08:00
parent eafa0a30af
commit 1131c27a25
3 changed files with 119 additions and 0 deletions

View File

@ -87,6 +87,7 @@ ohos_copy("ets_component") {
"api/@internal/component/ets/search.d.ts",
"api/@internal/component/ets/shape.d.ts",
"api/@internal/component/ets/sheet.d.ts",
"api/@internal/component/ets/sidebar.d.ts",
"api/@internal/component/ets/slider.d.ts",
"api/@internal/component/ets/span.d.ts",
"api/@internal/component/ets/stack.d.ts",

View File

@ -97,3 +97,4 @@
/// <reference path="./web.d.ts" />
/// <reference path="./xcomponent.d.ts" />
/// <reference path="./inspector.d.ts" />
/// <reference path="./sidebar.d.ts" />

117
api/@internal/component/ets/sidebar.d.ts vendored Normal file
View File

@ -0,0 +1,117 @@
/*
* 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.
*/
/**
* Sets the sidebar style of showing
* @since 8
*/
declare enum SideBarContainerStyle {
/**
* The sidebar invisible
* @since 8
*/
Embed,
/**
* The sidebar visible
* @since 8
*/
Overlay
}
/**
* Sets the control button style
* @since 8
*/
declare interface ButtonStyle {
/**
* Set the left of control button
* @since 8
*/
left?: number;
/**
* Set the top of control button
* @since 8
*/
top?: number;
/**
* Set the width of control button
* @since 8
*/
width?: number;
/**
* Set the heigth of control button
* @since 8
*/
height?: number;
/**
* Set the button icon when sidebar status has changed
* @since 8
*/
icons?: {shown:string, hidden: string, switching?: string}
}
/**
* The construct function of sidebar
* @since 8
*/
interface SideBarContainerInterface {
/**
* Called when showing the sidebar of a block entry.
* @since 8
*/
(options?: { showSideBarContainer?: boolean,
style?: SideBarContainerStyle,
buttonAtt?: ButtonStyle}): SideBarContainerAttribute;
}
/**
* The attribute function of sidebar
* @since 8
*/
declare class SideBarContainerAttribute extends CommonMethod<SideBarContainerAttribute> {
/**
* Callback showControlButton function when setting the status of button
* @since 8
*/
showControlButton(value: boolean): SideBarContainerAttribute;
/**
* Callback onChange function when sidebar style of showing has changed
* @since 8
*/
onChange(callback: (value: boolean) => void): SideBarContainerAttribute;
/**
* Sets the length of sidebar.
* @since 8
*/
sideBarWidth(value: number): SideBarContainerAttribute;
/**
* Sets the min length of sidebar.
* default value is 200vp.
* @since 8
*/
minSideBarWidth(value: number): SideBarContainerAttribute;
/**
* Sets the max length of sidebar.
* default value is 280vp.
* @since 8
*/
maxSideBarWidth(value: number): SideBarContainerAttribute;
}
declare const SideBarContainer: SideBarContainerInterface;
declare const SideBarContainerInstance: SideBarContainerAttribute;