1/* 2 * Copyright (c) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * Provides an interface for RichText component. 18 * 19 * @interface RichTextInterface 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 8 22 */ 23interface RichTextInterface { 24 /** 25 * Set value. 26 * 27 * @param { string } content 28 * @returns { RichTextAttribute } 29 * @syscap SystemCapability.ArkUI.ArkUI.Full 30 * @since 8 31 */ 32 (content: string): RichTextAttribute; 33} 34 35/** 36 * Defines the RichText attribute functions. 37 * 38 * @extends CommonMethod 39 * @syscap SystemCapability.ArkUI.ArkUI.Full 40 * @since 8 41 */ 42declare class RichTextAttribute extends CommonMethod<RichTextAttribute> { 43 /** 44 * Triggered when the RichText loading starts. 45 * 46 * @param { function } callback 47 * @returns { RichTextAttribute } 48 * @syscap SystemCapability.ArkUI.ArkUI.Full 49 * @since 8 50 */ 51 onStart(callback: () => void): RichTextAttribute; 52 53 /** 54 * Triggered when the RichText loading ends. 55 * 56 * @param { function } callback 57 * @returns { RichTextAttribute } 58 * @syscap SystemCapability.ArkUI.ArkUI.Full 59 * @since 8 60 */ 61 onComplete(callback: () => void): RichTextAttribute; 62} 63 64/** 65 * Defines RichText Component. 66 * 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @since 8 69 */ 70declare const RichText: RichTextInterface; 71 72/** 73 * Defines RichText Component instance. 74 * 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @since 8 77 */ 78declare const RichTextInstance: RichTextAttribute; 79