/* * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * Declare the type of status button * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Declare the type of status button * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Declare the type of status button * * @enum { number } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ declare enum ToggleType { /** * Checkbox * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Checkbox * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Checkbox * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ Checkbox, /** * Switch * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Switch * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Switch * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ Switch, /** * Button * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Button * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Button * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ Button, } /** * Defines the toggle interface. * * @interface ToggleInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Defines the toggle interface. * * @interface ToggleInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Defines the toggle interface. * * @interface ToggleInterface * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ interface ToggleInterface { /** * Set parameters to obtain the toggle. * * @param { object } options * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Set parameters to obtain the toggle. * * @param { object } options * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Set parameters to obtain the toggle. * * @param { object } options * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ (options: { type: ToggleType; isOn?: boolean }): ToggleAttribute; } /** * Defines the toggle attribute functions * * @extends CommonMethod * @since 8 */ /** * Defines the toggle attribute functions * * @extends CommonMethod * @since 9 * @form */ /** * Defines the toggle attribute functions * * @extends CommonMethod * @crossplatform * @since 10 * @form */ declare class ToggleAttribute extends CommonMethod { /** * Called when the selected state of the component changes. * * @param { function } callback * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Called when the selected state of the component changes. * * @param { function } callback * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Called when the selected state of the component changes. * * @param { function } callback * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ onChange(callback: (isOn: boolean) => void): ToggleAttribute; /** * Called when the color of the selected button is set. * * @param { ResourceColor } value * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Called when the color of the selected button is set. * * @param { ResourceColor } value * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Called when the color of the selected button is set. * * @param { ResourceColor } value * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ selectedColor(value: ResourceColor): ToggleAttribute; /** * Called when the color of the selected button is set. * * @param { ResourceColor } color * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Called when the color of the selected button is set. * * @param { ResourceColor } color * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Called when the color of the selected button is set. * * @param { ResourceColor } color * @returns { ToggleAttribute } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ switchPointColor(color: ResourceColor): ToggleAttribute; } /** * Defines Toggle Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Defines Toggle Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Defines Toggle Component. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ declare const Toggle: ToggleInterface; /** * Defines Toggle Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Defines Toggle Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 9 * @form */ /** * Defines Toggle Component instance. * * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @since 10 * @form */ declare const ToggleInstance: ToggleAttribute;