diff --git a/BUILD.gn b/BUILD.gn index c3244d0bb32f281bd99e5efb044e8e31d6e7aa64..1e701d5aa01c7268b8fdc0002afc0395e975a3e3 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -80,6 +80,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/rating.d.ts", "api/@internal/component/ets/rect.d.ts", "api/@internal/component/ets/refresh.d.ts", + "api/@internal/component/ets/rich_text.d.ts", "api/@internal/component/ets/row.d.ts", "api/@internal/component/ets/row_split.d.ts", "api/@internal/component/ets/scroll.d.ts", diff --git a/api/@internal/component/ets/index.d.ts b/api/@internal/component/ets/index.d.ts index 7596be204b7d245406541292f0e6ebeb116ec6bb..639d1011228f8479969a1da809cfe95c45850020 100644 --- a/api/@internal/component/ets/index.d.ts +++ b/api/@internal/component/ets/index.d.ts @@ -68,6 +68,7 @@ /// /// /// +/// /// /// /// diff --git a/api/@internal/component/ets/rich_text.d.ts b/api/@internal/component/ets/rich_text.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bcc6bf67e4ee81f1a54f26de5c0e40a3fa46c02 --- /dev/null +++ b/api/@internal/component/ets/rich_text.d.ts @@ -0,0 +1,65 @@ +/* + * 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. + */ + +/** + * Provides an interface for RichText component. + * @since 8 + */ +interface RichTextInterface { + /** + * Set value. + * @since 8 + */ + (content: string): RichTextAttribute; +} + +/** + * Defines the RichText attribute functions. + * @since 8 + */ +declare class RichTextAttribute extends CommonMethod { + /** + * Just use for genetate tsbundle + * @ignore ide should ignore this arrtibute + */ + create(content: string): RichTextAttribute; + + /** + * Just use for genetate tsbundle + * @ignore ide should ignore this arrtibute + */ + pop(): RichTextAttribute; + + /** + * Just use for genetate tsbundle + * @ignore ide should ignore this arrtibute + */ + debugLine(value: string): RichTextAttribute; + + /** + * Triggered when the RichText loading starts. + * @since 8 + */ + onStart(callback: () => void): RichTextAttribute; + + /** + * Triggered when the RichText loading ends. + * @since 8 + */ + onComplete(callback: () => void): RichTextAttribute; +} + +declare const RichText: RichTextInterface; +declare const RichTextInstance: RichTextAttribute;